* update chmlib to 0.40-8

This commit is contained in:
Alexander Baldeck 2024-10-29 20:40:52 +01:00
parent 10befcd36e
commit 08c47a0b54
6 changed files with 80 additions and 19 deletions

View File

@ -1,7 +1,7 @@
pkgbase = chmlib
pkgdesc = Library for dealing with Microsoft ITSS/CHM format files
pkgver = 0.40
pkgrel = 7.1
pkgrel = 8
url = http://www.jedrea.com/chmlib/
arch = x86_64
arch = powerpc64le
@ -11,8 +11,12 @@ pkgbase = chmlib
license = LGPL
depends = glibc
source = http://www.jedrea.com/chmlib/chmlib-0.40.tar.bz2
source = chmlib-0.40-ppc-riscv64.patch
source = chmlib-0.39-stdtypes.patch
source = chmlib-0.40-clang16.patch
source = chmlib-0.40-headers.patch
sha256sums = 3449d64b0cf71578b2c7e3ddc048d4af3661f44a83941ea074a7813f3a59ffa3
sha256sums = 82adaf9482afd347ead723cf0432fb14e571422ddb3d91c74119736b2feab688
sha256sums = 7dbae5e2fb8932972f2e09a44bcaaf0e53f1f0b274d8b540a5ce2d7975a14c7f
sha256sums = db90cbf3e2a00aa89b93e80d49cc42889653738a023c9267e3266763f260d650
sha256sums = cd887bbfd3b06b47e6d4510f580f03e45cc3ef06bdf4e45ce13b5365fe9743b5
pkgname = chmlib

View File

@ -5,26 +5,32 @@
pkgname=chmlib
pkgver=0.40
pkgrel=7.1
pkgrel=8
pkgdesc="Library for dealing with Microsoft ITSS/CHM format files"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="http://www.jedrea.com/chmlib/"
license=('LGPL')
depends=('glibc')
source=("http://www.jedrea.com/chmlib/chmlib-0.40.tar.bz2"
chmlib-0.40-ppc-riscv64.patch)
chmlib-0.39-stdtypes.patch
chmlib-0.40-clang16.patch
chmlib-0.40-headers.patch)
sha256sums=('3449d64b0cf71578b2c7e3ddc048d4af3661f44a83941ea074a7813f3a59ffa3'
'82adaf9482afd347ead723cf0432fb14e571422ddb3d91c74119736b2feab688')
'7dbae5e2fb8932972f2e09a44bcaaf0e53f1f0b274d8b540a5ce2d7975a14c7f'
'db90cbf3e2a00aa89b93e80d49cc42889653738a023c9267e3266763f260d650'
'cd887bbfd3b06b47e6d4510f580f03e45cc3ef06bdf4e45ce13b5365fe9743b5')
prepare() {
cd "${srcdir}"/${pkgname}-${pkgver}
patch -Np1 -i ${srcdir}/chmlib-0.40-ppc-riscv64.patch
patch -Np1 -i ${srcdir}/chmlib-0.39-stdtypes.patch
patch -Np1 -i ${srcdir}/chmlib-0.40-clang16.patch
patch -Np1 -i ${srcdir}/chmlib-0.40-headers.patch
}
build() {
cd "${srcdir}"/${pkgname}-${pkgver}
CFLAGS+=' -Wno-implicit-function-declaration' \
CFLAGS+=" -Wno-implicit-function-declaration -Wno-incompatible-pointer-types"
./configure --prefix=/usr \
--enable-examples=yes \
--build=${CHOST}

View File

@ -0,0 +1,20 @@
--- a/src/chm_lib.c
+++ b/src/chm_lib.c
@@ -149,6 +149,17 @@ typedef unsigned __int32 UInt32;
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
+/* Linux: use C standard types */
+#elif defined(__linux__)
+#include <stdint.h>
+typedef unsigned char UChar;
+typedef int16_t Int16;
+typedef uint16_t UInt16;
+typedef int32_t Int32;
+typedef uint32_t UInt32;
+typedef int64_t Int64;
+typedef uint64_t UInt64;
+
/* I386, 32-bit, non-Windows */
/* Sparc */
/* MIPS */

View File

@ -0,0 +1,24 @@
https://bugs.gentoo.org/871177
https://github.com/jedwing/CHMLib/pull/17
From 5877959e3eb9a54e131608c52e2d6f4c89bc0189 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 19 Apr 2023 09:47:03 +0200
Subject: [PATCH] Avoid implicit function declarations, for C99 compatibility
Define _LARGEFILE64_SOURCE so that <unistd.h> defines pread64.
This avoids build failures with future compilers which do not
support implicit function declarations by default.
--- a/src/chm_lib.c
+++ b/src/chm_lib.c
@@ -48,6 +48,8 @@
* *
***************************************************************************/
+#define _LARGEFILE64_SOURCE /* for pread64 */
+
#include "chm_lib.h"
#ifdef CHM_MT

View File

@ -0,0 +1,18 @@
--- a/src/chm_http.c
+++ b/src/chm_http.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#if __sun || __sgi
#include <strings.h>
#endif
@@ -42,6 +43,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
/* threading includes */
#include <pthread.h>

View File

@ -1,11 +0,0 @@
--- chmlib-0.40/src/chm_lib.c.orig 2019-05-05 20:55:19.050000000 +0000
+++ chmlib-0.40/src/chm_lib.c 2019-05-05 20:56:01.950000000 +0000
@@ -164,7 +164,7 @@
/* x86-64 */
/* Note that these may be appropriate for other 64-bit machines. */
-#elif __x86_64__ || __ia64__
+#elif __x86_64__ || __ia64__ || __powerpc64__ || __powerpc__ || (__riscv && (__riscv_xlen == 64))
typedef unsigned char UChar;
typedef short Int16;
typedef unsigned short UInt16;