Skip to content

Commit 04cb488

Browse files
committed
Set HASKELL_GI paths
1 parent 1128055 commit 04cb488

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

builder/make-config-files.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ stdenv, lib, haskellLib, ghc, nonReinstallablePkgs, runCommand, writeText, writeScript }@defaults:
1+
{ pkgs, stdenv, lib, haskellLib, ghc, nonReinstallablePkgs, runCommand, writeText, writeScript }@defaults:
22

33
{ identifier, component, fullName, flags ? {}, needsProfiling ? false, enableDWARF ? false, chooseDrv ? drv: drv, nonReinstallablePkgs ? defaults.nonReinstallablePkgs }:
44

@@ -121,7 +121,21 @@ let
121121
fi
122122
fi
123123
done
124+
${ # Help haskell.nix find .gir and .typelib files when compiling for musl
125+
lib.optionalString stdenv.hostPlatform.isMusl ''
124126
127+
for l in "''${pkgsHostTarget[@]}"; do
128+
if [ -d "$l/share/gir-1.0" ]; then
129+
HASKELL_GI_GIR_SEARCH_PATH="''${HASKELL_GI_GIR_SEARCH_PATH:+''${HASKELL_GI_GIR_SEARCH_PATH}:}$l/share/gir-1.0"
130+
fi
131+
if [ -d "$l/lib/girepository-1.0" ]; then
132+
HASKELL_GI_TYPELIB_SEARCH_PATH="''${HASKELL_GI_TYPELIB_SEARCH_PATH:+''${HASKELL_GI_TYPELIB_SEARCH_PATH}:}$l/lib/girepository-1.0"
133+
fi
134+
done
135+
export HASKELL_GI_GIR_SEARCH_PATH
136+
export HASKELL_GI_TYPELIB_SEARCH_PATH
137+
138+
''}
125139
${ # Note: we pass `clear` first to ensure that we never consult the implicit global package db.
126140
# However in `cabal.config` `cabal` requires `global` to be first.
127141
flagsAndConfig "package-db" ["clear"]

0 commit comments

Comments
 (0)