Skip to content

Commit

Permalink
nix: fix static build
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
robx committed Jun 15, 2022
1 parent df7d71d commit fdc45e6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
4 changes: 2 additions & 2 deletions nix/patches/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
12 changes: 12 additions & 0 deletions nix/patches/static-haskell-nix-ghc-bignum.patch
Original file line number Diff line number Diff line change
@@ -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.
18 changes: 0 additions & 18 deletions nix/patches/static-haskell-nix-isexecutable.patch

This file was deleted.

2 changes: 1 addition & 1 deletion nix/patches/static-haskell-nix-ncurses.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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,
2 changes: 1 addition & 1 deletion nix/static-haskell-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit fdc45e6

Please sign in to comment.