-
Notifications
You must be signed in to change notification settings - Fork 1
/
pkg.nix
62 lines (60 loc) · 1.64 KB
/
pkg.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
60
61
{
naersk,
pkg-config,
freetype,
systemd,
fontconfig,
bluez,
xorg,
vulkan-loader,
libxkbcommon,
wayland,
callPackage,
cmake,
makeWrapper,
lib,
guiPreview ? false,
fullBuild ? false,
...
}: let
guiInputs = (with xorg; [libX11 libXcursor libXrandr libXi]) ++ [vulkan-loader libxkbcommon wayland];
commonBuildInputs = [pkg-config freetype systemd fontconfig bluez];
naersk' = callPackage naersk {};
pname =
if fullBuild
then "d30-cli-full"
else "d30-cli";
buildInputs = commonBuildInputs ++ (lib.optionals guiPreview guiInputs);
in (naersk'.buildPackage {
src = ./.;
nativeBuildInputs = [pkg-config cmake makeWrapper];
inherit pname buildInputs;
}
// (lib.optionalAttrs guiPreview {
postInstall = ''
wrapProgram "$out/bin/${pname}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (buildInputs ++ guiInputs)}"
'';
})
// (lib.optionalAttrs (!fullBuild) {
cargoBuildOptions = opts: opts ++ ["--package" pname];
}))
# d30-cli = naersk'.buildPackage rec {
# pname = "d30-cli";
# src = ./.;
# nativeBuildInputs = [pkg-config cmake makeWrapper];
# buildInputs = commonBuildInputs;
# cargoBuildOptions = opts: opts ++ ["--package" pname];
# };
# d30-cli-preview = naersk'.buildPackage rec {
# pname = "d30-cli-preview";
# src = ./.;
# nativeBuildInputs = [pkg-config cmake makeWrapper];
# buildInputs = commonBuildInputs ++ guiInputs;
# cargoBuildOptions = opts: opts ++ ["--package" pname];
# postInstall = ''
# wrapProgram "$out/bin/${pname}" \
# --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (buildInputs ++ guiInputs)}"
# '';
# };
# }