diff options
-rw-r--r-- | community/gdal/10-atoll.patch | 34 | ||||
-rw-r--r-- | community/gdal/20-userfaultfd-detection.patch | 29 | ||||
-rw-r--r-- | community/gdal/APKBUILD | 110 |
3 files changed, 152 insertions, 21 deletions
diff --git a/community/gdal/10-atoll.patch b/community/gdal/10-atoll.patch new file mode 100644 index 0000000000..bbc501ed85 --- /dev/null +++ b/community/gdal/10-atoll.patch @@ -0,0 +1,34 @@ +Author: Holger Jaekel <holger.jaekel@gmx.de> +Summary: musl atoll() doesn't return ERANGE in case of overflow +---- + +--- a/gdal/port/cpl_conv.cpp ++++ b/gdal/port/cpl_conv.cpp +@@ -1006,8 +1006,6 @@ GIntBig CPLAtoGIntBig( const char *pszSt + #endif + } + +-#if defined(__MINGW32__) || defined(__sun__) +- + // mingw atoll() doesn't return ERANGE in case of overflow + static int CPLAtoGIntBigExHasOverflow(const char* pszString, GIntBig nVal) + { +@@ -1030,8 +1028,6 @@ static int CPLAtoGIntBigExHasOverflow(co + return strcmp(szBuffer, pszString) != 0; + } + +-#endif +- + /************************************************************************/ + /* CPLAtoGIntBigEx() */ + /************************************************************************/ +@@ -1058,9 +1054,7 @@ GIntBig CPLAtoGIntBigEx( const char* psz + GIntBig nVal = atol(pszString); + #endif + if( errno == ERANGE +-#if defined(__MINGW32__) || defined(__sun__) + || CPLAtoGIntBigExHasOverflow(pszString, nVal) +-#endif + ) + { + if( pbOverflow ) diff --git a/community/gdal/20-userfaultfd-detection.patch b/community/gdal/20-userfaultfd-detection.patch new file mode 100644 index 0000000000..2e7340956b --- /dev/null +++ b/community/gdal/20-userfaultfd-detection.patch @@ -0,0 +1,29 @@ +Author: Holger Jaekel <holger.jaekel@gmx.de> +Summary: userfaultfd is disabled in musl +---- + +--- a/gdal/configure ++++ b/gdal/configure +@@ -20756,21 +20756,7 @@ fi + done + + +-for ac_header in linux/userfaultfd.h +-do : +- ac_fn_c_check_header_mongrel "$LINENO" "linux/userfaultfd.h" "ac_cv_header_linux_userfaultfd_h" "$ac_includes_default" +-if test "x$ac_cv_header_linux_userfaultfd_h" = xyes; then : +- cat >>confdefs.h <<_ACEOF +-#define HAVE_LINUX_USERFAULTFD_H 1 +-_ACEOF +- ENABLE_UFFD="yes" +-else +- ENABLE_UFFD="no" +-fi +- +-done +- +-ENABLE_UFFD=$ENABLE_UFFD ++ENABLE_UFFD="no" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 diff --git a/community/gdal/APKBUILD b/community/gdal/APKBUILD index 950230fa3e..3d0bdce128 100644 --- a/community/gdal/APKBUILD +++ b/community/gdal/APKBUILD @@ -1,67 +1,132 @@ # Contributor: Trevor R.H. Clarke <trevor@notcows.com> # Maintainer: Trevor R.H. Clarke <trevor@notcows.com> pkgname=gdal -pkgver=2.4.2 -pkgrel=1 +pkgver=3.0.2 +pkgrel=0 pkgdesc="A translator library for raster and vector geospatial data formats" -url="https://gdal.org" -arch="all !s390x" +url="https://gdal.org/" +arch="all !s390x !x86" # geos is not available on s390x; proj is not available on x86 license="MIT" depends_dev="gdal" makedepends=" + apache-ant + chrpath curl-dev + expat-dev geos-dev giflib-dev - jpeg-dev - libjpeg-turbo-dev + json-c-dev libpng-dev + libwebp-dev + libxml2-dev linux-headers + mariadb-dev + openjdk8 + openjpeg-dev + poppler-dev postgresql-dev + proj-dev + py3-numpy + py3-numpy-dev python3-dev sqlite-dev swig tiff-dev + unixodbc-dev zlib-dev - expat-dev + zstd-dev + " +checkdepends=" + pytest + python3-dev " subpackages=" $pkgname-dev - py3-$pkgname:py3 + py3-$pkgname:_py3 + java-$pkgname:_java + $pkgname-tools " -source="http://download.osgeo.org/gdal/$pkgver/gdal-$pkgver.tar.xz" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/OSGeo/$pkgname/archive/v$pkgver.tar.gz + 10-atoll.patch + 20-userfaultfd-detection.patch + " build() { - ./configure --prefix=/usr \ - --with-curl=/usr/bin/curl-config + cd "$builddir"/gdal + + ./configure \ + CPPFLAGS=-I/usr/include/tirpc \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --with-cpp14 \ + --with-poppler \ + --with-mysql \ + --with-java=/usr/lib/jvm/java-1.8-openjdk/ make - cd swig/python + cd "$builddir/gdal/swig/python" python3 setup.py build + + cd "$builddir/gdal/swig/java" + make } package() { + cd "$builddir"/gdal + make DESTDIR="$pkgdir" install chmod -x "$pkgdir"/usr/include/*.h -} -py3() { - pkgdesc="$pkgname (python3 bindings)" + cd "$pkgdir/usr/bin" + mv gdal-config .. + rm -rf "${pkgdir:?}/usr/bin/*" + mv ../gdal-config . +} - replaces="py-$pkgname" # Backwards compatibility - provides="py-$pkgname=$pkgver-r$pkgrel" # Backwards compatibility +_py3() { + pkgdesc="$pkgdesc (Python3 bindings)" - cd "$builddir"/swig/python + mkdir -p "$subpkgdir"/usr/lib/ + cd "$builddir"/gdal/swig/python python3 setup.py install --prefix=/usr --root="$subpkgdir" + rm -rf "${subpkgdir:?}/usr/bin" +} + +_java() { + pkgdesc="$pkgdesc (Java bindings)" + cd "$builddir"/gdal/swig/java + make + + mkdir -p "$subpkgdir/usr/lib" "$subpkgdir/usr/share/java/" + chrpath -d .libs/*.so* + mv .libs/*.so* "$subpkgdir/usr/lib" + cp gdal.jar "$subpkgdir/usr/share/java/gdal-$pkgver.jar" + cd "$subpkgdir/usr/share/java/" + ln -s gdal-$pkgver.jar gdal.jar +} + +tools() { + pkgdesc="$pkgdesc (command line utilities)" + depends="py3-$pkgname" + cd "$builddir"/gdal/swig/python chmod a+x scripts/* - install -d "$subpkgdir"/usr/bin - install -m755 scripts/*.py "$subpkgdir"/usr/bin/ + + install -d "$subpkgdir/usr/bin" + install -m755 scripts/*.py "$subpkgdir/usr/bin/" + + cd "$builddir"/gdal + make DESTDIR="$subpkgdir" install + rm -rf "${subpkgdir:?}/usr/include" "${subpkgdir:?}/usr/lib" "${subpkgdir:?}/usr/share" "${subpkgdir:?}/usr/bin/gdal-config" } check() { # TODO: https://trac.osgeo.org/gdal/wiki/TestingNotes + cd "$builddir"/gdal apps/gdal-config --version | grep "$pkgver" # confirms MBTiles support @@ -69,5 +134,8 @@ check() { # confirms PostgreSQL/PostGIS support apps/ogr2ogr --formats | grep "PostgreSQL -vector- (rw+): PostgreSQL/PostGIS" + } -sha512sums="70abcbd7aa5878ff51efb830cef53cb0ee9a4ce88d11b34563da3af9143dd0d46e4e1461164aa9277bb0f578a3b2bc9bfd7650905f0f184f2c4f146df72f6b4e gdal-2.4.2.tar.xz" +sha512sums="0effcfe2238cd65edd02b642ebc14f0233207297cbd226d90ebbfad8801e423f93a7eb892e7467c527a0a2ca163850696971565f38bb0c601d66aea65b0f1731 gdal-3.0.2.tar.gz +14d080b80a5e499840e7b356acd0a7f6afaec6c65a10d9df864011d89e93310bd3dac22e59ca7c0cd93e6fd2277f85a71920a91ed5afdb352c18e953b2b4783b 10-atoll.patch +4741d6f9f2aaaa80c1ad590073d0b960d4389b8908682de224b476136cc5dd898375ca67498568fac4537a2c23f00e42998618a4a9121ac6d9f82dd61eda15d8 20-userfaultfd-detection.patch" |