Skip to content

Commit

Permalink
netalyzr: use makeWrapper i/o custom script
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Oct 10, 2017
1 parent b9d276b commit ef1cb94
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pkgs/tools/networking/netalyzr/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, jre }:
{ stdenv, fetchurl, jre, makeWrapper }:

stdenv.mkDerivation rec {
name = "netalyzr-${version}";
Expand All @@ -12,17 +12,13 @@ stdenv.mkDerivation rec {

phases = [ "installPhase" ];

nativeBuildInputs = [ makeWrapper ];

installPhase = ''
mkdir -p $out/{bin,share/netalyzr}
install -m644 $src $out/share/netalyzr/NetalyzrCLI.jar
cat <<_EOF >> $out/bin/netalyzr
#!${stdenv.shell}
set -euo pipefail
exec ${stdenv.lib.getBin jre}/bin/java -jar $out/share/netalyzr/NetalyzrCLI.jar "\$@"
_EOF
chmod 755 $out/bin/netalyzr
makeWrapper ${stdenv.lib.getBin jre}/bin/java $out/bin/netalyzr \
--add-flags "-jar $out/share/netalyzr/NetalyzrCLI.jar"
'';

meta = with stdenv.lib; {
Expand Down

0 comments on commit ef1cb94

Please sign in to comment.