aboutsummaryrefslogtreecommitdiffstats
path: root/testing/proj/APKBUILD
blob: 988746a55ab1f4d284d96c7eb1df3ade454c4ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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"