|
|
@ -1,48 +1,24 @@
|
|
|
|
# -*- mode: sh; -*-
|
|
|
|
# -*- mode: sh; -*-
|
|
|
|
# Thanks <https://github.com/direnv/direnv/issues/73#issuecomment-152284914>
|
|
|
|
|
|
|
|
export_function()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
local name=$1
|
|
|
|
|
|
|
|
local alias_dir=$PWD/.direnv/aliases
|
|
|
|
|
|
|
|
mkdir -p "$alias_dir"
|
|
|
|
|
|
|
|
PATH_add "$alias_dir"
|
|
|
|
|
|
|
|
local target="$alias_dir/$name"
|
|
|
|
|
|
|
|
if declare -f "$name" >/dev/null; then
|
|
|
|
|
|
|
|
echo "#!$SHELL" > "$target"
|
|
|
|
|
|
|
|
declare -f "$name" >> "$target" 2>/dev/null
|
|
|
|
|
|
|
|
# Notice that we add shell variables to the function trigger.
|
|
|
|
|
|
|
|
echo "$name \$*" >> "$target"
|
|
|
|
|
|
|
|
chmod +x "$target"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use_guix()
|
|
|
|
export CC=gcc CXX="g++ -fdiagnostics-color=always"
|
|
|
|
{
|
|
|
|
|
|
|
|
# Recreate a garbage collector root.
|
|
|
|
|
|
|
|
gcroots="$HOME/.config/guix/gcroots"
|
|
|
|
|
|
|
|
mkdir -p "$gcroots"
|
|
|
|
|
|
|
|
gcroot="$gcroots/guix"
|
|
|
|
|
|
|
|
if [ -L "$gcroot" ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
rm -v "$gcroot"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Miscellaneous packages.
|
|
|
|
# Miscellaneous packages.
|
|
|
|
ENVIRONMENTS=(
|
|
|
|
ENVIRONMENTS=(
|
|
|
|
weechat # Debug runs
|
|
|
|
weechat # Debug runs
|
|
|
|
profanity # Test
|
|
|
|
profanity # Test
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Environment packages.
|
|
|
|
# Environment packages.
|
|
|
|
PACKAGES=(
|
|
|
|
PACKAGES=(
|
|
|
|
profanity # Test
|
|
|
|
profanity # Test
|
|
|
|
autoconf # Deps with autoreconf
|
|
|
|
autoconf # Deps with autoreconf
|
|
|
|
autoconf-archive # Deps with m4 tooling
|
|
|
|
autoconf-archive # Deps with m4 tooling
|
|
|
|
automake # Deps with automake
|
|
|
|
automake # Deps with automake
|
|
|
|
libtool # Deps with libtool
|
|
|
|
libtool # Deps with libtool
|
|
|
|
make # Makefile and deps with makefiles
|
|
|
|
make # Deps with makefiles
|
|
|
|
cmake # Deps with cmake
|
|
|
|
cmake # Deps with cmake
|
|
|
|
gcc-toolchain@11 # Compilation
|
|
|
|
doctest # Testing
|
|
|
|
|
|
|
|
gcc-toolchain@10 # Compilation
|
|
|
|
pkg-config # Deps configuration and configuration of deps deps
|
|
|
|
pkg-config # Deps configuration and configuration of deps deps
|
|
|
|
patchelf # Fix linkage (guix)
|
|
|
|
patchelf # Fix linkage (guix)
|
|
|
|
bear # Generate compile_commands.json for language servers
|
|
|
|
bear # Generate compile_commands.json for language servers
|
|
|
@ -51,23 +27,29 @@ use_guix()
|
|
|
|
libxml2 # Dep (libxml2)
|
|
|
|
libxml2 # Dep (libxml2)
|
|
|
|
libstrophe # Dep (strophe)
|
|
|
|
libstrophe # Dep (strophe)
|
|
|
|
libgcrypt # Dep (gcrypt)
|
|
|
|
libgcrypt # Dep (gcrypt)
|
|
|
|
lmdb # Dep (lmdb)
|
|
|
|
|
|
|
|
rnp # Dep (rnpgp)
|
|
|
|
|
|
|
|
libsignal-protocol-c -l libomemo.scm # Dep (libsignal)
|
|
|
|
libsignal-protocol-c -l libomemo.scm # Dep (libsignal)
|
|
|
|
)
|
|
|
|
lmdb lmdbxx # Dep (lmdb)
|
|
|
|
|
|
|
|
rnp # Dep (rnpgp)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo direnv: fetching source - weechat
|
|
|
|
|
|
|
|
mkdir -p /tmp/guix-build-weechat-3.2.drv-0
|
|
|
|
|
|
|
|
tar -C /tmp/guix-build-weechat-3.2.drv-0 -xJf $(guix build --source weechat)
|
|
|
|
|
|
|
|
|
|
|
|
# Thanks <https://lists.gnu.org/archive/html/guix-devel/2016-09/msg00859.html>
|
|
|
|
echo direnv: fetching source - libomemo-c
|
|
|
|
eval "$(guix environment --search-paths --root="$gcroot" ${ENVIRONMENTS[@]} --ad-hoc ${PACKAGES[@]} "$@")"
|
|
|
|
mkdir -p /tmp/guix-build-libomemo-c-2.3.3.drv-0
|
|
|
|
|
|
|
|
ln -sf $(guix build --source -f libomemo.scm) /tmp/guix-build-libomemo-c-2.3.3.drv-0
|
|
|
|
|
|
|
|
|
|
|
|
export CC=gcc
|
|
|
|
echo direnv: fetching source - lmdb
|
|
|
|
}
|
|
|
|
ln -sf $(guix build --source lmdb)/libraries/liblmdb/mdb.c mdb.c
|
|
|
|
|
|
|
|
|
|
|
|
use guix \
|
|
|
|
use guix \
|
|
|
|
|
|
|
|
${ENVIRONMENTS[@]} --ad-hoc ${PACKAGES[@]} \
|
|
|
|
--with-debug-info=profanity\
|
|
|
|
--with-debug-info=profanity\
|
|
|
|
--with-debug-info=weechat\
|
|
|
|
--with-debug-info=weechat \
|
|
|
|
--with-debug-info=libstrophe\
|
|
|
|
--with-debug-info=libstrophe \
|
|
|
|
--with-debug-info=libsignal-protocol-c\
|
|
|
|
--with-debug-info=libsignal-protocol-c \
|
|
|
|
--with-debug-info=libomemo-c\
|
|
|
|
--with-debug-info=libomemo-c\
|
|
|
|
--with-debug-info=lmdb\
|
|
|
|
--with-debug-info=lmdb \
|
|
|
|
--with-debug-info=rnp\
|
|
|
|
--with-debug-info=rnp \
|
|
|
|
clang:extra gdb lmdb
|
|
|
|
clang clang:extra ccls gdb
|
|
|
|