2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, python3Packages, docutils, help2man, installShellFiles
|
2022-08-12 12:06:08 +00:00
|
|
|
, abootimg, acl, apksigner, apktool, binutils-unwrapped-all-targets, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, db, diffutils, dtc
|
2021-10-28 06:52:43 +00:00
|
|
|
, e2fsprogs, enjarify, file, findutils, fontforge-fonttools, ffmpeg, fpc, gettext, ghc, ghostscriptX, giflib, gnumeric, gnupg, gnutar
|
|
|
|
, gzip, hdf5, imagemagick, jdk, libarchive, libcaca, llvm, lz4, mono, ocaml, oggvideotools, openssh, openssl, pdftk, pgpdump, poppler_utils, procyon, qemu, R
|
|
|
|
, radare2, sng, sqlite, squashfsTools, tcpdump, ubootTools, odt2txt, unzip, wabt, xmlbeans, xxd, xz, zip, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableBloat ? false
|
2022-01-19 23:45:15 +00:00
|
|
|
# updater only
|
|
|
|
, writeScript
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# Note: when upgrading this package, please run the list-missing-tools.sh script as described below!
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "diffoscope";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "225";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-13 14:23:35 +00:00
|
|
|
url = "https://diffoscope.org/archive/diffoscope-${version}.tar.bz2";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-nuQmvYpCSzw2kUj/UdcBpn6jabaVMYT47MDblzpb/o0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
|
|
|
./ignore_links.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Upstream doesn't provide a PKG-INFO file
|
|
|
|
sed -i setup.py -e "/'rpm-python',/d"
|
|
|
|
|
|
|
|
# When generating manpage, use the installed version
|
|
|
|
substituteInPlace doc/Makefile --replace "../bin" "$out/bin"
|
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
nativeBuildInputs = [ docutils help2man installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Most of the non-Python dependencies here are optional command-line tools for various file-format parsers.
|
|
|
|
# To help figuring out what's missing from the list, run: ./pkgs/tools/misc/diffoscope/list-missing-tools.sh
|
|
|
|
#
|
2021-10-28 06:52:43 +00:00
|
|
|
# Still missing these tools: docx2txt lipo otool r2pipe
|
2020-04-24 23:36:52 +00:00
|
|
|
pythonPath = [
|
2022-08-12 12:06:08 +00:00
|
|
|
binutils-unwrapped-all-targets bzip2 colordiff coreutils cpio db diffutils
|
2021-08-22 07:53:02 +00:00
|
|
|
e2fsprogs file findutils fontforge-fonttools gettext gnutar gzip
|
2022-06-16 17:23:12 +00:00
|
|
|
libarchive lz4 openssl pgpdump sng sqlite squashfsTools unzip xxd
|
2020-06-18 07:06:33 +00:00
|
|
|
xz zip zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
]
|
2020-06-18 07:06:33 +00:00
|
|
|
++ (with python3Packages; [
|
2022-03-30 09:31:56 +00:00
|
|
|
argcomplete debian defusedxml jsondiff jsbeautifier libarchive-c
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic progressbar33 pypdf2 rpm tlsh
|
2020-06-18 07:06:33 +00:00
|
|
|
])
|
2021-08-22 07:53:02 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ python3Packages.pyxattr acl cdrkit dtc ]
|
2020-06-18 07:06:33 +00:00
|
|
|
++ lib.optionals enableBloat ([
|
2021-10-28 06:52:43 +00:00
|
|
|
abootimg apksigner apktool cbfstool colord enjarify ffmpeg fpc ghc ghostscriptX giflib gnupg gnumeric
|
2022-06-16 17:23:12 +00:00
|
|
|
hdf5 imagemagick libcaca llvm jdk mono ocaml odt2txt oggvideotools openssh pdftk poppler_utils procyon qemu R tcpdump ubootTools wabt radare2 xmlbeans
|
|
|
|
] ++ (with python3Packages; [ androguard binwalk guestfs h5py pdfminer-six ]));
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
checkInputs = with python3Packages; [ pytestCheckHook ] ++ pythonPath;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
make -C doc
|
2021-02-13 14:23:35 +00:00
|
|
|
installManPage doc/diffoscope.1
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_sbin_added_to_path"
|
2021-04-05 15:23:46 +00:00
|
|
|
"test_diff_meta"
|
|
|
|
"test_diff_meta2"
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# fails because it fails to determine llvm version
|
|
|
|
"test_item3_deflate_llvm_bitcode"
|
2021-08-22 07:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# Disable flaky tests on Darwin
|
|
|
|
"test_non_unicode_filename"
|
|
|
|
"test_listing"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_symlink_root"
|
2021-08-22 07:53:02 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# flaky tests on Darwin
|
|
|
|
disabledTestPaths = lib.optionals stdenv.isDarwin [
|
|
|
|
"tests/comparators/test_git.py"
|
|
|
|
"tests/comparators/test_java.py"
|
|
|
|
"tests/comparators/test_uimage.py"
|
|
|
|
"tests/comparators/test_device.py"
|
|
|
|
"tests/comparators/test_macho.py"
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = writeScript "update-diffoscope" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl pcre common-updater-scripts
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
# Expect the text in format of "Latest release: 198 (31 Dec 2021)"'.
|
|
|
|
newVersion="$(curl -s https://diffoscope.org/ | pcregrep -o1 'Latest release: ([0-9]+)')"
|
|
|
|
update-source-version ${pname} "$newVersion"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Perform in-depth comparison of files, archives, and directories";
|
|
|
|
longDescription = ''
|
|
|
|
diffoscope will try to get to the bottom of what makes files or directories
|
|
|
|
different. It will recursively unpack archives of many kinds and transform
|
|
|
|
various binary formats into more human readable form to compare them. It can
|
|
|
|
compare two tarballs, ISO images, or PDF just as easily. The differences can
|
|
|
|
be shown in a text or HTML report.
|
|
|
|
|
|
|
|
diffoscope is developed as part of the "reproducible builds" Debian
|
|
|
|
project and was formerly known as "debbindiff".
|
|
|
|
'';
|
2021-02-13 14:23:35 +00:00
|
|
|
homepage = "https://diffoscope.org/";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ dezgeg danielfullmer ];
|
2021-02-13 14:23:35 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|