-
-
Notifications
You must be signed in to change notification settings - Fork 255
/
Copy pathdefault.nix
52 lines (45 loc) · 1.04 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
{ lib
, naersk
, hostPlatform
, postgresql_11
, postgresql_12
, postgresql_13
, pkg-config
, openssl
, rustfmt
, libiconv
, llvmPackages
, gitignoreSource
, release ? true
, callPackage
, fenixToolchain
}:
let
cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));
naerskLib = callPackage naersk {
cargo = fenixToolchain hostPlatform.system;
rustc = fenixToolchain hostPlatform.system;
};
in
naerskLib.buildPackage rec {
name = cargoToml.package.name;
version = cargoToml.package.version;
src = gitignoreSource ../.;
inherit release;
cargoBuildOptions = final: final ++ [ "--package" "cargo-pgrx" ];
cargoTestOptions = final: final ++ [ "--package" "cargo-pgrx" ];
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
libiconv
];
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
meta = with lib; {
description = cargoToml.package.description;
homepage = cargoToml.package.homepage;
license = with licenses; [ mit ];
maintainers = with maintainers; [ hoverbear ];
};
}