@@ -6,7 +6,7 @@
66with stdenv.lib;
77
88let
9− pkgSet = haskell.mkNewPkgSet {
9+ pkgSet = haskell.mkPkgSet {
1010 inherit pkgs;
1111 pkg-def = import ./plan.nix;
1212 pkg-def-overlays = [
@@ -33,16 +33,25 @@ in
3333
3434 # fixme: linux-specific
3535 printf "checking that executable is dynamically linked to system libraries... " >& 2
36− ldd "$exe" | grep libpthread
37−
36+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
37+ ldd $exe | grep libpthread
38+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
39+ otool -L $exe | grep "libSystem.B"
40+ '' + ''
3841 # fixme: posix-specific
3942 printf "checking that dynamic library is produced... " >& 2
43+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
4044 sofile=$(find "${packages.project.components.library}" | grep -e '\.so$')
45+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
46+ sofile=$(find "${packages.project.components.library}" | grep -e '\.dylib$')
47+ '' + ''
4148 echo "$sofile"
42−
43− printf "checking that dynamic library is dynamically linked to base... " >& 2
44− ldd "$sofile" | grep libHSbase
45−
49+ printf "checking that dynamic library is dynamically linked to prim... " >& 2
50+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
51+ ldd $sofile | grep libHSghc-prim
52+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
53+ otool -L $sofile | grep libHSghc-prim
54+ '' + ''
4655 touch $out
4756 '';
4857