1{ lib, stdenv, fetchgit, fetchpatch, pythonPackages, docutils
2, acl, binutils, bzip2, cbfstool, cdrkit, colord, cpio, diffutils, e2fsprogs, file, fpc, gettext, ghc
3, gnupg1, gzip, jdk, libcaca, mono, pdftk, poppler_utils, rpm, sng, sqlite, squashfsTools, unzip, vim, xz
4, enableBloat ? false
5}:
6
7pythonPackages.buildPythonApplication rec {
8 name = "diffoscope-${version}";
9 version = "49";
10
11 namePrefix = "";
12
13 src = fetchgit {
14 url = "git://anonscm.debian.org/reproducible/diffoscope.git";
15 rev = "refs/tags/${version}";
16 sha256 = "0kh96h95rp7bk8rgc1z18jwv89dyp1n36bawqyqxhwwklmrgxr66";
17 };
18
19 patches =
20 [ # Ignore different link counts and inode change times.
21 (fetchpatch {
22 url = https://github.com/edolstra/diffoscope/commit/367f77bba8df0dbc89e63c9f66f05736adf5ec59.patch;
23 sha256 = "0mnp7icdrjn02dr6f5dwqvvr848jzgkv3cg69a24234y9gxd30ww";
24 })
25 ];
26
27 postPatch = ''
28 # Upstream doesn't provide a PKG-INFO file
29 sed -i setup.py -e "/'rpm-python',/d"
30 '';
31
32 # Still missing these tools: enjarify, otool & lipo (maybe OS X only), showttf
33 # Also these libraries: python3-guestfs
34 # FIXME: move xxd into a separate package so we don't have to pull in all of vim.
35 propagatedBuildInputs = (with pythonPackages; [ debian libarchive-c python_magic tlsh ]) ++
36 [ acl binutils bzip2 cbfstool cdrkit cpio diffutils e2fsprogs file gettext
37 gzip libcaca poppler_utils rpm sng sqlite squashfsTools unzip vim xz
38 ] ++ lib.optionals enableBloat [ colord fpc ghc gnupg1 jdk mono pdftk ];
39
40 doCheck = false; # Calls 'mknod' in squashfs tests, which needs root
41
42 postInstall = ''
43 mkdir -p $out/share/man/man1
44 ${docutils}/bin/rst2man.py debian/diffoscope.1.rst $out/share/man/man1/diffoscope.1
45 '';
46
47 meta = with stdenv.lib; {
48 description = "Perform in-depth comparison of files, archives, and directories";
49 longDescription = ''
50 diffoscope will try to get to the bottom of what makes files or directories
51 different. It will recursively unpack archives of many kinds and transform
52 various binary formats into more human readable form to compare them. It can
53 compare two tarballs, ISO images, or PDF just as easily. The differences can
54 be shown in a text or HTML report.
55
56 diffoscope is developed as part of the "reproducible builds" Debian
57 project and was formerly known as "debbindiff".
58 '';
59 homepage = https://wiki.debian.org/ReproducibleBuilds;
60 license = licenses.gpl3Plus;
61 maintainers = [ maintainers.dezgeg ];
62 platforms = platforms.linux;
63 };
64}