Merge pull request #111182 from sikmir/mkgmap

mkgmap: 4565 → 4600
This commit is contained in:
Guillaume Girol 2021-01-30 18:13:17 +00:00 committed by GitHub
commit eae2b60b9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 59 deletions

View file

@ -1,6 +1,6 @@
{ lib, stdenv
, fetchurl
, fetchsvn
, substituteAll
, jdk
, jre
, ant
@ -9,34 +9,27 @@
, withExamples ? false
}:
let
version = "4565";
sha256 = "0cfh0msky5812l28mavy6p3k2zgyxb698xk79mvla9l45zcicnvw";
deps = import ./deps.nix { inherit fetchurl; };
testInputs = import ./testinputs.nix { inherit fetchurl; };
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "mkgmap";
inherit version;
version = "4600";
src = fetchsvn {
inherit sha256;
url = "https://svn.mkgmap.org.uk/mkgmap/mkgmap/trunk";
rev = version;
src = fetchurl {
url = "http://www.mkgmap.org.uk/download/mkgmap-r${version}-src.tar.gz";
sha256 = "1xnqbyrf5cbxmggkk1pjcj5d1767kbp15v12zy2fpbbn3yf0k3sh";
};
patches = [
# Disable automatic download of dependencies
./build.xml.patch
# Fix testJavaRules test
./fix-failing-test.patch
(substituteAll {
# Disable automatic download of dependencies
src = ./build.xml.patch;
inherit version;
})
];
postPatch = with deps; ''
substituteInPlace build.xml \
--subst-var-by version ${version}
mkdir -p lib/compile
cp ${fastutil} lib/compile/${fastutil.name}
cp ${osmpbf} lib/compile/${osmpbf.name}
@ -65,8 +58,8 @@ stdenv.mkDerivation {
checkPhase = "ant test";
installPhase = ''
install -Dm644 dist/mkgmap.jar $out/share/java/mkgmap/mkgmap.jar
install -Dm644 dist/doc/mkgmap.1 $out/share/man/man1/mkgmap.1
install -Dm644 dist/mkgmap.jar -t $out/share/java/mkgmap
install -Dm644 dist/doc/mkgmap.1 -t $out/share/man/man1
cp -r dist/lib/ $out/share/java/mkgmap/
makeWrapper ${jre}/bin/java $out/bin/mkgmap \
--add-flags "-jar $out/share/java/mkgmap/mkgmap.jar"
@ -75,9 +68,12 @@ stdenv.mkDerivation {
cp -r dist/examples $out/share/mkgmap/
'';
passthru.updateScript = [ ./update.sh "mkgmap" meta.downloadPage ];
meta = with lib; {
description = "Create maps for Garmin GPS devices from OpenStreetMap (OSM) data";
homepage = "http://www.mkgmap.org.uk";
downloadPage = "http://www.mkgmap.org.uk/download/mkgmap.html";
license = licenses.gpl2Only;
maintainers = with maintainers; [ sikmir ];
platforms = platforms.all;

View file

@ -1,22 +0,0 @@
--- a/test/uk/me/parabola/imgfmt/app/srt/SrtCollatorTest.java (revision 4555)
+++ a/test/uk/me/parabola/imgfmt/app/srt/SrtCollatorTest.java (working copy)
@@ -125,7 +125,7 @@
assertEquals("prim: different letter", -1, collator.compare("aaac", "aaad"));
assertEquals("prim: different letter", 1, collator.compare("aaae", "aaad"));
assertEquals(0, collator.compare("aaaa", "aaaa"));
- assertEquals(0, collator.compare("aáÄâ", "aaaa"));
+ //assertEquals(0, collator.compare("aáÄâ", "aaaa"));
collator.setStrength(Collator.SECONDARY);
assertEquals(0, collator.compare("AabBb", "aabbb"));
@@ -132,8 +132,8 @@
assertEquals(0, collator.compare("aabBb", "aabBb"));
assertEquals(0, collator.compare("aabbB", "aabBb"));
assertEquals(1, collator.compare("aáÄâ", "aaaa"));
- assertEquals("prim len diff", -1, collator.compare("aáÄâ", "aaaaa"));
- assertEquals(-1, collator.compare("aáÄâa", "aaaab"));
+ //assertEquals("prim len diff", -1, collator.compare("aáÄâ", "aaaaa"));
+ //assertEquals(-1, collator.compare("aáÄâa", "aaaab"));
collator.setStrength(Collator.TERTIARY);
assertEquals("prim: different case", 1, collator.compare("AabBb", "aabbb"));

View file

@ -1,6 +1,6 @@
{ lib, stdenv
, fetchurl
, fetchsvn
, substituteAll
, jdk
, jre
, ant
@ -8,34 +8,30 @@
, doCheck ? true
}:
let
version = "597";
sha256 = "1al3160amw0gdarrc707dsppm0kcai9mpkfak7ffspwzw9alsndx";
deps = import ../deps.nix { inherit fetchurl; };
testInputs = import ./testinputs.nix { inherit fetchurl; };
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "splitter";
inherit version;
version = "597";
src = fetchsvn {
inherit sha256;
url = "https://svn.mkgmap.org.uk/mkgmap/splitter/trunk";
rev = version;
src = fetchurl {
url = "http://www.mkgmap.org.uk/download/splitter-r${version}-src.tar.gz";
sha256 = "0d928wvlpzqwdpfksmxyyfkqrhjsij21wx2538bs2i29siwyla61";
};
patches = [
# Disable automatic download of dependencies
./build.xml.patch
(substituteAll {
# Disable automatic download of dependencies
src = ./build.xml.patch;
inherit version;
})
# Fix func.SolverAndProblemGeneratorTest test
./fix-failing-test.patch
];
postPatch = with deps; ''
substituteInPlace build.xml \
--subst-var-by version ${version}
mkdir -p lib/compile
cp ${fastutil} lib/compile/${fastutil.name}
cp ${osmpbf} lib/compile/${osmpbf.name}
@ -61,16 +57,19 @@ stdenv.mkDerivation {
checkPhase = "ant run.tests && ant run.func-tests";
installPhase = ''
install -Dm644 dist/splitter.jar $out/share/java/splitter/splitter.jar
install -Dm644 doc/splitter.1 $out/share/man/man1/splitter.1
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 = "http://www.mkgmap.org.uk";
downloadPage = "http://www.mkgmap.org.uk/download/splitter.html";
license = licenses.gpl2Only;
maintainers = with maintainers; [ sikmir ];
platforms = platforms.all;

View file

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts
set -euo pipefail
version=$(curl -s $2 | sed -n 's#.*<span data-bind="text: current().version">\(.*\)</span>.*#\1#p')
update-source-version $1 "$version"