app-text/crengine-ng: compilation fixes

Closes: https://bugs.gentoo.org/889078
Signed-off-by: Andrey Grozin <grozin@gentoo.org>
This commit is contained in:
Andrey Grozin
2023-01-03 17:42:58 +07:00
parent d4637e8d3a
commit 09803522a2
2 changed files with 115 additions and 0 deletions
@@ -0,0 +1,60 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="Cross-platform library designed to implement e-book readers"
HOMEPAGE="https://gitlab.com/coolreader-ng/crengine-ng"
SRC_URI="https://gitlab.com/coolreader-ng/${PN}/-/archive/${PV}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+png +jpeg +gif +svg +chm +harfbuzz +fontconfig +libunibreak +fribidi +zstd +libutf8proc lto static-libs"
CDEPEND="sys-libs/zlib
png? ( media-libs/libpng:0 )
jpeg? ( media-libs/libjpeg-turbo )
>=media-libs/freetype-2.10.0
harfbuzz? ( media-libs/harfbuzz:= )
libunibreak? ( dev-libs/libunibreak:= )
fribidi? ( dev-libs/fribidi )
zstd? ( app-arch/zstd:= )
libutf8proc? ( dev-libs/libutf8proc:= )
fontconfig? ( media-libs/fontconfig )"
RDEPEND="${CDEPEND}"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig
${CDEPEND}"
PATCHES=( "${FILESDIR}"/${P}.patch )
src_configure() {
CMAKE_USE_DIR="${S}"
CMAKE_BUILD_TYPE="Release"
local mycmakeargs=(
-DCRE_BUILD_SHARED=ON
-DCRE_BUILD_STATIC=$(usex static-libs)
-DUSE_COLOR_BACKBUFFER=ON
-DWITH_LIBPNG=$(usex png)
-DWITH_LIBJPEG=$(usex jpeg)
-DWITH_FREETYPE=ON
-DWITH_HARFBUZZ=$(usex harfbuzz)
-DWITH_LIBUNIBREAK=$(usex libunibreak)
-DWITH_FRIBIDI=$(usex fribidi)
-DWITH_ZSTD=$(usex zstd)
-DWITH_UTF8PROC=$(usex libutf8proc)
-DUSE_GIF=$(usex gif)
-DUSE_NANOSVG=$(usex svg)
-DUSE_CHM=$(usex chm)
-DUSE_ANTIWORD=ON
-DUSE_FONTCONFIG=$(usex fontconfig)
-DUSE_SHASUM=OFF
-DBUILD_TOOLS=OFF
-DENABLE_UNITTESTING=OFF
-DENABLE_LTO=$(usex lto)
)
cmake_src_configure
}
@@ -0,0 +1,55 @@
From 62106833d4e8af5325ed7a55c7a897e43a52bb20 Mon Sep 17 00:00:00 2001
From: Aleksey Chernov <valexlin@gmail.com>
Date: Sun, 1 Jan 2023 09:55:04 +0400
Subject: [PATCH] Compile warnings/errors fixed: `strcasecmp` missing
prototype.
---
thirdparty/antiword/antiword.h | 3 +++
thirdparty/chmlib/src/chm_lib.c | 6 +-----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/thirdparty/antiword/antiword.h b/thirdparty/antiword/antiword.h
index e6f4d68f..0abce7af 100644
--- a/thirdparty/antiword/antiword.h
+++ b/thirdparty/antiword/antiword.h
@@ -31,6 +31,9 @@
#else
#include <sys/types.h>
#endif /* __riscos */
+#include <string.h>
+#include <strings.h>
+
#include "wordconst.h"
#include "wordtypes.h"
#include "fail.h"
diff --git a/thirdparty/chmlib/src/chm_lib.c b/thirdparty/chmlib/src/chm_lib.c
index 637a32b2..2e26db1e 100644
--- a/thirdparty/chmlib/src/chm_lib.c
+++ b/thirdparty/chmlib/src/chm_lib.c
@@ -59,6 +59,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#ifdef CHM_DEBUG
#include <stdio.h>
#endif
@@ -70,14 +71,9 @@
#ifdef WIN32
#include <windows.h>
#include <malloc.h>
-#ifdef _WIN32_WCE
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#else
-#define strcasecmp _stricmp
-#define strncasecmp _strnicmp
-#endif
-#else
/* basic Linux system includes */
#define _XOPEN_SOURCE 500
#include <unistd.h>
--
2.37.4