2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, python3Packages, docutils, help2man, installShellFiles
|
2022-12-17 10:02:37 +00:00
|
|
|
, abootimg, acl, apksigcopier, 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
|
2022-12-17 10:02:37 +00:00
|
|
|
, gzip, html2text, hdf5, imagemagick, jdk, libarchive, libcaca, llvm, lz4, mono, ocaml, oggvideotools, openssh, openssl, pdftk, pgpdump, poppler_utils, procyon, qemu, R
|
2021-10-28 06:52:43 +00:00
|
|
|
, 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-12-17 10:02:37 +00:00
|
|
|
version = "228";
|
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-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-fzIjuQEYOQPscQeVCV5gj6PmaVZcrjiOai/UA4279p4=";
|
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-12-17 10:02:37 +00:00
|
|
|
html2text 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-11-21 17:40:18 +00:00
|
|
|
python-magic progressbar33 pypdf2 tlsh
|
2020-06-18 07:06:33 +00:00
|
|
|
])
|
2022-11-21 17:40:18 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ python3Packages.pyxattr python3Packages.rpm acl cdrkit dtc ]
|
2020-06-18 07:06:33 +00:00
|
|
|
++ lib.optionals enableBloat ([
|
2022-12-17 10:02:37 +00:00
|
|
|
abootimg apksigcopier 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
|
|
|
};
|
|
|
|
}
|