diff options
author | Nikolay Korotkiy <sikmir@gmail.com> | 2020-05-08 11:14:10 +0300 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-05-08 20:11:50 +0200 |
commit | 61812d57fba75901d4ea6137b09595e14ba7caaf (patch) | |
tree | 3df5c0956491acae187055fd7d27a39da3413940 /pkgs/applications/misc/josm | |
parent | 329aece2d5fa9f3e3dc40eaa8f519fe99b93d71f (diff) |
josm: fix package
Diffstat (limited to 'pkgs/applications/misc/josm')
-rw-r--r-- | pkgs/applications/misc/josm/default.nix | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/pkgs/applications/misc/josm/default.nix b/pkgs/applications/misc/josm/default.nix index eec7a066a887a..f68de80b7012f 100644 --- a/pkgs/applications/misc/josm/default.nix +++ b/pkgs/applications/misc/josm/default.nix @@ -1,46 +1,50 @@ -{ fetchurl, stdenv, makeDesktopItem, makeWrapper, unzip, jdk11, libXxf86vm }: - -stdenv.mkDerivation rec { +{ stdenv, fetchurl, fetchsvn, makeWrapper, unzip, jre, libXxf86vm }: +let pname = "josm"; version = "16239"; - - src = fetchurl { - url = "https://josm.openstreetmap.de/download/josm-snapshot-${version}.jar"; - sha256 = "041n81mnd587043f8wwjv8ckbx0hlsqf3pc7hzbns1y89xdghms1"; + srcs = { + jar = fetchurl { + url = "https://josm.openstreetmap.de/download/josm-snapshot-${version}.jar"; + sha256 = "041n81mnd587043f8wwjv8ckbx0hlsqf3pc7hzbns1y89xdghms1"; + }; + macosx = fetchurl { + url = "https://josm.openstreetmap.de/download/macosx/josm-macosx-${version}.zip"; + sha256 = "1nlw1rvwdfp1hhsxyjli8pylm0hb7k62sa0nqvgyiw54dz78n00c"; + }; + pkg = fetchsvn { + url = "https://josm.openstreetmap.de/svn/trunk/native/linux/tested"; + rev = version; + sha256 = "1qqk4bal84wnb66jym6qrdi10ypzvdzihd4jk5rnyfl3wm5qafbi"; + }; }; +in +stdenv.mkDerivation { + inherit pname version; - buildInputs = [ jdk11 makeWrapper ]; - - desktopItem = makeDesktopItem { - name = "josm"; - exec = "josm"; - icon = "josm"; - desktopName = "JOSM"; - genericName = "OpenStreetMap Editor"; - comment = meta.description; - categories = "Education;Geoscience;Maps;"; - }; + dontUnpack = true; - # Add libXxf86vm to path because it is needed by at least Kendzi3D plugin - buildCommand = '' - mkdir -p $out/bin $out/share/java - cp -v $src $out/share/java/josm.jar + buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ jre makeWrapper ]; - makeWrapper ${jdk11}/bin/java $out/bin/josm \ - --add-flags "-jar $out/share/java/josm.jar" \ - --prefix LD_LIBRARY_PATH ":" '${libXxf86vm}/lib' + installPhase = + if stdenv.isDarwin then '' + mkdir -p $out/Applications + ${unzip}/bin/unzip ${srcs.macosx} 'JOSM.app/*' -d $out/Applications + '' else '' + install -Dm644 ${srcs.jar} $out/share/josm/josm.jar + cp -R ${srcs.pkg}/usr/share $out - mkdir -p $out/share/applications - cp $desktopItem/share/applications"/"* $out/share/applications - mkdir -p $out/share/pixmaps - ${unzip}/bin/unzip -p $src images/logo_48x48x32.png > $out/share/pixmaps/josm.png - ''; + # Add libXxf86vm to path because it is needed by at least Kendzi3D plugin + makeWrapper ${jre}/bin/java $out/bin/josm \ + --add-flags "-Djosm.restart=true -Djava.net.useSystemProxies=true" \ + --add-flags "-jar $out/share/josm/josm.jar" \ + --prefix LD_LIBRARY_PATH ":" '${libXxf86vm}/lib' + ''; meta = with stdenv.lib; { description = "An extensible editor for OpenStreetMap"; homepage = "https://josm.openstreetmap.de/"; license = licenses.gpl2Plus; - maintainers = [ maintainers.rycee ]; + maintainers = with maintainers; [ rycee sikmir ]; platforms = platforms.all; }; } |