summaryrefslogtreecommitdiff
path: root/extra/chmlib
diff options
context:
space:
mode:
Diffstat (limited to 'extra/chmlib')
-rw-r--r--extra/chmlib/PKGBUILD14
-rw-r--r--extra/chmlib/src_chm_lib.c.diff58
2 files changed, 68 insertions, 4 deletions
diff --git a/extra/chmlib/PKGBUILD b/extra/chmlib/PKGBUILD
index 00013a6b9..d6f1992d8 100644
--- a/extra/chmlib/PKGBUILD
+++ b/extra/chmlib/PKGBUILD
@@ -5,19 +5,25 @@
pkgname=chmlib
pkgver=0.40
-pkgrel=3
+pkgrel=3.1
pkgdesc="Library for dealing with Microsoft ITSS/CHM format files"
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'mips64el')
url="http://morte.jedrea.com/~jedwin/projects/chmlib/"
options=('!libtool')
license=('LGPL')
depends=('glibc')
-source=("http://morte.jedrea.com/~jedwin/projects/${pkgname}/${pkgname}-${pkgver}.tar.bz2")
-md5sums=('7ea49ed8c335215c1edc6fae83e6b912')
+source=("http://morte.jedrea.com/~jedwin/projects/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
+ 'src_chm_lib.c.diff')
+md5sums=('7ea49ed8c335215c1edc6fae83e6b912'
+ '08fe9d62302a50f23cffb6c2a7524b6d')
build() {
cd "${srcdir}"/${pkgname}-${pkgver}
+# Patch from debian
+ [ "$CARCH" = "mips64el" ] && \
+ patch -Np1 -i $srcdir/src_chm_lib.c.diff
+
./configure --prefix=/usr \
--enable-examples=yes
make
diff --git a/extra/chmlib/src_chm_lib.c.diff b/extra/chmlib/src_chm_lib.c.diff
new file mode 100644
index 000000000..742e0e521
--- /dev/null
+++ b/extra/chmlib/src_chm_lib.c.diff
@@ -0,0 +1,58 @@
+Patch to fix integer types problem by Goswin von Brederlow
+<brederlo@informatik.uni-tuebingen.de> (#258444)
+--- chmlib-0.39.orig/src/chm_lib.c
++++ chmlib-0.39/src/chm_lib.c
+@@ -56,6 +56,7 @@
+
+ #include "lzx.h"
+
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #ifdef CHM_DEBUG
+@@ -149,22 +150,9 @@
+ typedef __int64 Int64;
+ typedef unsigned __int64 UInt64;
+
+-/* I386, 32-bit, non-Windows */
+-/* Sparc */
+-/* MIPS */
+-/* PPC */
+-#elif __i386__ || __sun || __sgi || __ppc__
+-typedef unsigned char UChar;
+-typedef short Int16;
+-typedef unsigned short UInt16;
+-typedef long Int32;
+-typedef unsigned long UInt32;
+-typedef long long Int64;
+-typedef unsigned long long UInt64;
+-
+ /* x86-64 */
+ /* Note that these may be appropriate for other 64-bit machines. */
+-#elif __x86_64__ || __ia64__
++#elif defined(__LP64__)
+ typedef unsigned char UChar;
+ typedef short Int16;
+ typedef unsigned short UInt16;
+@@ -173,10 +161,18 @@
+ typedef long Int64;
+ typedef unsigned long UInt64;
+
++/* I386, 32-bit, non-Windows */
++/* Sparc */
++/* MIPS */
++/* PPC */
+ #else
+-
+-/* yielding an error is preferable to yielding incorrect behavior */
+-#error "Please define the sized types for your platform in chm_lib.c"
++typedef unsigned char UChar;
++typedef short Int16;
++typedef unsigned short UInt16;
++typedef long Int32;
++typedef unsigned long UInt32;
++typedef long long Int64;
++typedef unsigned long long UInt64;
+ #endif
+
+ /* GCC */