|
33 | 33 | # 0.5.7 is not available on aarch64 darwin so alternatively pick 0.8.5 |
34 | 34 | solc = solc-pkgs.mkDefault pkgs (pkgs.solc_0_5_7 or pkgs.solc_0_8_5); |
35 | 35 |
|
36 | | - secp256k1-static = pkgsDeps.secp256k1.overrideAttrs (attrs: { |
37 | | - configureFlags = attrs.configureFlags ++ [ "--enable-static" ]; |
38 | | - }); |
39 | | - |
40 | | - ncurses-static = pkgsDeps.ncurses.override { enableStatic = true; }; |
41 | | - |
42 | 36 | dependencies-static = with pkgsDeps; [ |
43 | 37 | (gmp.override { withStatic = true; }) |
44 | | - secp256k1-static |
| 38 | + (pkgsDeps.secp256k1.overrideAttrs (attrs: { |
| 39 | + configureFlags = attrs.configureFlags ++ [ "--enable-static" ]; |
| 40 | + })) |
45 | 41 | (libff.override { enableStatic = true; }) |
46 | | - ncurses-static |
| 42 | + (ncurses.override { enableStatic = true; }) |
47 | 43 | ] ++ lib.optionals (!pkgs.stdenv.hostPlatform.isDarwin) [ |
48 | 44 | # darwin provides these |
49 | 45 | (zlib.override { static = true; shared = false; }) |
|
86 | 82 | # be provided in a well known location by macos itself. |
87 | 83 | echidnaRedistributable = let |
88 | 84 | grep = "${pkgs.gnugrep}/bin/grep"; |
89 | | - perl = "${pkgs.perl}/bin/perl"; |
90 | 85 | otool = "${pkgs.darwin.binutils.bintools}/bin/otool"; |
91 | 86 | install_name_tool = "${pkgs.darwin.binutils.bintools}/bin/install_name_tool"; |
92 | 87 | codesign_allocate = "${pkgs.darwin.binutils.bintools}/bin/codesign_allocate"; |
93 | 88 | codesign = "${pkgs.darwin.sigtool}/bin/codesign"; |
94 | | - in if pkgs.stdenv.isLinux |
| 89 | + in if pkgs.stdenv.isDarwin |
95 | 90 | then pkgs.runCommand "echidna-stripNixRefs" {} '' |
96 | | - mkdir -p $out/bin |
97 | | - cp ${pkgs.haskell.lib.dontCheck echidna-static}/bin/echidna $out/bin/ |
98 | | - # fix TERMINFO path in ncurses |
99 | | - ${perl} -i -pe 's#(${ncurses-static}/share/terminfo)#"/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/lib/terminfo" . "\x0" x (length($1) - 65)#e' $out/bin/echidna |
100 | | - chmod 555 $out/bin/echidna |
101 | | - '' else pkgs.runCommand "echidna-stripNixRefs" {} '' |
102 | 91 | mkdir -p $out/bin |
103 | 92 | cp ${pkgs.haskell.lib.dontCheck echidna-static}/bin/echidna $out/bin/ |
104 | 93 | # rewrite /nix/... library paths to point to /usr/lib |
|
113 | 102 | *libz.dylib) ${install_name_tool} -change "$lib" /usr/lib/libz.dylib "$exe" ;; |
114 | 103 | esac |
115 | 104 | done |
116 | | - # fix TERMINFO path in ncurses |
117 | | - ${perl} -i -pe 's#(${ncurses-static}/share/terminfo)#"/usr/share/terminfo" . "\x0" x (length($1) - 19)#e' $out/bin/echidna |
118 | 105 | # check that no nix deps remain |
119 | 106 | nixdeps=$(${otool} -L "$exe" | tail -n +2 | { ${grep} /nix/store -c || test $? = 1; }) |
120 | 107 | if [ ! "$nixdeps" = "0" ]; then |
|
124 | 111 | # re-sign binary |
125 | 112 | CODESIGN_ALLOCATE=${codesign_allocate} ${codesign} -f -s - "$exe" |
126 | 113 | chmod 555 "$exe" |
127 | | - ''; |
| 114 | + '' else echidna-static; |
128 | 115 |
|
129 | 116 | # if we pass a library folder to ghc via --extra-lib-dirs that contains |
130 | 117 | # only .a files, then ghc will link that library statically instead of |
|
0 commit comments