Skip to content

Instantly share code, notes, and snippets.

@athas
Created April 8, 2020 20:57
Show Gist options
  • Select an option

  • Save athas/0474d01efc2d18aff9bf6be8da1d31f2 to your computer and use it in GitHub Desktop.

Select an option

Save athas/0474d01efc2d18aff9bf6be8da1d31f2 to your computer and use it in GitHub Desktop.
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc883" }:
let
pkgs = nixpkgs;
futhark =
pkgs.haskell.packages.${compiler}.callCabal2nix "futhark"
( pkgs.lib.cleanSource ./. ) { };
in
pkgs.haskell.lib.overrideCabal
futhark
( oldDrv: {
isLibrary = false;
isExecutable = true;
enableSharedExecutables = false;
enableSharedLibraries = false;
enableLibraryProfiling = false;
configureFlags = [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.ncurses.override { enableStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.glibc.static}/lib"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib"
];
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment