josm: fix package

This commit is contained in:
Nikolay Korotkiy 2020-05-08 11:14:10 +03:00 committed by Robert Helgesson
parent 329aece2d5
commit 61812d57fb
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
2 changed files with 36 additions and 32 deletions

View File

@ -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 ];
dontUnpack = true;
desktopItem = makeDesktopItem {
name = "josm";
exec = "josm";
icon = "josm";
desktopName = "JOSM";
genericName = "OpenStreetMap Editor";
comment = meta.description;
categories = "Education;Geoscience;Maps;";
};
buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ jre makeWrapper ];
# 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
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
makeWrapper ${jdk11}/bin/java $out/bin/josm \
--add-flags "-jar $out/share/java/josm.jar" \
--prefix LD_LIBRARY_PATH ":" '${libXxf86vm}/lib'
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;
};
}

View File

@ -20176,7 +20176,7 @@ in
joe = callPackage ../applications/editors/joe { };
josm = callPackage ../applications/misc/josm { };
josm = callPackage ../applications/misc/josm { jre = jdk11; };
jwm = callPackage ../applications/window-managers/jwm { };