lol

fatsort: fix build, cleanup, enable on darwin

+21 -39
+21 -5
pkgs/tools/filesystems/fatsort/default.nix
··· 1 - {lib, stdenv, fetchurl, help2man}: 2 3 stdenv.mkDerivation rec { 4 version = "1.6.4.625"; ··· 9 sha256 = "sha256-mm+JoGQLt4LYL/I6eAyfCuw9++RoLAqO2hV+CBBkLq0="; 10 }; 11 12 - patches = [ ./fatsort-Makefiles.patch ]; 13 14 - buildInputs = [ help2man ]; 15 16 - makeFlags = [ "PREFIX=${placeholder "out"}" ]; 17 18 meta = with lib; { 19 homepage = "http://fatsort.sourceforge.net/"; 20 description = "Sorts FAT partition table, for devices that don't do sorting of files"; 21 maintainers = [ maintainers.kovirobi ]; 22 license = licenses.gpl2; 23 - platforms = platforms.linux; 24 }; 25 }
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , help2man 5 + , libiconv 6 + }: 7 8 stdenv.mkDerivation rec { 9 version = "1.6.4.625"; ··· 14 sha256 = "sha256-mm+JoGQLt4LYL/I6eAyfCuw9++RoLAqO2hV+CBBkLq0="; 15 }; 16 17 + buildInputs = [ help2man ] 18 + ++ lib.optionals stdenv.isDarwin [ libiconv ]; 19 20 + makeFlags = [ 21 + "CC=${stdenv.cc.targetPrefix}cc" 22 + "LD=${stdenv.cc.targetPrefix}cc" 23 + ]; 24 25 + # make install target is broken (DESTDIR usage is insane) 26 + # it's easier to just skip make and install manually 27 + installPhase = '' 28 + runHook preInstall 29 + install -D -m 755 ./src/fatsort $out/bin/fatsort 30 + install -D -m 644 ./man/fatsort.1 $out/man/man1/fatsort.1 31 + runHook postInstall 32 + ''; 33 34 meta = with lib; { 35 homepage = "http://fatsort.sourceforge.net/"; 36 description = "Sorts FAT partition table, for devices that don't do sorting of files"; 37 maintainers = [ maintainers.kovirobi ]; 38 license = licenses.gpl2; 39 + platforms = platforms.unix; 40 }; 41 }
-34
pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch
··· 1 - diff -uNr fatsort-1.6.2.605.orig/Makefile fatsort-1.6.2.605.new/Makefile 2 - --- fatsort-1.6.2.605.orig/Makefile 2019-11-16 16:40:27.000000000 +0100 3 - +++ fatsort-1.6.2.605.new/Makefile 2020-05-10 21:34:34.820874026 +0200 4 - @@ -1,4 +1,5 @@ 5 - -MANDIR=/usr/local/share/man/man1 6 - +PREFIX?=/usr/local 7 - +MANDIR=$(PREFIX)/share/man/man1 8 - 9 - INSTALL_FLAGS=-m 0755 -p -D 10 - 11 - diff -uNr fatsort-1.6.2.605.orig/src/Makefile fatsort-1.6.2.605.new/src/Makefile 12 - --- fatsort-1.6.2.605.orig/src/Makefile 2018-11-17 00:40:59.000000000 +0100 13 - +++ fatsort-1.6.2.605.new/src/Makefile 2020-05-10 21:33:52.053391027 +0200 14 - @@ -30,7 +30,7 @@ 15 - override CFLAGS += -D __CYGWIN__ 16 - override CFLAGS += -D __LINUX__ 17 - override LDFLAGS += -liconv 18 - - SBINDIR=/usr/local/sbin 19 - + SBINDIR=$(PREFIX)/sbin 20 - endif 21 - else 22 - ifdef MINGW 23 - @@ -60,9 +60,9 @@ 24 - # OS X's install does not support the '-D' flag. 25 - INSTALL_FLAGS=-m 0755 -p 26 - # Mac OS X does not have a "/usr/local/sbin" 27 - - SBINDIR=/usr/local/bin 28 - + SBINDIR=$(PREFIX)/bin 29 - else 30 - - SBINDIR=/usr/local/sbin 31 - + SBINDIR=$(PREFIX)/sbin 32 - endif 33 - endif 34 - endif
···