kumquat-buildroot/package/ghostscript/ghostscript.mk
Fabrice Fontaine b4adbfaf2e package/ghostscript: disable tesseract without threads
ghostscript embeds a local copy of tesseract-ocr which is enabled by
default since version 9.53.0 and
https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=7322ef87546c55b29056c1d96d8bdbb7f3ba53ef

Since version 9.55.0 and
https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=5459f7aca1ded3b7cf96c339a2419f418aa406c7,
ghostscript expects that tesseract is disabled if threads are not
available resulting in the following build failure since commit
7a4944569c:

configure: error: Threading disabled or not available. Tesseract OCR relies on threading. Rerun configure with "--without-tesseract" to exclude OCR from the build

So disable tesseract if threads are not available. It should be noted
that there is no way to tell ghostscript to use a system provided
tesseract-ocr package.

Fixes:
 - http://autobuild.buildroot.org/results/fd35a47b2a77cf57c243ec1c88802b53ddca8f52

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-03-07 23:15:14 +01:00

91 lines
2.3 KiB
Makefile

################################################################################
#
# ghostscript
#
################################################################################
GHOSTSCRIPT_VERSION = 9.55.0
GHOSTSCRIPT_SITE = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$(subst .,,$(GHOSTSCRIPT_VERSION))
GHOSTSCRIPT_LICENSE = AGPL-3.0
GHOSTSCRIPT_LICENSE_FILES = LICENSE
GHOSTSCRIPT_CPE_ID_VENDOR = artifex
GHOSTSCRIPT_DEPENDENCIES = \
host-lcms2 \
host-libjpeg \
host-pkgconf \
host-zlib \
fontconfig \
ghostscript-fonts \
jpeg \
lcms2 \
libpng \
tiff
# Ghostscript includes (old) copies of several libraries, delete them.
# Inspired by linuxfromscratch:
# http://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html
define GHOSTSCRIPT_REMOVE_LIBS
rm -rf $(@D)/freetype $(@D)/ijs $(@D)/jbig2dec $(@D)/jpeg \
$(@D)/lcms2mt $(@D)/libpng $(@D)/openjpeg $(@D)/tiff \
$(@D)/zlib
endef
GHOSTSCRIPT_POST_PATCH_HOOKS += GHOSTSCRIPT_REMOVE_LIBS
GHOSTSCRIPT_CONF_ENV = \
CCAUX="$(HOSTCC)" \
CFLAGSAUX="$(HOST_CFLAGS) $(HOST_LDFLAGS)" \
PKGCONFIG="$(PKG_CONFIG_HOST_BINARY)"
GHOSTSCRIPT_CONF_OPTS = \
--disable-compile-inits \
--enable-fontconfig \
--with-fontpath=/usr/share/fonts \
--enable-freetype \
--disable-gtk \
--without-libpaper \
--without-pdf \
--with-system-libtiff
ifeq ($(BR2_PACKAGE_JBIG2DEC),y)
GHOSTSCRIPT_DEPENDENCIES += jbig2dec
GHOSTSCRIPT_CONF_OPTS += --with-jbig2dec
else
GHOSTSCRIPT_CONF_OPTS += --without-jbig2dec
endif
ifeq ($(BR2_PACKAGE_LIBIDN),y)
GHOSTSCRIPT_DEPENDENCIES += libidn
GHOSTSCRIPT_CONF_OPTS += --with-libidn
else
GHOSTSCRIPT_CONF_OPTS += --without-libidn
endif
ifeq ($(BR2_PACKAGE_OPENJPEG),y)
GHOSTSCRIPT_DEPENDENCIES += openjpeg
GHOSTSCRIPT_CONF_OPTS += --enable-openjpeg
else
GHOSTSCRIPT_CONF_OPTS += --disable-openjpeg
endif
ifeq ($(BR2_PACKAGE_CUPS),y)
GHOSTSCRIPT_DEPENDENCIES += cups
GHOSTSCRIPT_CONF_OPTS += \
CUPSCONFIG=$(STAGING_DIR)/usr/bin/cups-config \
--enable-cups
else
GHOSTSCRIPT_CONF_OPTS += --disable-cups
endif
ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
GHOSTSCRIPT_DEPENDENCIES += xlib_libX11
GHOSTSCRIPT_CONF_OPTS += --with-x
else
GHOSTSCRIPT_CONF_OPTS += --without-x
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
GHOSTSCRIPT_CONF_OPTS += --without-tesseract
endif
$(eval $(autotools-package))