2021-05-03 20:48:10 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchsvn, makeWrapper, unzip, jre, libXxf86vm
|
|
|
|
, extraJavaOpts ? "-Djosm.restart=true -Djava.net.useSystemProxies=true"
|
|
|
|
}:
|
2020-05-15 21:57:56 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "josm";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "18463";
|
2020-05-15 21:57:56 +00:00
|
|
|
srcs = {
|
|
|
|
jar = fetchurl {
|
|
|
|
url = "https://josm.openstreetmap.de/download/josm-snapshot-${version}.jar";
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "sha256-++8XtzAykJ+85Kvzy3xgaZoKaVlJwz+Ct1xb/QkC1Gc=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
macosx = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://josm.openstreetmap.de/download/macosx/josm-macos-${version}-java17.zip";
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "sha256-n7GlUWYOAXw4G59SBsO8HZ1OaiUWwzOsiURPFBYq31E=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
pkg = fetchsvn {
|
|
|
|
url = "https://josm.openstreetmap.de/svn/trunk/native/linux/tested";
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-AyfUFE0y8d8FtgfhxSscQGE1IVNwYYNymH6jTnrUBTs=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-05-15 21:57:56 +00:00
|
|
|
in
|
2021-05-03 20:48:10 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-05-15 21:57:56 +00:00
|
|
|
inherit pname version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ jre ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
# Add libXxf86vm to path because it is needed by at least Kendzi3D plugin
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/josm \
|
2021-05-03 20:48:10 +00:00
|
|
|
--add-flags "${extraJavaOpts} -jar $out/share/josm/josm.jar" \
|
2020-05-15 21:57:56 +00:00
|
|
|
--prefix LD_LIBRARY_PATH ":" '${libXxf86vm}/lib'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An extensible editor for OpenStreetMap";
|
|
|
|
homepage = "https://josm.openstreetmap.de/";
|
2020-11-24 20:58:05 +00:00
|
|
|
changelog = "https://josm.openstreetmap.de/wiki/Changelog";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-05-15 21:57:56 +00:00
|
|
|
maintainers = with maintainers; [ rycee sikmir ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|