-
Notifications
You must be signed in to change notification settings - Fork 3
/
default.nix
65 lines (65 loc) · 1.35 KB
/
default.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
62
63
64
65
{ stdenv
, elfutils
, meson
, ninja
, pkgconf
, dbus
, rustPlatform
, libdisplay-info
, libffi
, libxcb
, libXau
, libXdmcp
, libev
, libxkbcommon
, libunwind
, llvmPackages
, lua
, luaPackages
, systemdLibs
, cargo
, sphinx
, rustc
, python3
, xcbutilkeysyms
, xdotool
, zlib
, zstd }:
let
python = python3.withPackages (p: [
p.sphinx
p.sphinx_rtd_theme
]);
cargoVendor = rustPlatform.importCargoLock {
lockFile = ./nix/scanner.lock;
};
in
stdenv.mkDerivation {
src = ./.;
name = "deai";
nativeBuildInputs = [ meson ninja pkgconf cargo rustc python llvmPackages.clang xdotool luaPackages.ldoc ];
buildInputs = [
libev libffi libxcb libXau libXdmcp xcbutilkeysyms libxkbcommon dbus systemdLibs lua libdisplay-info
libunwind elfutils zlib zstd
];
env = {
LLVM_CONFIG_PATH = "${llvmPackages.libllvm.dev}/bin/llvm-config";
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
};
outputs = [ "out" "doc" ];
passthru.providedSessions = [ "deai" ];
prePatch = ''
mkdir docs/scanner/.cargo
echo "[source.crates-io]
replace-with = \"vendored-sources\"
[source.vendored-sources]
directory = \"${cargoVendor}\"
[net]
offline = true" > docs/scanner/.cargo/config.toml
cp nix/scanner.lock docs/scanner/Cargo.lock
'';
postBuild = ''
mkdir -p $doc/share/doc/deai
python -m sphinx ../docs $doc/share/doc/deai/html
'';
}