diff --git a/recipes-support/chmlib/chmlib.bb b/recipes-support/chmlib/chmlib.bb new file mode 100644 index 00000000..bd81dfb6 --- /dev/null +++ b/recipes-support/chmlib/chmlib.bb @@ -0,0 +1,16 @@ +SUMMARY = "CHMLIB is a library for dealing with Microsoft ITSS/CHM format files" +HOMEPAGE = "http://www.jedrea.com/chmlib/" +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff" + +SRC_URI = " \ + http://www.jedrea.com/${BPN}/${BPN}-${PV}.tar.bz2 \ + file://0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch \ +" +PV = "0.40" +SRC_URI[sha256sum] = "3449d64b0cf71578b2c7e3ddc048d4af3661f44a83941ea074a7813f3a59ffa3" + +inherit autotools pkgconfig + +DEPENDS += " \ +" diff --git a/recipes-support/chmlib/chmlib/0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch b/recipes-support/chmlib/chmlib/0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch new file mode 100644 index 00000000..b7a616d1 --- /dev/null +++ b/recipes-support/chmlib/chmlib/0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch @@ -0,0 +1,77 @@ +From be20aa9e5992f371fa0f73be16bb1b145192a428 Mon Sep 17 00:00:00 2001 +From: Jed Wing +Date: Wed, 27 May 2009 18:25:42 -0700 +Subject: [PATCH 1/2] Patch to fix integer types problem by Goswin von + Brederlow. + +This came from Goswin von Brederlow via +Kartik Mistry, the maintainer of the Debian package of chmlib. + +Stolen from [1] + +[1] https://src.fedoraproject.org/rpms/chmlib/blob/rawhide/f/chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch +--- + src/chm_lib.c | 30 +++++++++++++----------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +diff --git a/src/chm_lib.c b/src/chm_lib.c +index 6c6736c..ffd213c 100644 +--- a/src/chm_lib.c ++++ b/src/chm_lib.c +@@ -56,6 +56,7 @@ + + #include "lzx.h" + ++#include + #include + #include + #ifdef CHM_DEBUG +@@ -149,22 +150,9 @@ typedef unsigned __int32 UInt32; + 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 unsigned int UInt32; + 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 */ +-- +1.8.3.1 +