Skip to content

Commit

Permalink
diffoscope: wrap executable and include tools in PATH
Browse files Browse the repository at this point in the history
diffoscope was looking for the tools it uses during runtime, but the
tools there neither part of the closure nor were they in the
PATH. This commit fixes this.
  • Loading branch information
KaiHa committed Jul 20, 2017
1 parent 934c2b6 commit 23ad77b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions pkgs/tools/misc/diffoscope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
, enableBloat ? false
}:

python3.pkgs.buildPythonApplication rec {
# Still missing these tools: enjarify, otool & lipo (maybe OS X only), showttf
# Also these libraries: python3-guestfs
# FIXME: move xxd into a separate package so we don't have to pull in all of vim.
let tools = [ acl binutils bzip2 cbfstool cdrkit cpio diffutils e2fsprogs file gettext
gzip libcaca poppler_utils sng sqlite squashfsTools unzip vim xz colordiff
] ++ lib.optionals enableBloat [ colord fpc ghc gnupg1 jdk mono pdftk ];
in python3.pkgs.buildPythonApplication rec {
pname = "diffoscope";
name = "${pname}-${version}";
version = "77";
Expand All @@ -26,21 +32,14 @@ python3.pkgs.buildPythonApplication rec {
sed -i setup.py -e "/'rpm-python',/d"
'';

# Still missing these tools: enjarify, otool & lipo (maybe OS X only), showttf
# Also these libraries: python3-guestfs
# FIXME: move xxd into a separate package so we don't have to pull in all of vim.
buildInputs =
map lib.getBin ([ acl binutils bzip2 cbfstool cdrkit cpio diffutils e2fsprogs file gettext
gzip libcaca poppler_utils sng sqlite squashfsTools unzip vim xz colordiff
] ++ lib.optionals enableBloat [ colord fpc ghc gnupg1 jdk mono pdftk ]);

pythonPath = with python3.pkgs; [ debian libarchive-c python_magic tlsh rpm ];

doCheck = false; # Calls 'mknod' in squashfs tests, which needs root

postInstall = ''
mkdir -p $out/share/man/man1
${docutils}/bin/rst2man.py debian/diffoscope.1.rst $out/share/man/man1/diffoscope.1
wrapProgram $out/bin/diffoscope --prefix PATH : ${lib.makeBinPath tools}
'';

meta = with stdenv.lib; {
Expand Down

0 comments on commit 23ad77b

Please sign in to comment.