3
0
Fork 0
forked from mirrors/nixpkgs

alloy: use installPhase instead of ./builder.sh

Also pass on any arguments from the shell wrapper to the .jar.
And be less clever with shell strings.
This commit is contained in:
Tobias Geerinckx-Rice 2015-05-09 03:17:33 +02:00 committed by Domen Kožar
parent 9870b076f5
commit 62382e6a6f
2 changed files with 17 additions and 20 deletions

View file

@ -1,16 +0,0 @@
source $stdenv/setup
jar=${src##*/}
jar=$out/share/alloy/${jar#*-}
install -Dm644 $src $jar
cat << EOF > alloy
#! $SHELL
exec $jre/bin/java -jar $jar
EOF
install -Dm755 alloy $out/bin/alloy
install -Dm644 $icon $out/share/pixmaps/alloy.png
cp -r ${desktopItem}/share/applications $out/share

View file

@ -38,11 +38,24 @@ stdenv.mkDerivation rec {
categories = "Development;IDE;Education;";
};
buildInputs = [ jre ];
inherit jre;
icon = ./icon.png;
phases = [ "installPhase" ];
builder = ./builder.sh;
installPhase = ''
jar=`basename ${src}`
jar=$out/share/alloy/alloy${version}.jar
install -Dm644 ${src} $jar
cat << EOF > alloy
#!${stdenv.shell}
exec ${jre}/bin/java -jar $jar "\''${@}"
EOF
install -Dm755 alloy $out/bin/alloy
install -Dm644 ${./icon.png} $out/share/pixmaps/alloy.png
cp -r ${desktopItem}/share/applications $out/share
'';
}