summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2020-05-10 21:36:32 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2020-05-10 21:40:35 +0200
commit66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c (patch)
tree9d26d5e5e33772d6f7453846424bfcb6e53d7988 /pkgs/tools
parent5da13930308779e91470a2dc6249005098886011 (diff)
downloadnixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.tar
nixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.tar.gz
nixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.tar.bz2
nixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.tar.lz
nixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.tar.xz
nixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.tar.zst
nixpkgs-66f90b84b85931e90ce31e4a3d9fbe5b5a896e1c.zip
fatsort: 1.5.0.456 -> 1.6.2.605
The patch to set PREFIX needed updating to apply. Rewrite it in a way
that allows submitting upstream. That means we don't hardcode
PREFIX=$out inside the patch but allow the PREFIX to be passed to make
at build time.
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/filesystems/fatsort/default.nix6
-rw-r--r--pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch49
2 files changed, 30 insertions, 25 deletions
diff --git a/pkgs/tools/filesystems/fatsort/default.nix b/pkgs/tools/filesystems/fatsort/default.nix
index dafe4c85176..b8f63a379b1 100644
--- a/pkgs/tools/filesystems/fatsort/default.nix
+++ b/pkgs/tools/filesystems/fatsort/default.nix
@@ -1,18 +1,20 @@
 {stdenv, fetchurl, help2man}:
 
 stdenv.mkDerivation rec {
-  version = "1.5.0.456";
+  version = "1.6.2.605";
   pname = "fatsort";
 
   src = fetchurl {
     url = "mirror://sourceforge/fatsort/${pname}-${version}.tar.xz";
-    sha256 = "15fy2m4p9s8cfvnzdcd5ynkc2js0zklkkf34sjxdac7x2iwb8dd8";
+    sha256 = "1dzzsl3a1ampari424vxkma0i87qkbgkgm2169x9xf3az0vgmjh8";
   };
 
   patches = [ ./fatsort-Makefiles.patch ];
 
   buildInputs = [ help2man ];
 
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
   meta = with stdenv.lib; {
     homepage = "http://fatsort.sourceforge.net/";
     description = "Sorts FAT partition table, for devices that don't do sorting of files";
diff --git a/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch b/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch
index 9c9f58e97ab..51775edfb41 100644
--- a/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch
+++ b/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch
@@ -1,31 +1,34 @@
-diff -uNr fatsort-1.3.365-a/Makefile fatsort-1.3.365-b/Makefile
---- fatsort-1.3.365-a/Makefile	2014-04-08 19:19:36.000000000 +0100
-+++ fatsort-1.3.365-b/Makefile	2014-12-14 18:31:55.982857720 +0000
+diff -uNr fatsort-1.6.2.605.orig/Makefile fatsort-1.6.2.605.new/Makefile
+--- fatsort-1.6.2.605.orig/Makefile	2019-11-16 16:40:27.000000000 +0100
++++ fatsort-1.6.2.605.new/Makefile	2020-05-10 21:34:34.820874026 +0200
 @@ -1,4 +1,5 @@
 -MANDIR=/usr/local/share/man/man1
-+PREFIX=$(out)
++PREFIX?=/usr/local
 +MANDIR=$(PREFIX)/share/man/man1
  
  INSTALL_FLAGS=-m 0755 -p -D
  
-diff -uNr fatsort-1.3.365-a/src/Makefile fatsort-1.3.365-b/src/Makefile
---- fatsort-1.3.365-a/src/Makefile	2014-04-08 19:19:36.000000000 +0100
-+++ fatsort-1.3.365-b/src/Makefile	2014-12-14 18:32:08.282870461 +0000
-@@ -1,3 +1,5 @@
-+PREFIX=$(out)
-+
- CC=gcc
- LD=gcc
- 
-@@ -33,9 +35,9 @@
- 
- # Mac OS X does not have a "/usr/local/sbin"
- ifeq ($(UNAME),Darwin)
--SBINDIR=/usr/local/bin
-+SBINDIR=$(PREFIX)/bin
+diff -uNr fatsort-1.6.2.605.orig/src/Makefile fatsort-1.6.2.605.new/src/Makefile
+--- fatsort-1.6.2.605.orig/src/Makefile	2018-11-17 00:40:59.000000000 +0100
++++ fatsort-1.6.2.605.new/src/Makefile	2020-05-10 21:33:52.053391027 +0200
+@@ -30,7 +30,7 @@
+ 		override CFLAGS += -D __CYGWIN__
+ 		override CFLAGS += -D __LINUX__
+ 		override LDFLAGS += -liconv
+-		SBINDIR=/usr/local/sbin
++		SBINDIR=$(PREFIX)/sbin
+ 	endif
  else
--SBINDIR=/usr/local/sbin
-+SBINDIR=$(PREFIX)/sbin
+ 	ifdef MINGW
+@@ -60,9 +60,9 @@
+ 			# OS X's install does not support the '-D' flag.
+ 			INSTALL_FLAGS=-m 0755 -p
+ 			# Mac OS X does not have a "/usr/local/sbin"
+-			SBINDIR=/usr/local/bin
++			SBINDIR=$(PREFIX)/bin
+ 		else
+-			SBINDIR=/usr/local/sbin
++			SBINDIR=$(PREFIX)/sbin
+ 		endif
+ 	endif
  endif
- 
- OBJ=fatsort.o FAT_fs.o fileio.o endianness.o signal.o entrylist.o errors.o options.o clusterchain.o sort.o misc.o natstrcmp.o stringlist.o