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
parent 8c39547fc2
commit e50afd12b7
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
'';
}