summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2017-09-14 12:04:23 +0200
committerRobert Helgesson <robert@rycee.net>2017-09-14 12:04:23 +0200
commit2a36c6c18543cbfa540b76ba72b71e110e07b617 (patch)
tree7d181069e661d5f6cf51a19b6460a1ade6a1d9f5
parentfd4d957ac43cba170edf44e17f345083b91af654 (diff)
downloadnixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.tar
nixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.tar.gz
nixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.tar.bz2
nixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.tar.lz
nixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.tar.xz
nixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.tar.zst
nixpkgs-2a36c6c18543cbfa540b76ba72b71e110e07b617.zip
josm: minor cleanups
- Use `makeWrapper` to generate wrapper script.

- Use `buildCommand` instead of explicit phases.`
-rw-r--r--pkgs/applications/misc/josm/default.nix16
1 files changed, 6 insertions, 10 deletions
diff --git a/pkgs/applications/misc/josm/default.nix b/pkgs/applications/misc/josm/default.nix
index 6d41f4fe270..8952b7edba4 100644
--- a/pkgs/applications/misc/josm/default.nix
+++ b/pkgs/applications/misc/josm/default.nix
@@ -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