blob: d584c49b0794e172ad63badb53cb6dc343571402 [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 \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050022 file://png_mak.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023"
24
25SRC_URI = "${SRC_URI_BASE} \
26 file://ghostscript-9.02-prevent_recompiling.patch \
27 file://ghostscript-9.02-genarch.patch \
28 file://objarch.h \
29 file://cups-no-gcrypt.patch \
30 "
31
32SRC_URI_class-native = "${SRC_URI_BASE} \
33 file://ghostscript-native-fix-disable-system-libtiff.patch \
34 file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
35 "
36
37SRC_URI[md5sum] = "829319325bbdb83f5c81379a8f86f38f"
38SRC_URI[sha256sum] = "746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d"
39
40EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
41 --with-fontpath=${datadir}/fonts \
42 --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
43 --with-cups-datadir=${datadir}/cups \
44 ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--enable-little-endian', '--enable-big-endian', d)} \
45 "
46
47EXTRA_OECONF_append_mips = " --with-large_color_index=0"
48EXTRA_OECONF_append_mipsel = " --with-large_color_index=0"
49
50# Explicity disable libtiff, fontconfig,
51# freetype, cups for ghostscript-native
52EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
53 --without-jbig2dec \
54 --with-fontpath=${datadir}/fonts \
55 --without-libidn --disable-fontconfig \
56 --disable-freetype --disable-cups"
57
58# This has been fixed upstream but for now we need to subvert the check for time.h
59# http://bugs.ghostscript.com/show_bug.cgi?id=692443
60# http://bugs.ghostscript.com/show_bug.cgi?id=692426
61CFLAGS += "-DHAVE_SYS_TIME_H=1"
62BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
63
64inherit autotools
65
66do_configure_prepend () {
67 mkdir -p obj
68 mkdir -p soobj
69 if [ -e ${WORKDIR}/objarch.h ]; then
70 cp ${WORKDIR}/objarch.h obj/arch.h
71 fi
72}
73
74do_configure_append () {
75 # copy tools from the native ghostscript build
76 if [ "${PN}" != "ghostscript-native" ]; then
77 mkdir -p obj/aux soobj
78 for i in genarch genconf mkromfs echogs gendev genht; do
79 cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
80 done
81 fi
82}
83
84do_install_append () {
85 mkdir -p ${D}${datadir}/ghostscript/${PV}/
86 cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
87 cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
88}
89
90do_compile_class-native () {
91 mkdir -p obj
92 for i in genarch genconf mkromfs echogs gendev genht; do
93 oe_runmake obj/aux/$i
94 done
95}
96
97do_install_class-native () {
98 install -d ${D}${bindir}/ghostscript-${PV}
99 for i in genarch genconf mkromfs echogs gendev genht; do
100 install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
101 done
102}
103
104BBCLASSEXTEND = "native"