blob: ec4acc6661dd67d51fa81a7d38d845c4cd9a678c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
2DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \
3a back-end to a program such as ghostview, it can display PostScript and PDF \
4documents in an X11 environment. \
5\
6Furthermore, it can render PostScript and PDF files as graphics to be printed \
7on non-PostScript printers. Supported printers include common \
8dot-matrix, inkjet and laser models. \
9"
10HOMEPAGE = "http://www.ghostscript.com"
11SECTION = "console/utils"
12
13LICENSE = "GPLv3"
14LIC_FILES_CHKSUM = "file://LICENSE;md5=b17cea54743435ab2a581c237bea294a"
15
16DEPENDS = "ghostscript-native tiff jpeg fontconfig cups"
17DEPENDS_class-native = ""
18
19SRC_URI_BASE = "http://downloads.ghostscript.com/public/ghostscript-${PV}.tar.gz \
20 file://ghostscript-9.15-parallel-make.patch \
21 file://ghostscript-9.16-Werror-return-type.patch \
22"
23
24SRC_URI = "${SRC_URI_BASE} \
25 file://ghostscript-9.02-prevent_recompiling.patch \
26 file://ghostscript-9.02-genarch.patch \
27 file://objarch.h \
28 file://cups-no-gcrypt.patch \
29 "
30
31SRC_URI_class-native = "${SRC_URI_BASE} \
32 file://ghostscript-native-fix-disable-system-libtiff.patch \
33 file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
34 "
35
36SRC_URI[md5sum] = "829319325bbdb83f5c81379a8f86f38f"
37SRC_URI[sha256sum] = "746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d"
38
39EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
40 --with-fontpath=${datadir}/fonts \
41 --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
42 --with-cups-datadir=${datadir}/cups \
43 ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--enable-little-endian', '--enable-big-endian', d)} \
44 "
45
46EXTRA_OECONF_append_mips = " --with-large_color_index=0"
47EXTRA_OECONF_append_mipsel = " --with-large_color_index=0"
48
49# Explicity disable libtiff, fontconfig,
50# freetype, cups for ghostscript-native
51EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
52 --without-jbig2dec \
53 --with-fontpath=${datadir}/fonts \
54 --without-libidn --disable-fontconfig \
55 --disable-freetype --disable-cups"
56
57# This has been fixed upstream but for now we need to subvert the check for time.h
58# http://bugs.ghostscript.com/show_bug.cgi?id=692443
59# http://bugs.ghostscript.com/show_bug.cgi?id=692426
60CFLAGS += "-DHAVE_SYS_TIME_H=1"
61BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
62
63inherit autotools
64
65do_configure_prepend () {
66 mkdir -p obj
67 mkdir -p soobj
68 if [ -e ${WORKDIR}/objarch.h ]; then
69 cp ${WORKDIR}/objarch.h obj/arch.h
70 fi
71}
72
73do_configure_append () {
74 # copy tools from the native ghostscript build
75 if [ "${PN}" != "ghostscript-native" ]; then
76 mkdir -p obj/aux soobj
77 for i in genarch genconf mkromfs echogs gendev genht; do
78 cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
79 done
80 fi
81}
82
83do_install_append () {
84 mkdir -p ${D}${datadir}/ghostscript/${PV}/
85 cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
86 cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
87}
88
89do_compile_class-native () {
90 mkdir -p obj
91 for i in genarch genconf mkromfs echogs gendev genht; do
92 oe_runmake obj/aux/$i
93 done
94}
95
96do_install_class-native () {
97 install -d ${D}${bindir}/ghostscript-${PV}
98 for i in genarch genconf mkromfs echogs gendev genht; do
99 install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
100 done
101}
102
103BBCLASSEXTEND = "native"