1{ lib, stdenv, fetchgit, python3Packages, docutils
2, acl, apktool, binutils, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc
3, e2fsprogs, file, findutils, fontforge-fonttools, fpc, gettext, ghc, ghostscriptX, giflib, gnupg1, gnutar
4, gzip, imagemagick, jdk, libarchive, libcaca, llvm, mono, openssh, pdftk, pgpdump, poppler_utils, sng, sqlite
5, squashfsTools, tcpdump, unoconv, unzip, xxd, xz
6, enableBloat ? false
7}:
8
9python3Packages.buildPythonApplication rec {
10 name = "diffoscope-${version}";
11 version = "86";
12
13 src = fetchgit {
14 url = "git://anonscm.debian.org/reproducible/diffoscope.git";
15 rev = "refs/tags/${version}";
16 sha256 = "0jj3gn7pw7him12bxf0wbs6wkz32ydv909v5gi681p0dyzajd0zr";
17 };
18
19 patches = [
20 ./ignore_links.patch
21 ];
22
23 postPatch = ''
24 # Upstream doesn't provide a PKG-INFO file
25 sed -i setup.py -e "/'rpm-python',/d"
26 '';
27
28 # Still missing these tools: docx2txt enjarify js-beautify oggDump Rscript
29 # Also these libraries: python3-guestfs
30 pythonPath = with python3Packages; [ debian libarchive-c python_magic tlsh rpm ] ++ [
31 acl binutils bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils
32 fontforge-fonttools gettext gnutar gzip libarchive libcaca pgpdump sng sqlite
33 squashfsTools unzip xxd xz
34 ] ++ lib.optionals enableBloat [
35 apktool cbfstool colord fpc ghc ghostscriptX giflib gnupg1 imagemagick
36 llvm jdk mono openssh pdftk poppler_utils tcpdump unoconv
37 ];
38
39 doCheck = false; # Calls 'mknod' in squashfs tests, which needs root
40
41 postInstall = ''
42 mkdir -p $out/share/man/man1
43 ${docutils}/bin/rst2man.py debian/diffoscope.1.rst $out/share/man/man1/diffoscope.1
44 '';
45
46 meta = with stdenv.lib; {
47 description = "Perform in-depth comparison of files, archives, and directories";
48 longDescription = ''
49 diffoscope will try to get to the bottom of what makes files or directories
50 different. It will recursively unpack archives of many kinds and transform
51 various binary formats into more human readable form to compare them. It can
52 compare two tarballs, ISO images, or PDF just as easily. The differences can
53 be shown in a text or HTML report.
54
55 diffoscope is developed as part of the "reproducible builds" Debian
56 project and was formerly known as "debbindiff".
57 '';
58 homepage = https://wiki.debian.org/ReproducibleBuilds;
59 license = licenses.gpl3Plus;
60 maintainers = with maintainers; [ dezgeg ];
61 platforms = platforms.linux;
62 };
63}