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:
parent
9870b076f5
commit
62382e6a6f
|
@ -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
|
|
@ -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
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue