package/ghostscript: add optional dependency to jbig2dec
authorBernd Kuhls <bernd.kuhls@t-online.de>
Wed, 6 Nov 2019 21:10:04 +0000 (22:10 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 29 Mar 2020 20:55:29 +0000 (22:55 +0200)
Remove jbig2dec source files included in upstream tarball as well.

Needs http://patchwork.ozlabs.org/patch/1161981/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/ghostscript/ghostscript.mk

index a6e85d98946447177db7e557176dfb69010ba7fe..d0f46187c32f1ac91d333a27a31bfb5e339e9a58 100644 (file)
@@ -27,8 +27,8 @@ GHOSTSCRIPT_DEPENDENCIES = \
 # Inspired by linuxfromscratch:
 # http://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html
 define GHOSTSCRIPT_REMOVE_LIBS
-       rm -rf $(@D)/freetype $(@D)/ijs $(@D)/jpeg $(@D)/lcms2mt \
-               $(@D)/libpng $(@D)/tiff $(@D)/zlib
+       rm -rf $(@D)/freetype $(@D)/ijs $(@D)/jbig2dec $(@D)/jpeg \
+               $(@D)/lcms2mt $(@D)/libpng $(@D)/tiff $(@D)/zlib
 endef
 GHOSTSCRIPT_POST_PATCH_HOOKS += GHOSTSCRIPT_REMOVE_LIBS
 
@@ -43,10 +43,16 @@ GHOSTSCRIPT_CONF_OPTS = \
        --with-fontpath=/usr/share/fonts \
        --enable-freetype \
        --disable-gtk \
-       --without-jbig2dec \
        --without-libpaper \
        --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