889482aab3
GitOrigin-RevId: f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5
83 lines
2.2 KiB
Nix
83 lines
2.2 KiB
Nix
{ lib, stdenv
|
|
, fetchurl
|
|
, fetchsvn
|
|
, substituteAll
|
|
, jdk
|
|
, jre
|
|
, ant
|
|
, makeWrapper
|
|
, doCheck ? true
|
|
}:
|
|
let
|
|
deps = import ../deps.nix { inherit fetchurl; };
|
|
testInputs = import ./testinputs.nix { inherit fetchurl; };
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "splitter";
|
|
version = "652";
|
|
|
|
src = fetchsvn {
|
|
url = "https://svn.mkgmap.org.uk/mkgmap/splitter/trunk";
|
|
rev = version;
|
|
sha256 = "sha256-yCdVOT8if3AImD4Q63gKfMep7WZsrCgV+IXfP4ZL3Qw=";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
# Disable automatic download of dependencies
|
|
src = ./build.xml.patch;
|
|
inherit version;
|
|
})
|
|
|
|
# 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}
|
|
'' + lib.optionalString doCheck ''
|
|
mkdir -p lib/test
|
|
cp ${junit} lib/test/${junit.name}
|
|
cp ${hamcrest-core} lib/test/${hamcrest-core.name}
|
|
|
|
mkdir -p test/resources/in/osm
|
|
${lib.concatMapStringsSep "\n" (res: ''
|
|
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 = ''
|
|
install -Dm644 dist/splitter.jar -t $out/share/java/splitter
|
|
install -Dm644 doc/splitter.1 -t $out/share/man/man1
|
|
cp -r dist/lib/ $out/share/java/splitter/
|
|
makeWrapper ${jre}/bin/java $out/bin/splitter \
|
|
--add-flags "-jar $out/share/java/splitter/splitter.jar"
|
|
'';
|
|
|
|
passthru.updateScript = [ ../update.sh "mkgmap-splitter" meta.downloadPage ];
|
|
|
|
meta = with lib; {
|
|
description = "Utility for splitting OpenStreetMap maps into tiles";
|
|
homepage = "https://www.mkgmap.org.uk/";
|
|
downloadPage = "https://www.mkgmap.org.uk/download/splitter.html";
|
|
sourceProvenance = with sourceTypes; [
|
|
fromSource
|
|
binaryBytecode # deps
|
|
];
|
|
license = licenses.gpl2Only;
|
|
maintainers = with maintainers; [ sikmir ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|