nix: fix static build
- the isExecutable patch was broken, remove it - the ncurses fix was broken, we still need `enableStatic` - the original error was caused by the new ghc-bignum package, which isn't a "proper" Haskell package; we filter this out explicitly now
This commit is contained in:
@@ -24,6 +24,6 @@
|
||||
|
||||
static-haskell-nix-ncurses =
|
||||
./static-haskell-nix-ncurses.patch;
|
||||
static-haskell-nix-isexecutable =
|
||||
./static-haskell-nix-isexecutable.patch;
|
||||
static-haskell-nix-ghc-bignum =
|
||||
./static-haskell-nix-ghc-bignum.patch;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/survey/default.nix b/survey/default.nix
|
||||
index 70afbbc..28cb0e9 100644
|
||||
--- a/survey/default.nix
|
||||
+++ b/survey/default.nix
|
||||
@@ -81,6 +81,7 @@ let
|
||||
# `.override` and the likes).
|
||||
isProperHaskellPackage = val:
|
||||
lib.isDerivation val && # must pass lib.isDerivation
|
||||
+ val.pname != "ghc-bignum" &&
|
||||
val ? env; # must have an .env key
|
||||
|
||||
# Function that tells us if a given Haskell package has an executable.
|
||||
@@ -1,18 +0,0 @@
|
||||
diff --git a/survey/default.nix b/survey/default.nix
|
||||
index 46d8066..5f7950b 100644
|
||||
--- a/survey/default.nix
|
||||
+++ b/survey/default.nix
|
||||
@@ -85,10 +85,9 @@ let
|
||||
# Function that tells us if a given Haskell package has an executable.
|
||||
# Pass only Haskell packages to this!
|
||||
# Filter away other stuff with `isProperHaskellPackage` first.
|
||||
- isExecutable = pkg:
|
||||
- (pkgs.haskell.lib.overrideCabal pkg (drv: {
|
||||
- passthru.isExecutable = drv.isExecutable or false;
|
||||
- })).isExecutable;
|
||||
+ # FIXME postgrest: original fails with our nixpkgs version, we
|
||||
+ # just hardcode the check to work for a static postgrest build.
|
||||
+ isExecutable = pkg: pkg.name == "postgrest";
|
||||
|
||||
# Turn e.g. `Cabal_1_2_3_4` into `1.2.3.4`.
|
||||
cabalDottedVersion =
|
||||
@@ -7,7 +7,7 @@ index 46d8066..a47f214 100644
|
||||
"--enable-executable-static" # requires `useFixedCabal`
|
||||
# `enableShared` seems to be required to avoid `recompile with -fPIC` errors on some packages.
|
||||
- "--extra-lib-dirs=${final.ncurses.override { enableStatic = true; enableShared = true; }}/lib"
|
||||
+ "--extra-lib-dirs=${final.ncurses}/lib"
|
||||
+ "--extra-lib-dirs=${final.ncurses.override { enableStatic = true; }}/lib"
|
||||
]
|
||||
# TODO Figure out why this and the below libffi are necessary.
|
||||
# `working` and `workingStackageExecutables` don't seem to need that,
|
||||
|
||||
@@ -18,7 +18,7 @@ let
|
||||
static-haskell-nix
|
||||
[
|
||||
patches.static-haskell-nix-ncurses
|
||||
patches.static-haskell-nix-isexecutable
|
||||
patches.static-haskell-nix-ghc-bignum
|
||||
];
|
||||
|
||||
patchedNixpkgs =
|
||||
|
||||
Reference in New Issue
Block a user