-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
36 lines (36 loc) · 1.15 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs ? import <nixpkgs> {}
, profiling ? false
, doCheck ? true
}:
let
odrv = with pkgs; with haskellPackages; developPackage {
root = ./.;
name = "CarpHask";
modifier = lib.flip haskell.lib.overrideCabal (_: {
buildTools = [
cabal-install clang gdb
ormolu hlint flamegraph ghc-prof-flamegraph
] ++ lib.optionals stdenv.isLinux [ linuxPackages.perf tinycc zig ];
pkg-configDepends = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf glfw ];
enableLibraryProfiling = profiling;
enableExecutableProfiling = profiling;
enableSharedLibraries = false;
enableSharedExecutables = false;
});
};
drv = with pkgs; odrv.overrideAttrs (o: {
inherit doCheck;
buildInputs = o.buildInputs ++ [ makeWrapper pkgconfig ];
postPatch = ''
patchShebangs .
'';
postInstall = ''
wrapProgram $out/bin/carp --set CARP_DIR $src --prefix PATH : ${clang}/bin
wrapProgram $out/bin/carp-header-parse --set CARP_DIR $src --prefix PATH : ${clang}/bin
'';
postCheck = ''
env CARP=dist/build/carp/carp scripts/run_carp_tests.sh
'';
enableParallelBuilding = true;
});
in drv