-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
package.nix
59 lines (59 loc) · 1.29 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
49
50
51
52
53
54
55
56
57
58
59
{
craneLib,
stdenv,
lib,
pkg-config,
libffi,
libiconv,
alsa-lib,
darwin,
rustPlatform,
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,full";
inherit doCheck;
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs =
[ libffi ]
++ lib.optionals stdenv.isLinux [ alsa-lib ]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks;
[
libiconv
AppKit
Foundation
CoreAudio
CoreMedia
AVFoundation
]
);
# https://crane.dev/faq/rebuilds-bindgen.html
env.NIX_OUTPATH_USED_AS_RANDOM_SEED = "uiuarustbg";
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
totalArgs = commonArgs // {
inherit cargoArtifacts;
cargoTestExtraArgs = "-- --skip format::generate_format_cfg_docs";
};
in
craneLib.buildPackage totalArgs