on iko/ghcjs-patch-master help sign in
Fix test on macOS
4375a96Moritz Angermann
test/cabal-22/default.nix+16−7
@@ -6,7 +6,7 @@
6with stdenv.lib;
6with stdenv.lib;
7
7
8let
8let
9− pkgSet = haskell.mkNewPkgSet {
9+ pkgSet = haskell.mkPkgSet {
10 inherit pkgs;
10 inherit pkgs;
11 pkg-def = import ./plan.nix;
11 pkg-def = import ./plan.nix;
12 pkg-def-overlays = [
12 pkg-def-overlays = [
@@ -33,16 +33,25 @@ in
33
33
34 # fixme: linux-specific
34 # fixme: linux-specific
35 printf "checking that executable is dynamically linked to system libraries... " >& 2
35 printf "checking that executable is dynamically linked to system libraries... " >& 2
36+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
36− ldd "$exe" | grep libpthread
37+ ldd $exe | grep libpthread
37−
38+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
39+ otool -L $exe | grep "libSystem.B"
40+ '' + ''
38 # fixme: posix-specific
41 # fixme: posix-specific
39 printf "checking that dynamic library is produced... " >& 2
42 printf "checking that dynamic library is produced... " >& 2
43+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
40 sofile=$(find "${packages.project.components.library}" | grep -e '\.so$')
44 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+ '' + ''
41 echo "$sofile"
48 echo "$sofile"
42−
43− printf "checking that dynamic library is dynamically linked to base... " >& 2
49+ printf "checking that dynamic library is dynamically linked to prim... " >& 2
50+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
44− ldd "$sofile" | grep libHSbase
51+ ldd $sofile | grep libHSghc-prim
45−
52+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
53+ otool -L $sofile | grep libHSghc-prim
54+ '' + ''
46 touch $out
55 touch $out
47 '';
56 '';
48
57
test/cabal-simple/default.nix+5−2
@@ -7,7 +7,7 @@
7with stdenv.lib;
7with stdenv.lib;
8
8
9let
9let
10− pkgSet = haskell.mkNewPkgSet {
10+ pkgSet = haskell.mkPkgSet {
11 inherit pkgs;
11 inherit pkgs;
12 pkg-def = import ./plan.nix;
12 pkg-def = import ./plan.nix;
13 pkg-def-overlays = [
13 pkg-def-overlays = [
@@ -35,8 +35,11 @@ in
35
35
36 # fixme: linux-specific
36 # fixme: linux-specific
37 printf "checking that executable is dynamically linked to system libraries... " >& 2
37 printf "checking that executable is dynamically linked to system libraries... " >& 2
38+ '' + pkgs.lib.optionalString pkgs.stdenv.isLinux ''
38 ldd $exe | grep libpthread
39 ldd $exe | grep libpthread
39−
40+ '' + pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
41+ otool -L $exe |grep .dylib
42+ '' + ''
40 touch $out
43 touch $out
41 '';
44 '';
42
45