aboutsummaryrefslogtreecommitdiffstats
path: root/testing/proj
diff options
context:
space:
mode:
authorHolger Jaekel <holger.jaekel@gmx.de>2019-06-16 14:04:47 +0200
committerLeo <thinkabit.ukim@gmail.com>2019-06-18 10:02:38 -0300
commit809f32f81f14456ac3dcced8de78dbd8fad20b6a (patch)
tree0dbb232de370cbb46afca2084f1d3a1068985298 /testing/proj
parentcf21fb6ee118ddaeda9e8b7c9c22338f053edbef (diff)
downloadaports-809f32f81f14456ac3dcced8de78dbd8fad20b6a.tar.bz2
aports-809f32f81f14456ac3dcced8de78dbd8fad20b6a.tar.xz
testing/proj4: rename proj4 to proj
Diffstat (limited to 'testing/proj')
-rw-r--r--testing/proj/10-test-tolerance.patch14
-rw-r--r--testing/proj/APKBUILD109
-rw-r--r--testing/proj/TestJni.java20
3 files changed, 143 insertions, 0 deletions
diff --git a/testing/proj/10-test-tolerance.patch b/testing/proj/10-test-tolerance.patch
new file mode 100644
index 0000000000..645f8a4ecb
--- /dev/null
+++ b/testing/proj/10-test-tolerance.patch
@@ -0,0 +1,14 @@
+Author: Holger Jaekel <holger.jaekel@gmx.de>
+Summary: Adapt test tolerance for build on aarch64
+----
+
+--- a/test/gie/builtins.gie
++++ b/test/gie/builtins.gie
+@@ -5632,7 +5632,7 @@ van der Grinten (I)
+ -------------------------------------------------------------------------------
+ operation +proj=vandg +a=6400000 +lat_1=0.5 +lat_2=2
+ -------------------------------------------------------------------------------
+-tolerance 0.15 mm
++tolerance 0.25 mm
+ accept 2 1
+ expect 223395.249543407 111704.596633675
diff --git a/testing/proj/APKBUILD b/testing/proj/APKBUILD
new file mode 100644
index 0000000000..988746a55a
--- /dev/null
+++ b/testing/proj/APKBUILD
@@ -0,0 +1,109 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=proj
+pkgver=6.1.0
+pkgrel=4
+_datumgridver=1.8
+_jdkver=11
+pkgdesc="PROJ coordinate transformation software library"
+url="https://proj.org/"
+arch="s390x aarch64 x86_64 ppc64le"
+license="MIT"
+makedepends="
+ apache-ant
+ openjdk${_jdkver}-jdk
+ sqlite
+ sqlite-dev
+ "
+subpackages="
+ $pkgname-doc
+ $pkgname-static
+ $pkgname-util:util
+ java-$pkgname:java:noarch
+ $pkgname-datumgrid:datumgrid:noarch
+ $pkgname-dev
+ "
+source="
+ http://download.osgeo.org/proj/proj-$pkgver.tar.gz
+ http://download.osgeo.org/proj/proj-datumgrid-$_datumgridver.zip
+ 10-test-tolerance.patch
+ TestJni.java
+ "
+
+builddir="$srcdir/proj-$pkgver"
+
+prepare() {
+ default_prepare
+ unzip -o "$srcdir/proj-datumgrid-$_datumgridver.zip" -d data/
+}
+
+build () {
+ ./configure \
+ CPPFLAGS=-I/usr/lib/jvm/java-${_jdkver}-openjdk/include/linux \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --with-jni=/usr/lib/jvm/java-${_jdkver}-openjdk/include
+ make
+
+ cd "$builddir/jniwrap"
+ ant compile javadoc
+}
+
+package() {
+ depends="$pkgname-datumgrid"
+ replaces="proj4"
+
+ make DESTDIR="$pkgdir" install
+
+ mkdir -p "$pkgdir/usr/share/doc/$pkgname/javadoc"
+ cp -R jniwrap/out/apidocs/* "$pkgdir/usr/share/doc/$pkgname/javadoc"
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
+}
+
+datumgrid() {
+ pkgdesc="Cartographic projection filter and library (datum package)"
+
+ mkdir -p "$subpkgdir/usr/share/proj"
+ mv "$pkgdir/usr/share/proj" "$subpkgdir/usr/share"
+}
+
+java() {
+ pkgdesc="Cartographic projection library (JNI bindings)"
+ depends="so:libproj.so.15"
+
+ cd "$builddir/jniwrap"
+ mkdir -p "$subpkgdir/usr/share/java/"
+ local _javabindingsver=`grep "name=\"version\"" build.xml | cut -d'"' -f 4`
+ mv out/proj.jar "$subpkgdir/usr/share/java/proj-${_javabindingsver}.jar"
+ ln -s "proj-${_javabindingsver}.jar" "$subpkgdir/usr/share/java/proj.jar"
+
+ local _libfilepath=`ls $pkgdir/usr/lib/libproj.so.??`
+ local _libfilename=`basename $_libfilepath`
+ mkdir -p "$subpkgdir/usr/java/packages/lib/"
+ ln -s "/usr/lib/$_libfilename" "$subpkgdir/usr/java/packages/lib/libproj.so"
+}
+
+util() {
+ pkgdesc="Cartographic projection library (utilities)"
+
+ mkdir -p "$subpkgdir/usr/bin"
+ mv "$pkgdir/usr/bin" "$subpkgdir/usr"
+}
+
+check() {
+ make -j1 check
+
+ # Test JNI bindings
+ cp $srcdir/TestJni.java TestJni.java
+ /usr/lib/jvm/default-jvm/bin/javac -cp "$builddir/jniwrap/out/proj.jar" TestJni.java
+ PROJ_LIB="$builddir"/data /usr/lib/jvm/java-${_jdkver}-openjdk/bin/java \
+ -Djava.library.path="$builddir/src/.libs/" \
+ -cp "$builddir/jniwrap/out/proj.jar":. \
+ TestJni | \
+ grep "\[9.0, 0.0, 8.101251062924646, 0.904618578893133, 9.898748937075354, -0.904618578893133\]"
+}
+
+sha512sums="7e7af901031801aa799df5dd2c863f31f0fb98eef7cc6883257bc4778b2df1b8eeee30f8ffca2f882261655ebfb04d46804dd87192bb47a58e9a253d4c461c69 proj-6.1.0.tar.gz
+991206f17348b3de484eb5364d773cd06577057228c2d1a0a1c1658308e2596ca13338a666fa71ddd76d538f23dd5bf21e178fd26a785717edd847a17e5c0cd1 proj-datumgrid-1.8.zip
+d26e7e4c87e322682fad2bb6e4dec09f610dfc9f9d82b3c96fe379167fef47ad67449701c32efc6cd44f66621354585a436130148df3fbbbf085adda1371bf7a 10-test-tolerance.patch
+36fe2482f89c6ca38883db99b7f1bf5c650a499c678f799f6b10040e3c90873f6c8bfae08f80eaca99b8957a5361b6966f1925184b4050885af1808e05d063e9 TestJni.java"
diff --git a/testing/proj/TestJni.java b/testing/proj/TestJni.java
new file mode 100644
index 0000000000..6a517849f6
--- /dev/null
+++ b/testing/proj/TestJni.java
@@ -0,0 +1,20 @@
+import org.proj4.*;
+import java.util.Arrays;
+
+/**
+ * Converts coordinates from EPSG:32632 (WGS 84 / UTM zone 32N) to WGS84,
+ * then prints the result to the standard output stream.
+ */
+public class TestJni {
+ public static void main(String[] args) throws PJException {
+ PJ sourcePJ = new PJ("+init=epsg:32632"); // (x,y) axis order
+ PJ targetPJ = new PJ("+proj=latlong +datum=WGS84"); // (λ,φ) axis order
+ double[] coordinates = {
+ 500000, 0, // First coordinate
+ 400000, 100000, // Second coordinate
+ 600000, -100000 // Third coordinate
+ };
+ sourcePJ.transform(targetPJ, 2, coordinates, 0, 3);
+ System.out.println(Arrays.toString(coordinates));
+ }
+}