summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/libpng/APKBUILD60
-rw-r--r--user/libpng/libpng-fix-arm-neon.patch35
2 files changed, 95 insertions, 0 deletions
diff --git a/user/libpng/APKBUILD b/user/libpng/APKBUILD
new file mode 100644
index 000000000..1ca9f0ec1
--- /dev/null
+++ b/user/libpng/APKBUILD
@@ -0,0 +1,60 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=libpng
+pkgver=1.6.34
+pkgrel=2
+pkgdesc="Portable Network Graphics library"
+url="http://www.libpng.org/"
+arch="all"
+license="Libpng"
+depends=""
+depends_dev=""
+makedepends="autoconf automake libtool zlib-dev"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-utils"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
+ http://downloads.sourceforge.net/sourceforge/$pkgname-apng/$pkgname-$pkgver-apng.patch.gz
+ libpng-fix-arm-neon.patch
+ "
+
+prepare() {
+ cd "$builddir"
+ gunzip -c "$srcdir"/$pkgname-$pkgver-apng.patch.gz | patch -p1
+ default_prepare
+ # libpng-fix-arm-neon.patch modifies configure.ac
+ autoreconf -vif
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -Dm644 LICENSE \
+ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+ rm -f "$pkgdir"/usr/lib/*.la
+}
+
+utils() {
+ pkgdesc="$pkgdesc (pngfix utils)"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr
+}
+
+sha512sums="7ee14f3fcf68802b56ac006ae0188735f25adb0402422dc97f560e6d00ba0adac50b1014dbab83457cd33b360901771c962e6b7c0c6e3948cda13eb1188de825 libpng-1.6.34.tar.gz
+0777b8e55aeee207ee92479f2258ef1f60f16d7951fdbc6d89a80ef533b86dadecd1ef659d6fe7602d8ea3a8e711a096b0f77ee09b993799b73dfffddfe5dd3c libpng-1.6.34-apng.patch.gz
+e3fae918f14bc34e7c126892f69527c6e1b4d72593835ece839d9a28cff55a886b2030f877cf9e29b2c97abf2e47bbb5ba54584828edd2a841c2556f330b9c7e libpng-fix-arm-neon.patch"
diff --git a/user/libpng/libpng-fix-arm-neon.patch b/user/libpng/libpng-fix-arm-neon.patch
new file mode 100644
index 000000000..2cd3f18c2
--- /dev/null
+++ b/user/libpng/libpng-fix-arm-neon.patch
@@ -0,0 +1,35 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -364,17 +364,21 @@
+ [case "$enableval" in
+ no|off)
+ # disable the default enabling on __ARM_NEON__ systems:
++ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
+ AC_DEFINE([PNG_ARM_NEON_OPT], [0],
+ [Disable ARM Neon optimizations])
+ # Prevent inclusion of the assembler files below:
+ enable_arm_neon=no;;
+ check)
++ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
+ AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
+ [Check for ARM Neon support at run-time]);;
+ api)
++ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
+ AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
+ [Turn on ARM Neon optimizations at run-time]);;
+ yes|on)
++ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
+ AC_DEFINE([PNG_ARM_NEON_OPT], [2],
+ [Enable ARM Neon optimizations])
+ AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if]
+--- a/pngpriv.h
++++ b/pngpriv.h
+@@ -127,7 +127,7 @@
+ * associated assembler code, pass --enable-arm-neon=no to configure
+ * or put -DPNG_ARM_NEON_OPT=0 in CPPFLAGS.
+ */
+-# if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
++# if defined(PNG_ARM_NEON) && (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
+ defined(PNG_ALIGNED_MEMORY_SUPPORTED)
+ # define PNG_ARM_NEON_OPT 2
+ # else