From a595896c5686881a73c6819fbc9b0d1967cfea60 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Thu, 19 Jul 2018 02:31:23 +0300 Subject: diffoscope: Document the script to locate missing optional dependencies And give it it a bit more descriptive name of list-missing-tools.sh. --- pkgs/tools/misc/diffoscope/default.nix | 4 ++++ pkgs/tools/misc/diffoscope/list-missing-tools.sh | 23 +++++++++++++++++++++++ pkgs/tools/misc/diffoscope/list-tools.sh | 20 -------------------- 3 files changed, 27 insertions(+), 20 deletions(-) create mode 100755 pkgs/tools/misc/diffoscope/list-missing-tools.sh delete mode 100755 pkgs/tools/misc/diffoscope/list-tools.sh (limited to 'pkgs/tools/misc') diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 73b7f2272cdd..e55d5c89b5b1 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -6,6 +6,7 @@ , enableBloat ? false }: +# Note: when upgrading this package, please run the list-missing-tools.sh script as described below! python3Packages.buildPythonApplication rec { name = "diffoscope-${version}"; version = "99"; @@ -30,6 +31,9 @@ python3Packages.buildPythonApplication rec { nativeBuildInputs = [ docutils help2man ]; + # 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 + # # Still missing these tools: abootimg docx2txt dumpxsb enjarify js-beautify lipo oggDump otool procyon-decompiler Rscript # Also these libraries: python3-guestfs pythonPath = with python3Packages; [ debian libarchive-c python_magic tlsh rpm ] ++ [ diff --git a/pkgs/tools/misc/diffoscope/list-missing-tools.sh b/pkgs/tools/misc/diffoscope/list-missing-tools.sh new file mode 100755 index 000000000000..5f4d118cfed7 --- /dev/null +++ b/pkgs/tools/misc/diffoscope/list-missing-tools.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# This script lists all the optional command-line tools that diffoscope can use +# (i.e. `diffoscope --list-tools`) but are missing from the Nix expression. + +diffoscope=$(nix-build --no-out-link -E 'with import ./. {}; diffoscope.override { enableBloat = true; }')/bin/diffoscope + +required=$($diffoscope --list-tools | \ + grep '^External-Tools-Required:' | \ + cut -d ' ' -f2- | \ + tr -d ,) + +# Uber-hacky! +pathScript=$(cat $diffoscope | grep PATH) + +export PATH=$(nix-build --no-out-link -A which)/bin +eval "$pathScript" + +for tool in $required; do + if ! which $tool >/dev/null 2>&1; then + echo $tool + fi +done | sort diff --git a/pkgs/tools/misc/diffoscope/list-tools.sh b/pkgs/tools/misc/diffoscope/list-tools.sh deleted file mode 100755 index 9af7f0e38899..000000000000 --- a/pkgs/tools/misc/diffoscope/list-tools.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -diffoscope=$(nix-build --no-out-link -E 'with import ./. {}; diffoscope.override { enableBloat = true; }')/bin/diffoscope - -required=$($diffoscope --list-tools | \ - grep '^External-Tools-Required:' | \ - cut -d ' ' -f2- | \ - tr -d ,) - -# Uber-hacky! -pathScript=$(cat $diffoscope | grep PATH) - -export PATH=$(nix-build --no-out-link -A which)/bin -eval "$pathScript" - -for tool in $required; do - if ! which $tool >/dev/null 2>&1; then - echo $tool - fi -done | sort -- cgit 1.4.1