diff options
author | xantares | 2015-08-18 21:25:26 +0200 |
---|---|---|
committer | xantares | 2015-08-18 21:25:26 +0200 |
commit | ebf5d67d1be9efa3cb9f2914cf4897432c8d0c23 (patch) | |
tree | dea37f2964c9878c875171311704afdec28472ef | |
parent | 82bbf1b82a329d7d0a2fc29f65405682a1ec9c19 (diff) | |
download | aur-ebf5d67d1be9efa3cb9f2914cf4897432c8d0c23.tar.gz |
fix gcc5 build
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 54 | ||||
-rw-r--r-- | gcc5.patch | 70 |
3 files changed, 99 insertions, 27 deletions
@@ -12,7 +12,9 @@ pkgbase = mingw-w64-freeimage options = !buildflags options = staticlibs source = http://downloads.sourceforge.net/sourceforge/freeimage/FreeImage3170.zip + source = gcc5.patch md5sums = 459e15f0ec75d6efa3c7bd63277ead86 + md5sums = ea0a75f431a09ce8fbd539bb9a969679 pkgname = mingw-w64-freeimage @@ -14,17 +14,20 @@ url="http://freeimage.sourceforge.net/" depends=(mingw-w64-crt) makedepends=(mingw-w64-gcc) options=(!strip !buildflags staticlibs) -source=("http://downloads.sourceforge.net/sourceforge/freeimage/FreeImage${pkgver//./}.zip") -md5sums=('459e15f0ec75d6efa3c7bd63277ead86') +source=("http://downloads.sourceforge.net/sourceforge/freeimage/FreeImage${pkgver//./}.zip" + gcc5.patch) +md5sums=('459e15f0ec75d6efa3c7bd63277ead86' + 'ea0a75f431a09ce8fbd539bb9a969679') _architectures="i686-w64-mingw32 x86_64-w64-mingw32" prepare() { - cd FreeImage + cd FreeImage sed -i "s|IMPORTLIB = \$(TARGET).lib|IMPORTLIB = \$(TARGET).dll.a|g" Makefile.mingw sed -i 's/#include "..\\x86\\x86.h"/#include "..\/x86\/x86.h"/' Source/LibJXR/image/sys/strcodec.h rm Source/LibJXR/common/include/guiddef.h sed -i "s,WIN32_CFLAGS =,WIN32_CFLAGS = -fpermissive -D__MINGW64_TOOLCHAIN__," Makefile.mingw sed -i -e "s,#ifdef __GNUC__,#ifdef WHATEVER," -e "s,_MSC_VER,WINVER," Source/OpenEXR/IlmImf/ImfSystemSpecific.h + patch -p1 -i ../gcc5.patch } build() { @@ -32,25 +35,24 @@ build() { rm -rf FreeImage-${_arch} cp -r FreeImage FreeImage-${_arch} pushd FreeImage-${_arch} - - make \ - CC=${_arch}-gcc \ - CXX=${_arch}-g++ \ - LD=${_arch}-g++ \ - RC=${_arch}-windres \ - AR=${_arch}-ar \ - DLLTOOL=${_arch}-dlltool \ - FREEIMAGE_LIBRARY_TYPE="STATIC" \ - -f Makefile.mingw - make \ - CC=${_arch}-gcc \ - CXX=${_arch}-g++ \ - LD=${_arch}-g++ \ - RC=${_arch}-windres \ - AR=${_arch}-ar \ - DLLTOOL=${_arch}-dlltool \ - FREEIMAGE_LIBRARY_TYPE="SHARED" \ - -f Makefile.mingw + make \ + CC=${_arch}-gcc \ + CXX=${_arch}-g++ \ + LD=${_arch}-g++ \ + RC=${_arch}-windres \ + AR=${_arch}-ar \ + DLLTOOL=${_arch}-dlltool \ + FREEIMAGE_LIBRARY_TYPE="STATIC" \ + -f Makefile.mingw + make \ + CC=${_arch}-gcc \ + CXX=${_arch}-g++ \ + LD=${_arch}-g++ \ + RC=${_arch}-windres \ + AR=${_arch}-ar \ + DLLTOOL=${_arch}-dlltool \ + FREEIMAGE_LIBRARY_TYPE="SHARED" \ + -f Makefile.mingw popd done @@ -59,14 +61,12 @@ build() { package() { for _arch in ${_architectures}; do cd ${srcdir}/FreeImage-${_arch} - install -d "${pkgdir}"/usr/${_arch}/lib - install -d "${pkgdir}"/usr/${_arch}/bin - install -d "${pkgdir}"/usr/${_arch}/include + install -d "${pkgdir}"/usr/${_arch}/{lib,bin,include} install -m755 Dist/FreeImage.dll "${pkgdir}"/usr/${_arch}/bin/ install -m644 Dist/FreeImage.dll.a "${pkgdir}"/usr/${_arch}/lib/libFreeImage.dll.a install -m644 Dist/libFreeImage.a "${pkgdir}"/usr/${_arch}/lib/ install -m644 Dist/FreeImage.h "${pkgdir}"/usr/${_arch}/include/ - find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \; - find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g + ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll + ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a done } diff --git a/gcc5.patch b/gcc5.patch new file mode 100644 index 000000000000..d066a0253d9f --- /dev/null +++ b/gcc5.patch @@ -0,0 +1,70 @@ +diff -Naur FreeImage.orig/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +--- FreeImage.orig/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c 2015-06-28 16:49:39.320546812 +0200 ++++ FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c 2015-06-28 16:50:14.189740757 +0200 +@@ -21,33 +21,6 @@ +
+ #if !defined(WEBP_YUV_USE_TABLE)
+
+-#define YUV_TO_RGB(Y, U, V, R, G, B) do { \
+- const int t1 = kYScale * Y; \
+- const int t2 = kVToG * V; \
+- R = kVToR * V; \
+- G = kUToG * U; \
+- B = kUToB * U; \
+- R = t1 + R; \
+- G = t1 - G; \
+- B = t1 + B; \
+- R = R + kRCst; \
+- G = G - t2 + kGCst; \
+- B = B + kBCst; \
+- __asm__ volatile ( \
+- "shll_s.w %["#R"], %["#R"], 9 \n\t" \
+- "shll_s.w %["#G"], %["#G"], 9 \n\t" \
+- "shll_s.w %["#B"], %["#B"], 9 \n\t" \
+- "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \
+- "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \
+- "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \
+- "srl %["#R"], %["#R"], 24 \n\t" \
+- "srl %["#G"], %["#G"], 24 \n\t" \
+- "srl %["#B"], %["#B"], 24 \n\t" \
+- : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \
+- : \
+- ); \
+- } while (0)
+-
+ static WEBP_INLINE void YuvToRgb(int y, int u, int v, uint8_t* const rgb) {
+ int r, g, b;
+ YUV_TO_RGB(y, u, v, r, g, b);
+diff -Naur FreeImage.orig/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +--- FreeImage.orig/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c 2015-06-28 16:49:39.320546812 +0200 ++++ FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c 2015-06-28 16:50:59.357137570 +0200 +@@ -35,29 +35,6 @@ + "addu %[temp2], %[temp2], %[temp3] \n\t" \
+ "addu %[temp4], %[temp4], %[t_con_8] \n\t" \
+
+-#define ROW_FUNC_PART_2(R, G, B, K) \
+- "addu %[temp5], %[temp0], %[temp1] \n\t" \
+- "subu %[temp6], %[temp0], %[temp2] \n\t" \
+- "addu %[temp7], %[temp0], %[temp4] \n\t" \
+-".if "#K" \n\t" \
+- "lbu %[temp0], 1(%[y]) \n\t" \
+-".endif \n\t" \
+- "shll_s.w %[temp5], %[temp5], 9 \n\t" \
+- "shll_s.w %[temp6], %[temp6], 9 \n\t" \
+-".if "#K" \n\t" \
+- "mul %[temp0], %[t_con_5], %[temp0] \n\t" \
+-".endif \n\t" \
+- "shll_s.w %[temp7], %[temp7], 9 \n\t" \
+- "precrqu_s.qb.ph %[temp5], %[temp5], $zero \n\t" \
+- "precrqu_s.qb.ph %[temp6], %[temp6], $zero \n\t" \
+- "precrqu_s.qb.ph %[temp7], %[temp7], $zero \n\t" \
+- "srl %[temp5], %[temp5], 24 \n\t" \
+- "srl %[temp6], %[temp6], 24 \n\t" \
+- "srl %[temp7], %[temp7], 24 \n\t" \
+- "sb %[temp5], "#R"(%[dst]) \n\t" \
+- "sb %[temp6], "#G"(%[dst]) \n\t" \
+- "sb %[temp7], "#B"(%[dst]) \n\t" \
+-
+ #define ASM_CLOBBER_LIST() \
+ : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \
+ [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), \
|