diffoscope: equalize the content

- order inputs alphabetically
- run nixpkgs-fmt
This commit is contained in:
Fabian Affolter 2023-07-02 00:02:09 +02:00
parent ae2fbbff4d
commit cdb73f3806

View file

@ -1,11 +1,78 @@
{ lib, stdenv, fetchurl, python3Packages, docutils, help2man, installShellFiles, fetchpatch { lib
, abootimg, acl, apksigcopier, apksigner, apktool, binutils-unwrapped-all-targets, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, db, diffutils, dtc , stdenv
, e2fsprogs, enjarify, file, findutils, fontforge-fonttools, ffmpeg, fpc, gettext, ghc, ghostscriptX, giflib, gnumeric, gnupg, gnutar , abootimg
, gzip, html2text, hdf5, imagemagick, jdk, libarchive, libcaca, llvm, lz4, mono, ocaml, oggvideotools, openssh, openssl, pdftk, pgpdump, poppler_utils, procyon, qemu, R , acl
, radare2, sng, sqlite, squashfsTools, tcpdump, ubootTools, odt2txt, unzip, wabt, xmlbeans, xxd, xz, zip, zstd , apksigcopier
, apksigner
, apktool
, binutils-unwrapped-all-targets
, bzip2
, cbfstool
, cdrkit
, colord
, colordiff
, coreutils
, cpio
, db
, diffutils
, docutils
, dtc
, e2fsprogs
, enableBloat ? true , enableBloat ? true
, enableUnfree ? false , enableUnfree ? false
# updater only , enjarify
, fetchpatch
, fetchurl
, file
, findutils
, fontforge-fonttools
, ffmpeg
, fpc
, gettext
, ghc
, ghostscriptX
, giflib
, gnumeric
, gnupg
, gnutar
, gzip
, hdf5
, help2man
, html2text
, imagemagick
, installShellFiles
, jdk
, libarchive
, libcaca
, llvm
, lz4
, mono
, ocaml
, odt2txt
, oggvideotools
, openssh
, openssl
, pdftk
, pgpdump
, poppler_utils
, procyon
, python3Packages
, qemu
, R
, radare2
, sng
, sqlite
, squashfsTools
, tcpdump
, ubootTools
, unzip
, wabt
, xmlbeans
, xxd
, xz
, zip
, zstd
# updater only
, writeScript , writeScript
}: }:
@ -19,7 +86,10 @@ python3Packages.buildPythonApplication rec {
sha256 = "sha256-A2GYnhdjkzSFnMsy99FmckiOsbRdymAdtjp55hyFLp4="; sha256 = "sha256-A2GYnhdjkzSFnMsy99FmckiOsbRdymAdtjp55hyFLp4=";
}; };
outputs = [ "out" "man" ]; outputs = [
"out"
"man"
];
patches = [ patches = [
./ignore_links.patch ./ignore_links.patch
@ -38,40 +108,119 @@ python3Packages.buildPythonApplication rec {
substituteInPlace doc/Makefile --replace "../bin" "$out/bin" substituteInPlace doc/Makefile --replace "../bin" "$out/bin"
''; '';
nativeBuildInputs = [ docutils help2man installShellFiles ]; nativeBuildInputs = [
docutils
help2man
installShellFiles
];
# Most of the non-Python dependencies here are optional command-line tools for various file-format parsers. # 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 # To help figuring out what's missing from the list, run: ./pkgs/tools/misc/diffoscope/list-missing-tools.sh
# #
# Still missing these tools: docx2txt lipo otool r2pipe # Still missing these tools:
# docx2txt
# lipo
# otool
# r2pipe
#
# We filter automatically all packages for the host platform (some dependencies are not supported on Darwin, aarch64, etc.). # 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) ([ pythonPath = lib.filter (lib.meta.availableOn stdenv.hostPlatform) ([
binutils-unwrapped-all-targets bzip2 colordiff coreutils cpio db diffutils binutils-unwrapped-all-targets
e2fsprogs file findutils fontforge-fonttools gettext gnutar gzip bzip2
html2text libarchive lz4 openssl pgpdump sng sqlite squashfsTools unzip xxd cdrkit
xz zip zstd cdrkit dtc colordiff
coreutils
cpio
db
diffutils
dtc
e2fsprogs
file
findutils
fontforge-fonttools
gettext
gnutar
gzip
html2text
libarchive
lz4
openssl
pgpdump
sng
sqlite
squashfsTools
unzip
xxd
xz
zip
zstd
]
++ (with python3Packages; [
argcomplete
debian
defusedxml
jsbeautifier
jsondiff
libarchive-c
progressbar33
pypdf2
python-magic
pyxattr
rpm
tlsh
])
++ lib.optionals enableBloat (
[
abootimg
apksigcopier
apksigner
cbfstool
colord
enjarify
ffmpeg
fpc
ghc
ghostscriptX
giflib
gnupg
hdf5
imagemagick
jdk
libcaca
llvm
mono
ocaml
odt2txt
openssh
pdftk
poppler_utils
procyon
qemu
R
radare2
tcpdump
ubootTools
wabt
xmlbeans
] ]
++ (with python3Packages; [ ++ (with python3Packages; [
argcomplete debian defusedxml jsondiff jsbeautifier libarchive-c androguard
python-magic progressbar33 pypdf2 tlsh pyxattr rpm binwalk
guestfs
h5py
pdfminer-six
]) ])
++ lib.optionals enableBloat ( # oggvideotools is broken on Darwin, please put it back when it will be fixed?
[ ++ lib.optionals stdenv.isLinux [ oggvideotools ]
apksigcopier apksigner enjarify ffmpeg fpc ghc ghostscriptX giflib gnupg pdftk # This doesn't work on aarch64-darwin
hdf5 imagemagick libcaca llvm jdk mono ocaml odt2txt openssh ++ lib.optionals (stdenv.hostPlatform != "aarch64-darwin") [ gnumeric ]
poppler_utils procyon qemu R tcpdump wabt radare2 xmlbeans # `apktool` depend on `build-tools` which requires Android SDK acceptance, therefore, the whole thing is unfree.
abootimg cbfstool colord ubootTools ++ lib.optionals enableUnfree [ apktool ]
] ));
++ (with python3Packages; [ androguard binwalk h5py pdfminer-six guestfs ])
# 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 != "aarch64-darwin") [ gnumeric ]
# `apktool` depend on `build-tools` which requires Android SDK acceptance, therefore, the whole thing is unfree.
++ lib.optionals enableUnfree [ apktool ]
));
nativeCheckInputs = with python3Packages; [ pytestCheckHook ] ++ pythonPath; nativeCheckInputs = with python3Packages; [
pytestCheckHook
] ++ pythonPath;
pytestFlagsArray = [ pytestFlagsArray = [
# always show more information when tests fail # always show more information when tests fail
@ -106,7 +255,7 @@ python3Packages.buildPythonApplication rec {
"tests/comparators/test_macho.py" "tests/comparators/test_macho.py"
]; ];
passthru = { passthru = {
updateScript = writeScript "update-diffoscope" '' updateScript = writeScript "update-diffoscope" ''
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pcre common-updater-scripts #!nix-shell -i bash -p curl pcre common-updater-scripts
@ -117,7 +266,7 @@ python3Packages.buildPythonApplication rec {
newVersion="$(curl -s https://diffoscope.org/ | pcregrep -o1 'Latest release: ([0-9]+)')" newVersion="$(curl -s https://diffoscope.org/ | pcregrep -o1 'Latest release: ([0-9]+)')"
update-source-version ${pname} "$newVersion" update-source-version ${pname} "$newVersion"
''; '';
}; };
meta = with lib; { meta = with lib; {
description = "Perform in-depth comparison of files, archives, and directories"; description = "Perform in-depth comparison of files, archives, and directories";