fix: explicitly export environment in shell

cabal has weird quirks which requires this to be done
This commit is contained in:
Marko Andjelic 2026-03-21 17:19:38 +00:00
commit 5266e68d0b
Signed by: marko
GPG key ID: 9C5E99C8C682FB59
3 changed files with 40 additions and 38 deletions

View file

@ -4,7 +4,7 @@
((guix licenses) #:prefix license:)
(gnu packages haskell)
(gnu packages haskell-xyz)
(gnu packages haskell-apps)
(gnu packages haskell-apps)
(gnu packages pkg-config)
(gnu packages commencement)
(gnu packages gtk)
@ -14,9 +14,9 @@
(gnu packages linux)
(gnu packages webkit)
(gnu packages build-tools)
(gnu packages gnome)
(gnu packages base)
(gnu packages bash))
(gnu packages gnome)
(gnu packages bash)
(gnu packages haskell-web))
(package
(name "svitak-dev-env")
@ -30,26 +30,44 @@
(search-path-specification
(variable "PKG_CONFIG_PATH")
(files '("lib/pkgconfig" "share/pkgconfig")))
(search-path-specification
(variable "GI_TYPELIB_PATH")
(files '("lib/girepository-1.0")))
(search-path-specification
(variable "LD_LIBRARY_PATH")
(files '("lib")))))
(files '("lib")))
(search-path-specification
(variable "LIBRARY_PATH")
(files '("lib")))
(search-path-specification
(variable "C_INCLUDE_PATH")
(files '("include")))))
(inputs
(list cairo
pango
gtk
webkitgtk
at-spi2-core
gdk-pixbuf
glib
libsoup
zlib
harfbuzz
gsettings-desktop-schemas))
(native-inputs
(list bash-minimal
coreutils
ghc-9.2
ghc
cabal-install
pkg-config
gcc-toolchain
gobject-introspection
cairo
pango
gtk+
webkitgtk
libsoup
glib
zlib
gnu-make
binutils))
binutils
ghc-libffi
ghc-gtk2hs-buildtools
ghc-http-client-tls
adwaita-icon-theme))
(synopsis "Svitak development environment")
(description "Environment for building Svitak with GTK and WebKit.")
(home-page "https://example.org")

View file

@ -1,22 +0,0 @@
(use-modules (guix profiles)
(guix search-paths)
(gnu packages)
(gnu packages base))
(let ((specs '("ghc" "cabal-install" "pkg-config" "coreutils" "bash" "grep" "sed"
"gobject-introspection" "gcc-toolchain" "make" "glibc-locales"
"gtk" "webkitgtk" "libadwaita" "libsoup" "glib" "glib-networking"
"cairo" "pango" "at-spi2-core" "gdk-pixbuf" "harfbuzz" "fribidi"
"libepoxy" "graphene" "mesa" "wayland" "wayland-protocols"
"libx11" "libxkbcommon" "coreutils" "bash")))
(manifest
(append
(manifest-entries (specifications->manifest specs))
(list (manifest-entry
(name "ld-library-path-automation")
(version "0")
(item (specification->package "bash"))
(search-paths
(list (search-path-specification
(variable "LD_LIBRARY_PATH")
(files '("lib"))))))))))

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
BOOK_PATH=""
@ -18,4 +18,10 @@ guix shell -C -N --emulate-fhs \
--preserve='^XDG_RUNTIME_DIR$' \
--preserve='^DBUS_SESSION_BUS_ADDRESS$' \
-D -f guix.scm -- \
bash -c "export TEST=2; cabal run svitak -- \"$BOOK_PATH\""
bash -c "export LD_LIBRARY_PATH=\$GUIX_ENVIRONMENT/lib:\$LD_LIBRARY_PATH
export GI_TYPELIB_PATH=\$GUIX_ENVIRONMENT/lib/girepository-1.0:\$GI_TYPELIB_PATH
echo \"LD_LIBRARY_PATH is: \$LD_LIBRARY_PATH\"
cabal clean
cabal run svitak -- \"$BOOK_PATH\""