-
-
Notifications
You must be signed in to change notification settings - Fork 116
/
package.nix
48 lines (48 loc) · 1.01 KB
/
package.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
43
44
45
46
47
48
{
craneLib,
stdenv,
lib,
pkg-config,
libffi,
libiconv,
darwin,
doCheck ? true,
}:
let
commonArgs = {
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions (
[
(lib.fileset.fromSource (craneLib.cleanCargoSource ./.))
./src/primitive/assets
./src/algorithm/Uiua386.ttf
]
++ lib.optionals doCheck [
./site/favicon.ico
./tests
]
);
};
strictDeps = true;
cargoExtraArgs = "--features system";
inherit doCheck;
nativeBuildInputs = [ pkg-config ];
buildInputs =
[ libffi ]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks;
[
libiconv
AppKit
Foundation
]
);
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
totalArgs = commonArgs // {
inherit cargoArtifacts;
cargoTestExtraArgs = "-- --skip format::generate_format_cfg_docs";
};
in
craneLib.buildPackage totalArgs