summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD61
-rw-r--r--jasper.patch37
4 files changed, 126 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ca7b9494a721
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = android-aarch64-devil
+ pkgdesc = Library for reading several different image formats (Android aarch64)
+ pkgver = 1.8.0
+ pkgrel = 1
+ url = https://sourceforge.net/projects/openil/
+ arch = any
+ license = GPL
+ makedepends = android-cmake
+ depends = android-aarch64-libpng
+ depends = android-aarch64-jasper
+ depends = android-aarch64-lcms2
+ depends = android-aarch64-libjpeg-turbo
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ options = !emptydirs
+ source = https://downloads.sourceforge.net/openil/DevIL-1.8.0.tar.gz
+ source = jasper.patch
+ sha256sums = 0075973ee7dd89f0507873e2580ac78336452d29d34a07134b208f44e2feb709
+ sha256sums = a3e1009e70be5a159250e3ea30d39f5aef1fa23eacece79e72deda51d7200159
+
+pkgname = android-aarch64-devil
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b5b03b115225
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+pkg
+src
+*.tar.xz
+*.tar.gz
+*.tar.bz2
+*.asc
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..aa29bdb1f320
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
+# Contributor: Laurent Carlier <lordheavym@archlinux.org>
+# Contributor: damir <damir@archlinux.org>
+# Contributor: TheHoff <forums>
+
+_android_arch=aarch64
+
+pkgname=android-${_android_arch}-devil
+pkgver=1.8.0
+pkgrel=1
+arch=('any')
+pkgdesc="Library for reading several different image formats (Android ${_android_arch})"
+url="https://sourceforge.net/projects/openil/"
+license=('GPL')
+depends=("android-${_android_arch}-libpng"
+ "android-${_android_arch}-jasper"
+ "android-${_android_arch}-lcms2"
+ "android-${_android_arch}-libjpeg-turbo")
+makedepends=('android-cmake')
+options=(!strip !buildflags staticlibs !emptydirs)
+source=("https://downloads.sourceforge.net/openil/DevIL-$pkgver.tar.gz"
+ 'jasper.patch')
+sha256sums=('0075973ee7dd89f0507873e2580ac78336452d29d34a07134b208f44e2feb709'
+ 'a3e1009e70be5a159250e3ea30d39f5aef1fa23eacece79e72deda51d7200159')
+
+prepare() {
+ cd "${srcdir}/DevIL"
+
+ # https://github.com/DentonW/DevIL/commit/42a62648e727e9a0217280474546de3ac69cbff1
+ patch -Np1 -i ../jasper.patch
+
+ sed -i 's|register ||g' DevIL/src-IL/src/il_manip.cpp
+}
+
+build() {
+ cd "${srcdir}/DevIL/DevIL"
+ source android-env ${_android_arch}
+
+ android-${_android_arch}-cmake \
+ -S . \
+ -B build \
+ -DPNG_PNG_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}/libpng" \
+ -DPNG_LIBRARY="${ANDROID_PREFIX_LIB}/libpng.so" \
+ -DTIFF_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}" \
+ -DTIFF_LIBRARY="${ANDROID_PREFIX_LIB}/libtiff.so" \
+ -DJPEG_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}" \
+ -DJPEG_LIBRARY="${ANDROID_PREFIX_LIB}/libjpeg.so" \
+ -DJASPER_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}" \
+ -DJASPER_LIBRARIES="${ANDROID_PREFIX_LIB}/libjasper.so" \
+ -DLCMS2_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}" \
+ -DLCMS2_LIBRARY="${ANDROID_PREFIX_LIB}/liblcms2.so"
+ make -C build $MAKEFLAGS
+}
+
+package() {
+ cd "${srcdir}/DevIL/DevIL"
+ source android-env ${_android_arch}
+
+ make -C build DESTDIR="$pkgdir" install
+ ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so
+}
diff --git a/jasper.patch b/jasper.patch
new file mode 100644
index 000000000000..f1f048a8b250
--- /dev/null
+++ b/jasper.patch
@@ -0,0 +1,37 @@
+diff -Nru DevIL/DevIL/src-IL/src/il_jp2.cpp DevILb/DevIL/src-IL/src/il_jp2.cpp
+--- DevIL/DevIL/src-IL/src/il_jp2.cpp 2017-01-02 01:03:56.000000000 +0100
++++ DevILb/DevIL/src-IL/src/il_jp2.cpp 2022-05-13 09:10:05.934188618 +0200
+@@ -313,14 +313,32 @@
+ }
+
+
+-
++// Hack to compile against different versions of Jasper which expect
++// slightly different function types for their callbacks. The defined()
++// checks are just looking for sybols that happen to have arrived around
++// the same time as the API change, so no reason they won't break in the
++// future :-( Hopefully by the time it does nobody will care about pre-2.0.20
++// versions of jasper
++//
++// see: https://github.com/OSGeo/gdal/commit/9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334
++// https://github.com/DentonW/DevIL/issues/90
++#if defined(PRIjas_seqent)
++static ssize_t iJp2_file_read(jas_stream_obj_t *obj, char *buf, size_t cnt)
++#else
+ static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
++#endif
+ {
+ obj;
+ return iread(buf, 1, cnt);
+ }
+
++#if defined(JAS_INCLUDE_JP2_CODEC)
++static ssize_t iJp2_file_write(jas_stream_obj_t *obj, const char *buf, size_t cnt)
++#elif defined(PRIjas_seqent)
++static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, unsigned cnt)
++#else
+ static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
++#endif
+ {
+ obj;
+ return iwrite(buf, 1, cnt);