nixpkgs/pkgs/applications/misc/mkgmap/splitter/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
2.2 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-07-07 23:13:53 +00:00
, fetchurl
2022-05-20 23:37:37 +00:00
, fetchsvn
2021-01-29 17:22:25 +00:00
, substituteAll
2020-07-07 23:13:53 +00:00
, jdk
, jre
, ant
, makeWrapper
, doCheck ? true
}:
let
deps = import ../deps.nix { inherit fetchurl; };
testInputs = import ./testinputs.nix { inherit fetchurl; };
in
2021-01-29 17:22:25 +00:00
stdenv.mkDerivation rec {
2020-07-07 23:13:53 +00:00
pname = "splitter";
2022-05-20 23:37:37 +00:00
version = "651";
2020-07-07 23:13:53 +00:00
2022-05-20 23:37:37 +00:00
src = fetchsvn {
url = "https://svn.mkgmap.org.uk/mkgmap/splitter/trunk";
rev = version;
sha256 = "sha256-j6U+Wvxef151NEwkpuv4VdMac/cOT9YZUgkt+YPGCuk=";
2020-07-07 23:13:53 +00:00
};
patches = [
2021-01-29 17:22:25 +00:00
(substituteAll {
# Disable automatic download of dependencies
src = ./build.xml.patch;
inherit version;
})
2020-07-07 23:13:53 +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 05:42:41 +00:00
'' + lib.optionalString doCheck ''
2020-07-07 23:13:53 +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 05:42:41 +00:00
${lib.concatMapStringsSep "\n" (res: ''
2020-07-07 23:13:53 +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-01-29 17:22:25 +00:00
install -Dm644 dist/splitter.jar -t $out/share/java/splitter
install -Dm644 doc/splitter.1 -t $out/share/man/man1
2020-07-07 23:13:53 +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-01-29 17:22:25 +00:00
passthru.updateScript = [ ../update.sh "mkgmap-splitter" meta.downloadPage ];
meta = with lib; {
2020-07-07 23:13:53 +00:00
description = "Utility for splitting OpenStreetMap maps into tiles";
2021-12-31 18:50:04 +00:00
homepage = "https://www.mkgmap.org.uk/";
downloadPage = "https://www.mkgmap.org.uk/download/splitter.html";
sourceProvenance = with sourceTypes; [
fromSource
binaryBytecode # deps
];
2020-07-07 23:13:53 +00:00
license = licenses.gpl2Only;
maintainers = with maintainers; [ sikmir ];
platforms = platforms.all;
};
}