diff options
Diffstat (limited to 'pkgs/tools/misc/diffoscope/default.nix')
-rw-r--r-- | pkgs/tools/misc/diffoscope/default.nix | 420 |
1 files changed, 215 insertions, 205 deletions
diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 8a85cc112fd32..7c20981b9651b 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -1,94 +1,100 @@ -{ lib -, stdenv -, abootimg -, acl -, apksigcopier -, apksigner -, apktool -, binutils-unwrapped-all-targets -, bzip2 -, cbfstool -, cdrkit -, colord -, colordiff -, coreutils -, cpio -, db -, diffutils -, docutils -, dtc -, e2fsprogs -, enableBloat ? true -, enjarify -, fetchurl -, file -, findutils -, fontforge-fonttools -, ffmpeg -, fpc -, gettext -, ghc -, ghostscriptX -, giflib -, gnumeric -, gnupg -, gnutar -, gzip -, hdf5 -, help2man -, html2text -, imagemagick -, installShellFiles -, jdk -, libarchive -, libcaca -, libxmlb -, llvm -, lz4 -, lzip -, mono -, ocaml -, odt2txt -, oggvideotools -, openssh -, openssl -, pdftk -, pgpdump -, poppler_utils -, procyon -, python3 -, qemu -, R -, sng -, sqlite -, squashfsTools -, tcpdump -, ubootTools -, unzip -, wabt -, xmlbeans -, xxd -, xz -, zip -, zstd +{ + lib, + stdenv, + abootimg, + acl, + apksigcopier, + apksigner, + apktool, + binutils-unwrapped-all-targets, + bzip2, + cbfstool, + cdrkit, + colord, + colordiff, + coreutils, + cpio, + db, + diffutils, + docutils, + dtc, + e2fsprogs, + enableBloat ? true, + enjarify, + fetchurl, + file, + findutils, + fontforge-fonttools, + ffmpeg, + fpc, + gettext, + ghc, + ghostscriptX, + giflib, + gnumeric, + gnupg, + gnutar, + gzip, + hdf5, + help2man, + html2text, + imagemagick, + installShellFiles, + jdk, + libarchive, + libcaca, + libxmlb, + llvm, + lz4, + lzip, + mono, + ocaml, + odt2txt, + oggvideotools, + openssh, + openssl, + pdftk, + pgpdump, + poppler_utils, + procyon, + python3, + qemu, + R, + sng, + sqlite, + squashfsTools, + tcpdump, + ubootTools, + unzip, + wabt, + xmlbeans, + xxd, + xz, + zip, + zstd, # updater only -, writeScript + writeScript, }: let python = python3.override { + self = python; packageOverrides = final: prev: { # version 4 or newer would log the followng error but tests currently don't fail because radare2 is disabled # ValueError: argument TNULL is not a TLSH hex string - tlsh = prev.tlsh.overridePythonAttrs ({ src, ... }: let - version = "3.19.1"; - in { - inherit version; - src = src.override { - rev = version; - hash = "sha256-ZYEjT/yShfA4+zpbGOtaFOx1nSSOWPtMvskPhHv3c9U="; - }; - }); + tlsh = prev.tlsh.overridePythonAttrs ( + { src, ... }: + let + version = "3.19.1"; + in + { + inherit version; + src = src.override { + rev = version; + hash = "sha256-ZYEjT/yShfA4+zpbGOtaFOx1nSSOWPtMvskPhHv3c9U="; + }; + } + ); }; }; in @@ -96,11 +102,11 @@ in # Note: when upgrading this package, please run the list-missing-tools.sh script as described below! python.pkgs.buildPythonApplication rec { pname = "diffoscope"; - version = "271"; + version = "275"; src = fetchurl { url = "https://diffoscope.org/archive/diffoscope-${version}.tar.bz2"; - hash = "sha256-YwNaYj0daYbs3rN/EcPz5LihJjZ6JZb33FSS6u98Gss="; + hash = "sha256-mVbCsOPR0gm+93AG2p/W/TIOZItHSTOs40Q9uTiokEY="; }; outputs = [ @@ -108,10 +114,7 @@ python.pkgs.buildPythonApplication rec { "man" ]; - patches = [ - ./ignore_links.patch - ./openssh-no-dsa.patch # https://salsa.debian.org/reproducible-builds/diffoscope/-/merge_requests/139 - ]; + patches = [ ./ignore_links.patch ]; postPatch = '' # Upstream doesn't provide a PKG-INFO file @@ -148,106 +151,107 @@ python.pkgs.buildPythonApplication rec { # > FAILED tests/comparators/test_macho_decompiler.py::test_radare2_diff - AssertionError # # We filter automatically all packages for the host platform (some dependencies are not supported on Darwin, aarch64, etc.). - pythonPath = lib.filter (lib.meta.availableOn stdenv.hostPlatform) ([ - acl - binutils-unwrapped-all-targets - bzip2 - cdrkit - colordiff - coreutils - cpio - db - diffutils - dtc - e2fsprogs - file - findutils - fontforge-fonttools - gettext - gnutar - gzip - html2text - libarchive - libxmlb - lz4 - lzip - openssl - pgpdump - sng - sqlite - squashfsTools - unzip - xxd - xz - zip - zstd - ] - ++ (with python.pkgs; [ - argcomplete - debian - defusedxml - jsbeautifier - jsondiff - libarchive-c - progressbar33 - pypdf - python-magic - pyxattr - rpm - tlsh - ]) - ++ lib.optionals enableBloat ( + # Packages which are marked broken for a platform are not automatically filtered to avoid accidentally removing them without noticing it. + pythonPath = lib.filter (lib.meta.availableOn stdenv.hostPlatform) ( [ - abootimg - apksigcopier - apksigner - apktool - cbfstool - colord - enjarify - ffmpeg - fpc - ghc - ghostscriptX - giflib - gnupg - hdf5 - imagemagick - jdk - libcaca - llvm - mono - ocaml - odt2txt - openssh - pdftk - poppler_utils - procyon - qemu - R - tcpdump - ubootTools - wabt - xmlbeans + acl + binutils-unwrapped-all-targets + bzip2 + cdrkit + colordiff + coreutils + cpio + db + diffutils + dtc + e2fsprogs + file + findutils + fontforge-fonttools + gettext + gnutar + gzip + html2text + libarchive + libxmlb + lz4 + lzip + openssl + pgpdump + sng + sqlite + squashfsTools + unzip + xxd + xz + zip + zstd ] ++ (with python.pkgs; [ - androguard - binwalk - guestfs - h5py - pdfminer-six - r2pipe - # docx2txt, nixpkgs packages another project named the same, which does not work + argcomplete + debian + defusedxml + jsbeautifier + jsondiff + libarchive-c + progressbar33 + pypdf + python-magic + pyxattr + rpm + tlsh ]) - # oggvideotools is broken on Darwin, please put it back when it will be fixed? - ++ lib.optionals stdenv.isLinux [ oggvideotools ] - # This doesn't work on aarch64-darwin - ++ lib.optionals (stdenv.hostPlatform.system != "aarch64-darwin") [ gnumeric ] - )); + ++ lib.optionals enableBloat ( + [ + abootimg + apksigcopier + apksigner + apktool + cbfstool + colord + enjarify + ffmpeg + fpc + ghc + ghostscriptX + giflib + gnupg + hdf5 + imagemagick + jdk + libcaca + llvm + mono + ocaml + odt2txt + openssh + pdftk + poppler_utils + procyon + qemu + R + tcpdump + ubootTools + wabt + xmlbeans + ] + ++ (with python.pkgs; [ + androguard + binwalk + guestfs + h5py + pdfminer-six + r2pipe + # docx2txt, nixpkgs packages another project named the same, which does not work + ]) + # oggvideotools is broken on Darwin, please put it back when it will be fixed? + ++ lib.optionals stdenv.isLinux [ oggvideotools ] + # This doesn't work on aarch64-darwin + ++ lib.optionals (stdenv.hostPlatform.system != "aarch64-darwin") [ gnumeric ] + ) + ); - nativeCheckInputs = with python.pkgs; [ - pytestCheckHook - ] ++ pythonPath; + nativeCheckInputs = with python.pkgs; [ pytestCheckHook ] ++ pythonPath; pytestFlagsArray = [ # Always show more information when tests fail @@ -259,28 +263,30 @@ python.pkgs.buildPythonApplication rec { installManPage doc/diffoscope.1 ''; - disabledTests = [ - "test_sbin_added_to_path" - "test_diff_meta" - "test_diff_meta2" + disabledTests = + [ + "test_sbin_added_to_path" + "test_diff_meta" + "test_diff_meta2" - # Fails because it fails to determine llvm version - "test_item3_deflate_llvm_bitcode" - ] ++ lib.optionals stdenv.isDarwin [ - # Disable flaky tests on Darwin - "test_non_unicode_filename" - "test_listing" - "test_symlink_root" + # Fails because it fails to determine llvm version + "test_item3_deflate_llvm_bitcode" + ] + ++ lib.optionals stdenv.isDarwin [ + # Disable flaky tests on Darwin + "test_non_unicode_filename" + "test_listing" + "test_symlink_root" - # Appears to be a sandbox related issue - "test_trim_stderr_in_command" - # Seems to be a bug caused by having different versions of rdata than - # expected. Will file upstream. - "test_item_rdb" - # Caused by getting an otool command instead of llvm-objdump. Could be Nix - # setup, could be upstream bug. Will file upstream. - "test_libmix_differences" - ]; + # Appears to be a sandbox related issue + "test_trim_stderr_in_command" + # Seems to be a bug caused by having different versions of rdata than + # expected. Will file upstream. + "test_item_rdb" + # Caused by getting an otool command instead of llvm-objdump. Could be Nix + # setup, could be upstream bug. Will file upstream. + "test_libmix_differences" + ]; disabledTestPaths = lib.optionals stdenv.isDarwin [ "tests/comparators/test_git.py" @@ -318,7 +324,11 @@ python.pkgs.buildPythonApplication rec { homepage = "https://diffoscope.org/"; changelog = "https://diffoscope.org/news/diffoscope-${version}-released/"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ dezgeg danielfullmer raitobezarius ]; + maintainers = with maintainers; [ + dezgeg + danielfullmer + raitobezarius + ]; platforms = platforms.unix; mainProgram = "diffoscope"; }; |