-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
48 lines (43 loc) · 1.26 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
43
44
45
46
47
48
{
description = "hdoc";
outputs = { self, nixpkgs }: {
pkgs = import nixpkgs { system = "x86_64-linux"; };
buildTimeDeps = with import nixpkgs { system = "x86_64-linux"; }; [
xxd
meson
cmake
ninja
pkg-config
];
gitrev = if (self ? rev) then builtins.substring 0 7 self.rev else "dirty";
packages.x86_64-linux.hdoc = with import nixpkgs { system = "x86_64-linux"; };
stdenv.mkDerivation {
name = "hdoc";
src = self;
nativeBuildInputs = self.buildTimeDeps;
buildInputs = [
openssl
llvmPackages_13.clang-unwrapped
llvmPackages_13.llvm
llvmPackages_13.libclang
];
CPPFLAGS = ''-DHDOC_GIT_REV=\"${self.gitrev}\"'';
installPhase = ''
mkdir -p $out/bin;
install -t $out/bin hdoc;
install -t $out/bin hdoc-client;
'';
};
defaultPackage.x86_64-linux = self.packages.x86_64-linux.hdoc;
devShell.x86_64-linux = with import nixpkgs { system = "x86_64-linux"; };
mkShell {
buildInputs = self.buildTimeDeps ++ [
zola
openssl
llvmPackages_13.clang-unwrapped
llvmPackages_13.llvm
llvmPackages_13.libclang
];
};
};
}