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