blob: e4d4f7eb88b3b52c7bcc768f0a4bf85b5cafa58b (
plain) (
blame)
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
|
{ craneLib, lib
, pkg-config, wrapGAppsHook
, gtk4, libadwaita, libpanel, libsoup_3, libsecret, librsvg, gettext
}:
let
src = let
suffixes = [];
suffixFilter = name: type: let
base = baseNameOf (toString name);
in type == "directory" || lib.any (ext: lib.hasSuffix ext base) suffixes;
in lib.cleanSourceWith {
src = ./.; # The original, unfiltered source
filter = path: type: (suffixFilter path type) || (craneLib.filterCargoSources path type);
name = "source"; # Be reproducible, regardless of the directory name
};
args = {
# pname and version are read from Cargo.toml
inherit src;
dummySrc = craneLib.mkDummySrc {
inherit src;
extraDummyScript = ''
cp -r ${./icons.toml} $out/icons.toml
'';
};
strictDeps = true;
# cargoExtraArgs can be used to inject features
buildInputs = [ gtk4 libadwaita libpanel libsoup_3 libsecret librsvg gettext ];
nativeBuildInputs = [ pkg-config wrapGAppsHook gettext ];
meta = with lib.meta; {
maintainers = with lib.maintainers; [ vikanezrimaya ];
platforms = ["aarch64-linux" "x86_64-linux"];
mainProgram = "bowl";
};
};
cargoArtifacts = craneLib.buildDepsOnly args;
args' = args // { inherit cargoArtifacts; };
in craneLib.buildPackage (args' // {
passthru = {
inherit src cargoArtifacts;
clippy = craneLib.cargoClippy args';
};
})
|