-
Notifications
You must be signed in to change notification settings - Fork 6
/
package.nix
39 lines (36 loc) · 992 Bytes
/
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
# SPDX-FileCopyrightText: 2024 Jade Lovelace
#
# SPDX-License-Identifier: BSD-2-Clause OR MIT
{ craneLib, lib, pkg-config, nix, boost, stdenv }:
let
src = lib.cleanSource ./.;
args = {
pname = "nix-doc";
inherit src;
nativeBuildInputs = [
pkg-config
];
buildInputs = [ ];
} // lib.optionalAttrs stdenv.isLinux {
# so that you can load a mismatched version of nix-doc safely
hardeningDisable = [ "relro" "bindnow" ];
RUSTFLAGS = "-Z relro-level=partial";
# this should have never been a -Z flag
RUSTC_BOOTSTRAP = "1";
};
cargoArtifacts = craneLib.buildDepsOnly args;
argsOurs = args // {
inherit cargoArtifacts;
# deliberately only include C++ libs in the binary one, so we are only
# compiling our deps once per nix version.
nativeBuildInputs = args.nativeBuildInputs ++ [
nix
];
buildInputs = args.buildInputs ++ [
nix
boost
];
};
crate = craneLib.buildPackage argsOurs;
in
crate