From 0aad53c2c767a0b79e0ba8979eca14b2c97f392b Mon Sep 17 00:00:00 2001 From: ajs124 Date: Sat, 19 Dec 2020 20:14:20 +0100 Subject: [PATCH] glusterfs: 7.6 -> 8.3 while 7.x is technically still supported, 8.x is already up to .3 release notes: https://gluster.readthedocs.io/en/latest/release-notes/8.3/ --- pkgs/tools/filesystems/glusterfs/default.nix | 54 ++++++++----------- ...10-glusterfind-var-data-under-prefix.patch | 27 ---------- 2 files changed, 21 insertions(+), 60 deletions(-) delete mode 100644 pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch diff --git a/pkgs/tools/filesystems/glusterfs/default.nix b/pkgs/tools/filesystems/glusterfs/default.nix index f495b56e3252..a4e6bc1182be 100644 --- a/pkgs/tools/filesystems/glusterfs/default.nix +++ b/pkgs/tools/filesystems/glusterfs/default.nix @@ -1,25 +1,17 @@ -{stdenv, fetchurl, fuse, bison, flex_2_5_35, openssl, python3, ncurses, readline, +{stdenv, fetchFromGitHub, fuse, bison, flex_2_5_35, openssl, python3, ncurses, readline, autoconf, automake, libtool, pkgconfig, zlib, libaio, libxml2, acl, sqlite, liburcu, attr, makeWrapper, coreutils, gnused, gnugrep, which, openssh, gawk, findutils, util-linux, lvm2, btrfs-progs, e2fsprogs, xfsprogs, systemd, rsync, glibc, rpcsvc-proto, libtirpc }: let - s = - rec { - baseName="glusterfs"; - # NOTE: On each glusterfs release, it should be checked if gluster added - # new, or changed, Python scripts whose PYTHONPATH has to be set in - # `postFixup` below, and whose runtime deps need to go into - # `nativeBuildInputs`. - # The command - # find /nix/store/...-glusterfs-.../ -name '*.py' -executable - # can help with finding new Python scripts. - version = "7.6"; - name="${baseName}-${version}"; - url="https://github.com/gluster/glusterfs/archive/v${version}.tar.gz"; - sha256 = "0zdcv2jk8dp67id8ic30mkn97ccp07jf20g7v09a5k31pw9aqyih"; - }; + # NOTE: On each glusterfs release, it should be checked if gluster added + # new, or changed, Python scripts whose PYTHONPATH has to be set in + # `postFixup` below, and whose runtime deps need to go into + # `nativeBuildInputs`. + # The command + # find /nix/store/...-glusterfs-.../ -name '*.py' -executable + # can help with finding new Python scripts. buildInputs = [ fuse bison flex_2_5_35 openssl ncurses readline @@ -60,16 +52,17 @@ let which # which xfsprogs # xfs_info ]; -in -stdenv.mkDerivation -{ - inherit (s) name version; - inherit buildInputs propagatedBuildInputs; +in stdenv.mkDerivation rec { + pname = "glusterfs"; + version = "8.3"; - patches = [ - # Remove when https://bugzilla.redhat.com/show_bug.cgi?id=1489610 is fixed - ./glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch - ]; + src = fetchFromGitHub { + owner = "gluster"; + repo = pname; + rev = "v${version}"; + sha256 = "09vvbymiacz2pzwnq6f2dd7g2zszzsivdncz45sh977v3z0n84az"; + }; + inherit buildInputs propagatedBuildInputs; postPatch = '' sed -e '/chmod u+s/d' -i contrib/fuse-util/Makefile.am @@ -91,7 +84,7 @@ stdenv.mkDerivation # but fails when the version is empty. # See upstream GlusterFS bug https://bugzilla.redhat.com/show_bug.cgi?id=1452705 preConfigure = '' - echo "v${s.version}" > VERSION + echo "v${version}" > VERSION ./autogen.sh export PYTHON=${python3}/bin/python ''; @@ -109,7 +102,7 @@ stdenv.mkDerivation postInstall = '' cp -r $out/$out/* $out rm -r $out/nix - ''; + ''; postFixup = '' # glusterd invokes `gluster` and other utilities when telling other glusterd nodes to run commands. @@ -153,7 +146,7 @@ stdenv.mkDerivation wrapProgram $out/share/glusterfs/scripts/eventsdash.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" wrapProgram $out/libexec/glusterfs/glusterfind/brickfind.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" wrapProgram $out/libexec/glusterfs/glusterfind/changelog.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" - ''; + ''; doInstallCheck = true; @@ -187,12 +180,7 @@ stdenv.mkDerivation rm -r $out/bin/conf.py ''; - src = fetchurl { - inherit (s) url sha256; - }; - meta = with stdenv.lib; { - inherit (s) version; description = "Distributed storage system"; homepage = "https://www.gluster.org"; license = licenses.lgpl3Plus; # dual licese: choice of lgpl3Plus or gpl2 diff --git a/pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch b/pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch deleted file mode 100644 index f08d73cf3a65..000000000000 --- a/pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f523afac49e24ecc0fa4ad85195135689cf445f0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= -Date: Wed, 27 Sep 2017 21:36:41 +0200 -Subject: [PATCH] Fix "glusterfind saves var data under $prefix instead of - localstatedir". Fixes #1489610 - -Change-Id: Id2362c20f34346c37acfb9eb1ad105d0b7b8b60f ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index f87d8a454..b4d3f5d10 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1118,7 +1118,7 @@ if test "x$exec_prefix" = xNONE; then - exec_prefix="$(eval echo $prefix)" - fi - GLUSTERFS_LIBEXECDIR="$(eval echo $libexecdir)/glusterfs" --GLUSTERFSD_MISCDIR="$(eval echo $prefix)/var/lib/misc/glusterfsd" -+GLUSTERFSD_MISCDIR="$(eval echo $localstatedir)/lib/misc/glusterfsd" - prefix=$old_prefix - exec_prefix=$old_exec_prefix - --- -2.12.0 -