1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 gettext,
7}:
8
9stdenv.mkDerivation {
10 pname = "duff";
11 version = "2024-02-16";
12
13 src = fetchFromGitHub {
14 sha256 = "9lS4th+qeglsoA+1s45uEE2UGmlE3YtSy4/uGqWKU/k=";
15 rev = "c1baefa4f4d5cefbbbc7bfefc0c18356752c8a1b";
16 repo = "duff";
17 owner = "elmindreda";
18 };
19
20 nativeBuildInputs = [
21 autoreconfHook
22 gettext
23 ];
24
25 preAutoreconf = ''
26 # gettexttize rightly refuses to run non-interactively:
27 cp ${gettext}/bin/gettextize .
28 substituteInPlace gettextize \
29 --replace "read dummy" "echo '(Automatically acknowledged)' #"
30 ./gettextize
31 sed 's@po/Makefile.in\( .*\)po/Makefile.in@po/Makefile.in \1@' \
32 -i configure.ac
33 # src/main.c is utf8, not ascii
34 sed '/^XGETTEXT_OPTIONS =/ s,$, --from-code=utf-8,' -i po/Makevars
35 '';
36
37 enableParallelBuilding = true;
38
39 meta = with lib; {
40 description = "Quickly find duplicate files";
41 mainProgram = "duff";
42 longDescription = ''
43 Duff is a Unix command-line utility for quickly finding duplicates in
44 a given set of files.
45 '';
46 homepage = "https://github.com/elmindreda/duff";
47 license = licenses.zlib;
48 platforms = platforms.all;
49 };
50}