2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-10-11 12:50:04 +00:00
|
|
|
, fetchurl
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchsvn
|
2021-02-05 17:12:51 +00:00
|
|
|
, substituteAll
|
2020-10-11 12:50:04 +00:00
|
|
|
, jdk
|
|
|
|
, jre
|
|
|
|
, ant
|
|
|
|
, makeWrapper
|
|
|
|
, doCheck ? true
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
deps = import ../deps.nix { inherit fetchurl; };
|
|
|
|
testInputs = import ./testinputs.nix { inherit fetchurl; };
|
|
|
|
in
|
2021-02-05 17:12:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-10-11 12:50:04 +00:00
|
|
|
pname = "splitter";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "651";
|
2020-10-11 12:50:04 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchsvn {
|
|
|
|
url = "https://svn.mkgmap.org.uk/mkgmap/splitter/trunk";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-j6U+Wvxef151NEwkpuv4VdMac/cOT9YZUgkt+YPGCuk=";
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-02-05 17:12:51 +00:00
|
|
|
(substituteAll {
|
|
|
|
# Disable automatic download of dependencies
|
|
|
|
src = ./build.xml.patch;
|
|
|
|
inherit version;
|
|
|
|
})
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
# Fix func.SolverAndProblemGeneratorTest test
|
|
|
|
./fix-failing-test.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = with deps; ''
|
|
|
|
mkdir -p lib/compile
|
|
|
|
cp ${fastutil} lib/compile/${fastutil.name}
|
|
|
|
cp ${osmpbf} lib/compile/${osmpbf.name}
|
|
|
|
cp ${protobuf} lib/compile/${protobuf.name}
|
|
|
|
cp ${xpp3} lib/compile/${xpp3.name}
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + lib.optionalString doCheck ''
|
2020-10-11 12:50:04 +00:00
|
|
|
mkdir -p lib/test
|
|
|
|
cp ${junit} lib/test/${junit.name}
|
|
|
|
cp ${hamcrest-core} lib/test/${hamcrest-core.name}
|
|
|
|
|
|
|
|
mkdir -p test/resources/in/osm
|
2021-01-15 22:18:51 +00:00
|
|
|
${lib.concatMapStringsSep "\n" (res: ''
|
2020-10-11 12:50:04 +00:00
|
|
|
cp ${res} test/resources/in/${builtins.replaceStrings [ "__" ] [ "/" ] res.name}
|
|
|
|
'') testInputs}
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ jdk ant makeWrapper ];
|
|
|
|
|
|
|
|
buildPhase = "ant";
|
|
|
|
|
|
|
|
inherit doCheck;
|
|
|
|
|
|
|
|
checkPhase = "ant run.tests && ant run.func-tests";
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
install -Dm644 dist/splitter.jar -t $out/share/java/splitter
|
|
|
|
install -Dm644 doc/splitter.1 -t $out/share/man/man1
|
2020-10-11 12:50:04 +00:00
|
|
|
cp -r dist/lib/ $out/share/java/splitter/
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/splitter \
|
|
|
|
--add-flags "-jar $out/share/java/splitter/splitter.jar"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
passthru.updateScript = [ ../update.sh "mkgmap-splitter" meta.downloadPage ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 12:50:04 +00:00
|
|
|
description = "Utility for splitting OpenStreetMap maps into tiles";
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://www.mkgmap.org.uk/";
|
2021-08-05 21:33:18 +00:00
|
|
|
downloadPage = "https://www.mkgmap.org.uk/download/splitter.html";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # deps
|
|
|
|
];
|
2020-10-11 12:50:04 +00:00
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|