You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.1 KiB
Plaintext

3 years ago
# -*- 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()
{
# 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.
ENVIRONMENTS=(
3 years ago
weechat # Debug runs
3 years ago
profanity # Test
3 years ago
)
# Environment packages.
PACKAGES=(
3 years ago
profanity # Test
3 years ago
autoconf # Deps with autoreconf
autoconf-archive # Deps with m4 tooling
automake # Deps with automake
libtool # Deps with libtool
make # Makefile and deps with makefiles
cmake # Deps with cmake
3 years ago
gcc-toolchain@11 # Compilation
3 years ago
pkg-config # Deps configuration and configuration of deps deps
patchelf # Fix linkage (guix)
bear # Generate compile_commands.json for language servers
universal-ctags # Generate tags (make tags)
weechat # Weechat includes
libxml2 # Dep (libxml2)
libstrophe # Dep (strophe)
libgcrypt # Dep (gcrypt)
3 years ago
lmdb # Dep (lmdb)
3 years ago
rnp # Dep (rnpgp)
3 years ago
libsignal-protocol-c -l libomemo.scm # Dep (libsignal)
)
3 years ago
# Thanks <https://lists.gnu.org/archive/html/guix-devel/2016-09/msg00859.html>
eval "$(guix environment --search-paths --root="$gcroot" ${ENVIRONMENTS[@]} --ad-hoc ${PACKAGES[@]} "$@")"
3 years ago
export CC=gcc
}
3 years ago
use guix \
3 years ago
--with-debug-info=profanity\
3 years ago
--with-debug-info=weechat\
--with-debug-info=libstrophe\
--with-debug-info=libsignal-protocol-c\
3 years ago
--with-debug-info=libomemo-c\
3 years ago
--with-debug-info=lmdb\
3 years ago
--with-debug-info=rnp\
3 years ago
clang:extra gdb lmdb