aboutsummaryrefslogtreecommitdiffstats
path: root/community/freeimage
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-08-20 13:03:34 -0300
committerLeo <thinkabit.ukim@gmail.com>2019-08-20 13:03:34 -0300
commitd582d29431a7ef01d65a0081961de190e2085141 (patch)
tree343726b9d8bccb223054fafb7e653b5a35b64967 /community/freeimage
parentc3b0700daa57a92a8fc54da4d7182b2d1cf9b6b1 (diff)
downloadaports-d582d29431a7ef01d65a0081961de190e2085141.tar.bz2
aports-d582d29431a7ef01d65a0081961de190e2085141.tar.xz
community/freeimage: move from testing
Diffstat (limited to 'community/freeimage')
-rw-r--r--community/freeimage/0001-no-root-install.patch16
-rw-r--r--community/freeimage/0002-fix-cpuid-x86.patch67
-rw-r--r--community/freeimage/0005-makefile-gnu.patch24
-rw-r--r--community/freeimage/APKBUILD42
4 files changed, 149 insertions, 0 deletions
diff --git a/community/freeimage/0001-no-root-install.patch b/community/freeimage/0001-no-root-install.patch
new file mode 100644
index 0000000000..d3b062d6e7
--- /dev/null
+++ b/community/freeimage/0001-no-root-install.patch
@@ -0,0 +1,16 @@
+diff -ruN a/Makefile.gnu b/Makefile.gnu
+--- a/Makefile.gnu 2015-04-09 16:34:02.315316841 +0200
++++ b/Makefile.gnu 2015-04-09 16:34:28.875483201 +0200
+@@ -71,9 +71,9 @@
+
+ install:
+ install -d $(INCDIR) $(INSTALLDIR)
+- install -m 644 -o root -g root $(HEADER) $(INCDIR)
+- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
++ install -m 644 $(HEADER) $(INCDIR)
++ install -m 644 $(STATICLIB) $(INSTALLDIR)
++ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
+ # ldconfig
diff --git a/community/freeimage/0002-fix-cpuid-x86.patch b/community/freeimage/0002-fix-cpuid-x86.patch
new file mode 100644
index 0000000000..98b0e9c6e3
--- /dev/null
+++ b/community/freeimage/0002-fix-cpuid-x86.patch
@@ -0,0 +1,67 @@
+Fix build issue caused by invalid register usage on x86
+
+Patch taken from https://github.com/openexr/openexr/issues/128.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp
+===================================================================
+--- a/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp
++++ b/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp
+@@ -40,21 +40,19 @@
+
+ namespace {
+ #if defined(IMF_HAVE_SSE2) && defined(__GNUC__)
+-
++#include <cpuid.h>
+ // Helper functions for gcc + SSE enabled
+- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
++ unsigned int &ecx, unsigned int &edx)
+ {
+- __asm__ __volatile__ (
+- "cpuid"
+- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
+- : /* Input */ "a"(n)
+- : /* Clobber */);
++ __get_cpuid(n, &eax, &ebx, &ecx, &edx);
+ }
+
+ #else // IMF_HAVE_SSE2 && __GNUC__
+
+ // Helper functions for generic compiler - all disabled
+- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
++ unsigned int &ecx, unsigned int &edx)
+ {
+ eax = ebx = ecx = edx = 0;
+ }
+@@ -64,7 +62,7 @@
+
+ #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
+
+- void xgetbv(int n, int &eax, int &edx)
++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
+ {
+ __asm__ __volatile__ (
+ "xgetbv"
+@@ -75,7 +73,7 @@
+
+ #else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
+
+- void xgetbv(int n, int &eax, int &edx)
++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
+ {
+ eax = edx = 0;
+ }
+@@ -94,8 +92,8 @@
+ f16c(false)
+ {
+ bool osxsave = false;
+- int max = 0;
+- int eax, ebx, ecx, edx;
++ unsigned int max = 0;
++ unsigned int eax, ebx, ecx, edx;
+
+ cpuid(0, max, ebx, ecx, edx);
+ if (max > 0)
diff --git a/community/freeimage/0005-makefile-gnu.patch b/community/freeimage/0005-makefile-gnu.patch
new file mode 100644
index 0000000000..f70a22aac8
--- /dev/null
+++ b/community/freeimage/0005-makefile-gnu.patch
@@ -0,0 +1,24 @@
+diff --git a/Makefile.gnu b/Makefile.gnu
+index 92f6358..293ee97 100644
+--- a/Makefile.gnu
++++ b/Makefile.gnu
+@@ -15,7 +15,8 @@ LIBRARIES = -lstdc++
+
+ MODULES = $(SRCS:.c=.o)
+ MODULES := $(MODULES:.cpp=.o)
+-CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
++CFLAGS ?= -O3
++CFLAGS += -fPIC -fexceptions -fvisibility=hidden
+ # OpenJPEG
+ CFLAGS += -DOPJ_STATIC
+ # LibRaw
+@@ -23,7 +24,8 @@ CFLAGS += -DNO_LCMS
+ # LibJXR
+ CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
+ CFLAGS += $(INCLUDE)
+-CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
++CXXFLAGS ?= -O3
++CXXFLAGS += -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
+ # LibJXR
+ CXXFLAGS += -D__ANSI__
+ CXXFLAGS += $(INCLUDE)
diff --git a/community/freeimage/APKBUILD b/community/freeimage/APKBUILD
new file mode 100644
index 0000000000..1115dae75b
--- /dev/null
+++ b/community/freeimage/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Taner Tas <taner76@gmail.com>
+# Maintainer: Taner Tas <taner76@gmail.com>
+pkgname=freeimage
+_pkgname="FreeImage"
+pkgver=3.18.0
+pkgrel=1
+pkgdesc="Open Source library project for developers who would like to support popular graphics image formats."
+url="http://freeimage.sourceforge.net/"
+arch="all"
+license="GPL-2.0-only FreeImage"
+makedepends="dos2unix"
+subpackages="$pkgname-dev"
+source="https://downloads.sourceforge.net/${pkgname}/${_pkgname}${pkgver//.}.zip
+ 0001-no-root-install.patch
+ 0002-fix-cpuid-x86.patch
+ 0005-makefile-gnu.patch"
+
+options="!check"
+
+prepare() {
+ mv ${srcdir}/${_pkgname} ${srcdir}/${pkgname}-${pkgver}
+ find "$builddir" -type f -exec dos2unix -q -s {} \;
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+ case "$CARCH" in
+ aarch64) export CFLAGS="$CFLAGS -DPNG_ARM_NEON_OPT=0";;
+ ppc64le) export CFLAGS="$CFLAGS -U__ALTIVEC__";;
+ esac
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="${pkgdir}" install
+}
+sha512sums="9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818 FreeImage3180.zip
+2dc51d700671962339cc1f27c0ad7e679e7ed6233d1534b81d68fcffb6e86960fa182b6916d19da7451bf34b69efe4a1b62b7f335b9802d7799706b766257d59 0001-no-root-install.patch
+ef88862593bd8d271d11f86ec389c8a92c131ffb03fb7028e87dfddc7ae74e22bef50327175a7dcee9c414df80e84579c59f3b8e1f825d54f0fdc76a0530c06f 0002-fix-cpuid-x86.patch
+18fba0dc68f94365ffbe7070594825b7e8f77f462ece31d96971de18f085b5110f3c3bdff780a02aa162ee9a64dd20c5fda7871d8759c8eeaa20d7bf3dddd72e 0005-makefile-gnu.patch"