git.iko.soy/nixpkgs-stackage
on master help sign in
stackage2nix-static disable-shared
3fa9589Dmitry Bushev
default.nix+10−10
@@ -26,8 +26,11 @@ in {
26
26
27 stackage2nix-static = super.callPackage ./stackage2nix {
27 stackage2nix-static = super.callPackage ./stackage2nix {
28 stackage2nix =
28 stackage2nix =
29− let
29+ (self.haskell.packages.stackage.lts-100.callPackage ./stackage2nix/stackage2nix.nix {}).overrideAttrs (attrs: {
30− staticConfigureFlags = super.lib.concatStringsSep " " [
30+ enableSharedExecutables = false;
31+ enableSharedLibraries = false;
32+ configureFlags = [
33+ "--disable-shared"
31 "--ghc-option=-optl=-static"
34 "--ghc-option=-optl=-static"
32 "--ghc-option=-optl=-pthread"
35 "--ghc-option=-optl=-pthread"
33 "--ghc-option=-optl=-L${super.glibc.static}/lib"
36 "--ghc-option=-optl=-L${super.glibc.static}/lib"
@@ -35,12 +38,9 @@ in {
35 "--ghc-option=-optl=-L${self.icu-static.static}/lib"
38 "--ghc-option=-optl=-L${self.icu-static.static}/lib"
36 "--ghc-option=-optl=-L${self.openssl-static.static}/lib"
39 "--ghc-option=-optl=-L${self.openssl-static.static}/lib"
37 "--ghc-option=-optl=-L${super.zlib.static}/lib"
40 "--ghc-option=-optl=-L${super.zlib.static}/lib"
41+ "--ghc-option=-fPIC"
38 ];
42 ];
39− buildStaticExecutable = drv:
43+ });
40− super.haskell.lib.appendConfigureFlag (super.haskell.lib.disableSharedExecutables drv) staticConfigureFlags;
41− in
42− buildStaticExecutable
43− (self.haskell.packages.stackage.lts-100.callPackage ./stackage2nix/stackage2nix.nix{});
44 cacheVersion = builtins.readFile ./cache-version.txt;
44 cacheVersion = builtins.readFile ./cache-version.txt;
45 };
45 };
46
46
@@ -50,7 +50,7 @@ in {
50 outputs = attrs.outputs ++ [ "static" ];
50 outputs = attrs.outputs ++ [ "static" ];
51 postInstall = ''
51 postInstall = ''
52 moveToOutput "lib/*.a" "$static"
52 moveToOutput "lib/*.a" "$static"
53− '' + attrs.postInstall;
53+ '' + (if attrs ? postInstall then attrs.postInstall else "");
54 });
54 });
55
55
56 openssl-static = super.openssl.overrideAttrs (attrs: {
56 openssl-static = super.openssl.overrideAttrs (attrs: {
@@ -58,8 +58,8 @@ in {
58 outputs = attrs.outputs ++ [ "static" ];
58 outputs = attrs.outputs ++ [ "static" ];
59 postInstall = ''
59 postInstall = ''
60 mkdir -p $static/lib;
60 mkdir -p $static/lib;
61− moveToOutput "*.a" "$static/lib";
61+ cp -v *.a $static/lib;
62− '' + attrs.postInstall;
62+ '' + (if attrs ? postInstall then attrs.postInstall else "");
63 });
63 });
64
64
65}
65}