nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 krb5,
7 liburcu,
8 libtirpc,
9 libnsl,
10 prometheus-cpp-lite,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "ntirpc";
15 version = "7.2";
16
17 src = fetchFromGitHub {
18 owner = "nfs-ganesha";
19 repo = "ntirpc";
20 rev = "v${finalAttrs.version}";
21 hash = "sha256-4E6wDAwinCNn7arRgBulg7e0x9S/steh+mjwNY4X3Vc=";
22 };
23
24 outputs = [
25 "out"
26 "dev"
27 ];
28 postPatch = ''
29 substituteInPlace CMakeLists.txt --replace-fail \
30 "cmake_minimum_required(VERSION 2.6.3)" \
31 "cmake_minimum_required(VERSION 3.10)"
32
33 substituteInPlace ntirpc/netconfig.h --replace-fail \
34 "/etc/netconfig" "$out/etc/netconfig"
35 '';
36
37 nativeBuildInputs = [ cmake ];
38 buildInputs = [
39 krb5
40 liburcu
41 libnsl
42 prometheus-cpp-lite
43 ];
44
45 cmakeFlags = [
46 "-DUSE_MONITORING=ON"
47 ];
48
49 postInstall = ''
50 mkdir -p $out/etc
51
52 # Library needs a netconfig to run.
53 # Steal the file from libtirpc
54 cp ${libtirpc}/etc/netconfig $out/etc/
55 '';
56
57 meta = {
58 description = "Transport-independent RPC (TI-RPC)";
59 homepage = "https://github.com/nfs-ganesha/ntirpc";
60 maintainers = [ lib.maintainers.markuskowa ];
61 platforms = lib.platforms.linux;
62 license = lib.licenses.bsd3;
63 };
64})