@@ -0,0 +1,40 @@
1+{ stdenv, fetchurl, autoconf, automake, gettext }:
2+
3+stdenv.mkDerivation rec {
4+ name = "duff-${version}";
5+ version = "0.5.2";
6+
7+ src = fetchurl {
8+ url = "https://github.com/elmindreda/duff/archive/${version}.tar.gz";
9+ sha256 = "149dd80f9758085ed199c37aa32ad869409fa5e2c8da8a51294bd64ca886e058";
10+ };
11+
12+ buildInputs = [ autoconf automake gettext ];
13+
14+ preConfigure = ''
15+ # duff is currently badly packaged, requiring us to do extra work here that
16+ # should be done upstream. If that is ever fixed, this entire phase can be
17+ # removed along with all buildInputs.
18+
19+ # gettexttize rightly refuses to run non-interactively:
20+ cp ${gettext}/bin/gettextize .
21+ substituteInPlace gettextize \
22+ --replace "read dummy" "echo (Automatically acknowledged)"
23+ ./gettextize
24+ sed 's@po/Makefile.in\( .*\)po/Makefile.in@po/Makefile.in \1@' \
25+ -i configure.ac
26+ autoreconf -i
27+ '';
28+
29+ meta = with stdenv.lib; {
30+ description = "Quickly find duplicate files.";
31+ homepage = http://duff.dreda.org/;
32+ license = with licenses; zlib;
33+ longDescription = ''
34+ Duff is a Unix command-line utility for quickly finding duplicates in
35+ a given set of files.
36+ '';
37+ maintainers = with maintainers; [ nckx ];
38+ platforms = with platforms; all;
39+ };
40+}