From 9d1acf8559bca503e2091e1f509de802f99e1c70 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 19 Sep 2014 14:18:33 -0700 Subject: [PATCH] xfsprogs: 3.1.11 -> 3.2.1 --- pkgs/tools/filesystems/xfsprogs/default.nix | 66 +++++++++++++-------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/pkgs/tools/filesystems/xfsprogs/default.nix b/pkgs/tools/filesystems/xfsprogs/default.nix index 7c9cd05009d6..e4d470836b84 100644 --- a/pkgs/tools/filesystems/xfsprogs/default.nix +++ b/pkgs/tools/filesystems/xfsprogs/default.nix @@ -1,41 +1,59 @@ -{ stdenv, fetchurl, libtool, gettext, libuuid }: +{ stdenv, fetchurl, gettext, libuuid, readline }: stdenv.mkDerivation rec { - name = "xfsprogs-3.1.11"; + name = "xfsprogs-3.2.1"; src = fetchurl { - urls = [ "ftp://oss.sgi.com/projects/xfs/cmd_tars/${name}.tar.gz" "ftp://oss.sgi.com/projects/xfs/previous/${name}.tar.gz" ]; - sha256 = "1gnnyhy3khl08a24c5y0pyakz6nnwkiw1fc6rb0r1j5mfw0rix5d"; + urls = map (dir: "ftp://oss.sgi.com/projects/xfs/${dir}/${name}.tar.gz") + [ "cmd_tars" "previous" ]; + sha256 = "0rsp31qrz0wskr70dwzl5ignkac7j98j7m9cy6wl57zy716fmy43"; }; - patchPhase = '' - sed -i s,/bin/bash,`type -P bash`, install-sh + prePatch = '' + sed -i s,/bin/bash,`type -P bash`,g install-sh + sed -i s,ldconfig,`type -P ldconfig`,g configure m4/libtool.m4 + + # Fixes from gentoo 3.2.1 ebuild + sed -i "/^PKG_DOC_DIR/s:@pkg_name@:${name}:" include/builddefs.in + sed -i '1iLLDFLAGS = -static' {estimate,fsr}/Makefile + sed -i "/LLDFLAGS/s:-static::" $(find -name Makefile) + sed -i '/LIB_SUBDIRS/s:libdisk::' Makefile ''; - outputs = ["out" "lib"]; + patches = [ + # This patch fixes shared libs installation, still not fixed in 3.2.1 + ./xfsprogs-3.1.11-sharelibs.patch + ]; + + buildInputs = [ gettext libuuid readline ]; + + outputs = [ "out" "lib" ]; + + configureFlags = [ + "MAKE=make" + "MSGFMT=msgfmt" + "MSGMERGE=msgmerge" + "XGETTEXT=xgettext" + "--disable-lib64" + "--enable-readline" + "--includedir=$(lib)/include" + "--libdir=$(lib)/lib" + ]; + + installFlags = [ "install-dev" ]; postInstall = '' - (cd include; make install-dev) - # The make install-dev target is broken when --disable-shared - mkdir -p $lib/lib $lib/include - cp ./libhandle/.libs/libhandle.a \ - ./libxcmd/.libs/libxcmd.a \ - ./libxlog/.libs/libxlog.a \ - ./libxfs/.libs/libxfs.a $lib/lib - mv $out/include/* $lib/include + # Emitted libraries have references to $out, fix this + sed -i "s,$out,$lib,g" $lib/lib/* ''; enableParallelBuilding = true; - buildInputs = [ libtool gettext libuuid ]; - - configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ZIP=gzip AWK=gawk --disable-shared"; - preConfigure = '' - configureFlags="$configureFlags root_sbindir=$out/sbin root_libdir=$lib/lib" - ''; - disableStatic = false; - - meta = { + meta = with stdenv.lib; { + homepage = http://xfs.org/; description = "SGI XFS utilities"; + license = licenses.lgpl21; + platforms = platforms.linux; + maintainers = with maintainers; [ wkennington ]; }; }