on iko/ghcjs-patch-master help sign in
Fix test on macOS

We can't check for HSbase because on macOS we will remove transitive dependencies if we can.

commit4375a9620fa81aef719527455280504225bfb967 authorMoritz Angermann <moritz.angermann@gmail.com> dateFri 25 Jan 2019, 22:20 (8 years ago) parent26e147d
2 files changed+21−9
test/cabal-22/default.nix+16−7 test/cabal-simple/default.nix+5−2
test/cabal-22/default.nix+16−7
@@ -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
test/cabal-simple/default.nix+5−2
@@ -7,7 +7,7 @@
77with stdenv.lib;
88
99let
10− pkgSet = haskell.mkNewPkgSet {
10+ pkgSet = haskell.mkPkgSet {
1111 inherit pkgs;
1212 pkg-def = import ./plan.nix;
1313 pkg-def-overlays = [
@@ -35,8 +35,11 @@ in
3535
3636 # fixme: linux-specific
3737 printf "checking that executable is dynamically linked to system libraries... " >& 2
38+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
3839 ldd $exe | grep libpthread
39−
40+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
41+ otool -L $exe |grep .dylib
42+ '' + ''
4043 touch $out
4144 '';
4245