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