about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/mkgmap
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-08-31 11:57:05 +0000
committerAlyssa Ross <hi@alyssa.is>2019-09-16 22:04:28 +0000
commita0842e8b20cbe1ed717b72775428d1f8fc047fa4 (patch)
treeb86d0614a477f7e092d626d59b888d085aaca400 /nixpkgs/pkgs/applications/misc/mkgmap
parentc36b32d476b520ed0d2a37cd0973f98583d6dc7c (diff)
parent8d1510abfb592339e13ce8f6db6f29c1f8b72924 (diff)
downloadnixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.gz
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.bz2
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.lz
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.xz
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.zst
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.zip
Merge commit '8d1510abfb592339e13ce8f6db6f29c1f8b72924'
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/mkgmap')
-rw-r--r--nixpkgs/pkgs/applications/misc/mkgmap/build.xml.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/mkgmap/default.nix57
2 files changed, 68 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/mkgmap/build.xml.patch b/nixpkgs/pkgs/applications/misc/mkgmap/build.xml.patch
new file mode 100644
index 000000000000..6ec40786b249
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mkgmap/build.xml.patch
@@ -0,0 +1,11 @@
+--- a/build.xml	2019-08-26 23:22:55.104829846 +0300
++++ b/build.xml	2019-08-27 00:11:07.366257594 +0300
+@@ -227,7 +227,7 @@
+ 	</target>
+ 
+ 	<!-- Compile the product itself (no tests). -->
+-	<target name="compile" depends="prepare, resolve-compile"
++	<target name="compile" depends="prepare"
+ 					description="main compilation">
+ 
+ 		<javac srcdir="${src}" destdir="${build.classes}" encoding="utf-8" debug="true" includeantruntime="false">
diff --git a/nixpkgs/pkgs/applications/misc/mkgmap/default.nix b/nixpkgs/pkgs/applications/misc/mkgmap/default.nix
new file mode 100644
index 000000000000..debcea78f555
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mkgmap/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl, fetchsvn, jdk, jre, ant, makeWrapper }:
+
+let
+  fastutil = fetchurl {
+    url = "http://ivy.mkgmap.org.uk/repo/it.unimi.dsi/fastutil/6.5.15-mkg.1b/jars/fastutil.jar";
+    sha256 = "0d88m0rpi69wgxhnj5zh924q4zsvxq8m4ybk7m9mr3gz1hx0yx8c";
+  };
+  osmpbf = fetchurl {
+    url = "http://ivy.mkgmap.org.uk/repo/crosby/osmpbf/1.3.3/jars/osmpbf.jar";
+    sha256 = "0zb4pqkwly5z30ww66qhhasdhdrzwmrw00347yrbgyk2ii4wjad3";
+  };
+  protobuf = fetchurl {
+    url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar";
+    sha256 = "0x6c4pbsizvk3lm6nxcgi1g2iqgrxcna1ip74lbn01f0fm2wdhg0";
+  };
+in
+
+stdenv.mkDerivation rec {
+  pname = "mkgmap";
+  version = "4289";
+
+  src = fetchsvn {
+    url = "https://svn.mkgmap.org.uk/mkgmap/mkgmap/trunk";
+    rev = version;
+    sha256 = "1sm1pw71q7z0jrxm8bcgm6xjl2mcidyibcf0a3m8fv2andidxrb4";
+  };
+
+  # This patch removes from the build process
+  # the automatic download of dependencies (see configurePhase)
+  patches = [ ./build.xml.patch ];
+
+  nativeBuildInputs = [ jdk ant makeWrapper ];
+
+  configurePhase = ''
+    mkdir -p lib/compile
+    cp ${fastutil} ${osmpbf} ${protobuf} lib/compile/
+  '';
+
+  buildPhase = "ant";
+
+  installPhase = ''
+    cd dist
+    install -Dm644 mkgmap.jar $out/share/java/mkgmap/mkgmap.jar
+    install -Dm644 doc/mkgmap.1 $out/share/man/man1/mkgmap.1
+    cp -r lib/ $out/share/java/mkgmap/
+    makeWrapper ${jre}/bin/java $out/bin/mkgmap \
+      --add-flags "-jar $out/share/java/mkgmap/mkgmap.jar"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Create maps for Garmin GPS devices from OpenStreetMap (OSM) data";
+    homepage = "http://www.mkgmap.org.uk";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ sikmir ];
+    platforms = platforms.all;
+  };
+}