summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2023-05-24 17:46:54 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-05-26 12:23:48 +0000
commitf53631beb6b94851aaa635b5e059b5bddee10e7e (patch)
treeca383fc134c1c591dedf30a372339c481f36ef73
parentpython3Packages.pyxattr: platforms are the ones xattr supports (diff)
downloadnixpkgs-f53631beb6b94851aaa635b5e059b5bddee10e7e.tar.gz
diffoscope: introduce `lib.meta.availableOn stdenv.hostPlatform` for "plugins"
This makes it easier to add new plugins without having to worry whether they are supported on Darwin, aarch64-*, etc. As long as they are properly tagged through their `platforms` meta attribute (or `badPlatforms`). Broken packages needs to be separated to avoid silent breakages which we would not notice. (cherry picked from commit 43957dc1501d32df91a7a7180a7366c172e7b46d)
-rw-r--r--pkgs/tools/misc/diffoscope/default.nix17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix
index 88c6af2bdc04..9f1b76badbba 100644
--- a/pkgs/tools/misc/diffoscope/default.nix
+++ b/pkgs/tools/misc/diffoscope/default.nix
@@ -44,31 +44,32 @@ python3Packages.buildPythonApplication rec {
# 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
- pythonPath = [
+ # 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) ([
binutils-unwrapped-all-targets bzip2 colordiff coreutils cpio db diffutils
e2fsprogs file findutils fontforge-fonttools gettext gnutar gzip
html2text libarchive lz4 openssl pgpdump sng sqlite squashfsTools unzip xxd
- xz zip zstd
+ xz zip zstd cdrkit dtc
]
++ (with python3Packages; [
argcomplete debian defusedxml jsondiff jsbeautifier libarchive-c
- python-magic progressbar33 pypdf2 tlsh
+ python-magic progressbar33 pypdf2 tlsh pyxattr rpm
])
- ++ lib.optionals stdenv.isLinux [ python3Packages.pyxattr python3Packages.rpm acl cdrkit dtc ]
++ lib.optionals enableBloat (
[
apksigcopier apksigner enjarify ffmpeg fpc ghc ghostscriptX giflib gnupg pdftk
hdf5 imagemagick libcaca llvm jdk mono ocaml odt2txt openssh
poppler_utils procyon qemu R tcpdump wabt radare2 xmlbeans
+ abootimg cbfstool colord ubootTools
]
- ++ (with python3Packages; [ androguard binwalk h5py pdfminer-six ])
+ ++ (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 [ abootimg cbfstool colord ubootTools python3Packages.guestfs oggvideotools ]
+ ++ lib.optionals stdenv.isLinux [ oggvideotools ]
# This doesn't work on aarch64-darwin
- ++ lib.optionals (stdenv.isx86_64 || stdenv.isLinux) [ gnumeric ]
+ ++ 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;