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";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "18678";
|
2020-05-15 21:57:56 +00:00
|
|
|
srcs = {
|
|
|
|
jar = fetchurl {
|
|
|
|
url = "https://josm.openstreetmap.de/download/josm-snapshot-${version}.jar";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-p0HjjF4SLPsD/KcAPNyHasuGrDPSQ/2KHjX1R2eywNo=";
|
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";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-YlSFHx37RkdTlQ3/ZAqj+ezv+cSVifsxR7s6S7pDd4o=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
pkg = fetchsvn {
|
|
|
|
url = "https://josm.openstreetmap.de/svn/trunk/native/linux/tested";
|
|
|
|
rev = version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-Cga17ymUROJb5scpyOlo6JIgQ77yHavI0ciUpZN+jLk=";
|
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;
|
|
|
|
};
|
|
|
|
}
|