josm: minor cleanups
- Use `makeWrapper` to generate wrapper script. - Use `buildCommand` instead of explicit phases.`
This commit is contained in:
parent
fd4d957ac4
commit
2a36c6c185
@ -1,4 +1,4 @@
|
||||
{ fetchurl, stdenv, makeDesktopItem, unzip, bash, jre8 }:
|
||||
{ fetchurl, stdenv, makeDesktopItem, makeWrapper, unzip, bash, jre8 }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "josm-${version}";
|
||||
@ -9,9 +9,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0lpz4yzkvjpn5g36nibrkh773jnlkiqj6lghsx69i86h0xfb7gqf";
|
||||
};
|
||||
|
||||
phases = [ "installPhase" ];
|
||||
|
||||
buildInputs = [ jre8 ];
|
||||
buildInputs = [ jre8 makeWrapper ];
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "josm";
|
||||
@ -23,14 +21,12 @@ stdenv.mkDerivation rec {
|
||||
categories = "Education;Geoscience;Maps;";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin $out/share/java
|
||||
cp -v $src $out/share/java/josm.jar
|
||||
cat > $out/bin/josm <<EOF
|
||||
#!${bash}/bin/bash
|
||||
exec ${jre8}/bin/java -jar $out/share/java/josm.jar "\$@"
|
||||
EOF
|
||||
chmod 755 $out/bin/josm
|
||||
|
||||
makeWrapper ${jre8}/bin/java $out/bin/josm \
|
||||
--add-flags "-jar $out/share/java/josm.jar"
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
cp $desktopItem/share/applications"/"* $out/share/applications
|
||||
|
Loading…
Reference in New Issue
Block a user