on iko/ghcjs-patch-master help sign in
smaller
980c276Moritz Angermann
builder/comp-builder.nix+15−1
@@ -18,6 +18,8 @@
18
18
19, doCheck ? component.doCheck || componentId.ctype == "test"
19, doCheck ? component.doCheck || componentId.ctype == "test"
20, doCrossCheck ? component.doCrossCheck || false
20, doCrossCheck ? component.doCrossCheck || false
21+, dontPatchELF ? true
22+, dontStrip ? true
21}:
23}:
22
24
23let
25let
@@ -118,9 +120,21 @@ let
118 [ "--prefix=$out"
120 [ "--prefix=$out"
119 "${componentId.ctype}:${componentId.cname}"
121 "${componentId.ctype}:${componentId.cname}"
120 "$(cat ${configFiles}/configure-flags)"
122 "$(cat ${configFiles}/configure-flags)"
123+ # GHC
121 "--with-ghc=${ghc.targetPrefix}ghc"
124 "--with-ghc=${ghc.targetPrefix}ghc"
122 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
125 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
123 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
126 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
127+ # CC
128+ "--with-gcc=${stdenv.cc.targetPrefix}cc"
129+ # BINTOOLS
130+ "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
131+ "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
132+ "--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
133+ # other flags
134+ "--enable-static"
135+ "--enable-split-sections"
136+ "--enable-executable-stripping"
137+ "--enable-library-stripping"
124 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) (
138 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) (
125 map (arg: "--hsc2hs-option=" + arg) ["--cross-compile" "--via-asm"]
139 map (arg: "--hsc2hs-option=" + arg) ["--cross-compile" "--via-asm"]
126 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}"
140 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}"
@@ -130,7 +144,7 @@ let
130in stdenv.mkDerivation ({
144in stdenv.mkDerivation ({
131 name = fullName;
145 name = fullName;
132
146
133− inherit src doCheck doCrossCheck;
147+ inherit src doCheck doCrossCheck dontPatchELF dontStrip;
134
148
135 passthru = {
149 passthru = {
136 inherit (package) identifier;
150 inherit (package) identifier;