-
Notifications
You must be signed in to change notification settings - Fork 33
/
flake.nix
42 lines (35 loc) · 1.39 KB
/
flake.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
37
38
39
40
41
42
# We can build GUI stuff!
# Don't try to build it statically though
{
inputs.opam-nix.url = "github:tweag/opam-nix";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, opam-nix, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: {
legacyPackages = let
inherit (opam-nix.lib.${system}) queryToScope;
pkgs = opam-nix.inputs.nixpkgs.legacyPackages.${system};
pkgs' = if pkgs.stdenv.isDarwin then pkgs else pkgs.pkgsStatic;
scope = queryToScope { } {
frama-c = "*";
alt-ergo = "2.4.1";
lablgtk3 = "*"; # Use lablgtk3 when appropriate
lablgtk3-sourceview3 = "*";
ocaml-base-compiler = "*";
};
overlay = self: super: {
frama-c = super.frama-c.overrideAttrs (oa: {
buildInputs = oa.buildInputs ++ [ pkgs'.freetype ];
nativeBuildInputs = oa.nativeBuildInputs ++ [ pkgs.makeWrapper ];
NIX_LDFLAGS = with pkgs;
"-L${pkgs'.fontconfig.lib}/lib -L${pkgs'.pkgsStatic.expat}/lib -lfontconfig -lfreetype -lexpat";
postInstall = ''
for i in $(find $out/bin -type f); do
wrapProgram "$i" --prefix OCAMLPATH : "$OCAMLPATH"
done
'';
});
};
in scope.overrideScope' overlay;
defaultPackage = self.legacyPackages.${system}.frama-c;
});
}