From cebe78eb81d9a92442721bc71294332626252adf Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Thu, 9 Jul 2020 23:27:00 +0200 Subject: [PATCH 1/2] ntirpc: init at 3.3 --- pkgs/development/libraries/ntirpc/default.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 40 insertions(+) create mode 100644 pkgs/development/libraries/ntirpc/default.nix diff --git a/pkgs/development/libraries/ntirpc/default.nix b/pkgs/development/libraries/ntirpc/default.nix new file mode 100644 index 000000000000..40f8d55462da --- /dev/null +++ b/pkgs/development/libraries/ntirpc/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchFromGitHub, cmake +, krb5, liburcu , libtirpc +} : + +stdenv.mkDerivation rec { + pname = "ntirpc"; + version = "3.3"; + + src = fetchFromGitHub { + owner = "nfs-ganesha"; + repo = "ntirpc"; + rev = "v${version}"; + sha256 = "08vc2z9sl1p9mk1mx0zn4xv7dw12gamhciy41fbavm90iavf3vqm"; + }; + + postPatch = '' + substituteInPlace ntirpc/netconfig.h --replace "/etc/netconfig" "$out/etc/netconfig" + ''; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ krb5 liburcu ]; + + postInstall = '' + mkdir -p $out/etc + + # Library needs a netconfig to run. + # Steal the file from libtirpc + cp ${libtirpc}/etc/netconfig $out/etc/ + ''; + + meta = with stdenv.lib; { + description = "Transport-independent RPC (TI-RPC)"; + homepage = "https://github.com/nfs-ganesha/ntirpc"; + maintainers = [ maintainers.markuskowa ]; + platforms = platforms.linux; + license = licenses.bsd3; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5eb8d0c45edf..96abf30e176d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5642,6 +5642,8 @@ in ntfy = callPackage ../tools/misc/ntfy {}; + ntirpc = callPackage ../development/libraries/ntirpc { }; + ntopng = callPackage ../tools/networking/ntopng { }; ntp = callPackage ../tools/networking/ntp { From f2902f88ec6580203b3e4762693cbef29bf2b88a Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Thu, 9 Jul 2020 23:27:39 +0200 Subject: [PATCH 2/2] nfs-ganesha: init at 3.3 --- pkgs/servers/nfs-ganesha/default.nix | 48 ++++++++++++++++++++++ pkgs/servers/nfs-ganesha/sysstatedir.patch | 15 +++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 65 insertions(+) create mode 100644 pkgs/servers/nfs-ganesha/default.nix create mode 100644 pkgs/servers/nfs-ganesha/sysstatedir.patch diff --git a/pkgs/servers/nfs-ganesha/default.nix b/pkgs/servers/nfs-ganesha/default.nix new file mode 100644 index 000000000000..adbcbb63759b --- /dev/null +++ b/pkgs/servers/nfs-ganesha/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchFromGitHub, cmake, pkg-config +, krb5, xfsprogs, jemalloc, dbus, libcap +, ntirpc, liburcu, bison, flex, nfs-utils +} : + +stdenv.mkDerivation rec { + pname = "nfs-ganesha"; + version = "3.3"; + + src = fetchFromGitHub { + owner = "nfs-ganesha"; + repo = "nfs-ganesha"; + rev = "V${version}"; + sha256 = "1w48rqrbqah0hnirvjdz8lyr9ah8b73j3cgsppb04gnrmpssgmb6"; + }; + + patches = [ ./sysstatedir.patch ]; + + preConfigure = "cd src"; + + cmakeFlags = [ "-DUSE_SYSTEM_NTIRPC=ON" ]; + + nativeBuildInputs = [ + cmake + pkg-config + bison + flex + ]; + + buildInputs = [ + krb5 + xfsprogs + jemalloc + dbus.lib + libcap + ntirpc + liburcu + nfs-utils + ]; + + meta = with stdenv.lib; { + description = "NFS server that runs in user space"; + homepage = "https://github.com/nfs-ganesha/nfs-ganesha/wiki"; + maintainers = [ maintainers.markuskowa ]; + platforms = platforms.linux; + license = licenses.lgpl3Plus; + }; +} diff --git a/pkgs/servers/nfs-ganesha/sysstatedir.patch b/pkgs/servers/nfs-ganesha/sysstatedir.patch new file mode 100644 index 000000000000..534f71743e71 --- /dev/null +++ b/pkgs/servers/nfs-ganesha/sysstatedir.patch @@ -0,0 +1,15 @@ +diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake +index 51697310b..2b5f91075 100644 +--- a/src/include/config-h.in.cmake ++++ b/src/include/config-h.in.cmake +@@ -72,8 +72,8 @@ + #define NFS_GANESHA 1 + + #define GANESHA_CONFIG_PATH "@SYSCONFDIR@/ganesha/ganesha.conf" +-#define GANESHA_PIDFILE_PATH "@SYSSTATEDIR@/run/ganesha.pid" +-#define NFS_V4_RECOV_ROOT "@SYSSTATEDIR@/lib/nfs/ganesha" ++#define GANESHA_PIDFILE_PATH "/run/ganesha.pid" ++#define NFS_V4_RECOV_ROOT "/var/lib/nfs/ganesha" + /** + * @brief Default value for krb5_param.ccache_dir + */ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96abf30e176d..a89cdaa23de7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5540,6 +5540,8 @@ in ndstool = callPackage ../tools/archivers/ndstool { }; + nfs-ganesha = callPackage ../servers/nfs-ganesha { }; + ngrep = callPackage ../tools/networking/ngrep { }; ngrok = ngrok-2;