ghostscript_9.53.3.bb 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
  2. DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \
  3. a back-end to a program such as ghostview, it can display PostScript and PDF \
  4. documents in an X11 environment. \
  5. \
  6. Furthermore, it can render PostScript and PDF files as graphics to be printed \
  7. on non-PostScript printers. Supported printers include common \
  8. dot-matrix, inkjet and laser models. \
  9. "
  10. HOMEPAGE = "http://www.ghostscript.com"
  11. SECTION = "console/utils"
  12. LICENSE = "GPLv3"
  13. LIC_FILES_CHKSUM = "file://LICENSE;md5=70dc2bac4d0ce4448da873cd86b123fc"
  14. DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
  15. DEPENDS_class-native = "libpng-native"
  16. UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
  17. UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
  18. def gs_verdir(v):
  19. return "".join(v.split("."))
  20. SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
  21. file://ghostscript-9.15-parallel-make.patch \
  22. file://ghostscript-9.16-Werror-return-type.patch \
  23. file://do-not-check-local-libpng-source.patch \
  24. file://avoid-host-contamination.patch \
  25. file://mkdir-p.patch \
  26. "
  27. SRC_URI = "${SRC_URI_BASE} \
  28. file://ghostscript-9.21-prevent_recompiling.patch \
  29. file://cups-no-gcrypt.patch \
  30. "
  31. SRC_URI_class-native = "${SRC_URI_BASE} \
  32. file://ghostscript-9.21-native-fix-disable-system-libtiff.patch \
  33. file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
  34. "
  35. SRC_URI[sha256sum] = "6eaf422f26a81854a230b80fd18aaef7e8d94d661485bd2e97e695b9dce7bf7f"
  36. # Put something like
  37. #
  38. # PACKAGECONFIG_append_pn-ghostscript = " x11"
  39. #
  40. # in local.conf to enable building with X11. Be careful. The order
  41. # of the overrides matters!
  42. #
  43. #PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
  44. PACKAGECONFIG_class-native = ""
  45. PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
  46. --without-x, virtual/libx11 libxext libxt gtk+3\
  47. "
  48. EXTRA_OECONF = "--without-libpaper --with-system-libtiff --without-jbig2dec \
  49. --with-fontpath=${datadir}/fonts \
  50. --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
  51. --with-cups-datadir=${datadir}/cups \
  52. CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
  53. "
  54. EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0"
  55. # Explicity disable libtiff, fontconfig,
  56. # freetype, cups for ghostscript-native
  57. EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
  58. --without-jbig2dec --without-libpaper \
  59. --with-fontpath=${datadir}/fonts \
  60. --without-libidn --disable-fontconfig \
  61. --enable-freetype --disable-cups "
  62. # This has been fixed upstream but for now we need to subvert the check for time.h
  63. # http://bugs.ghostscript.com/show_bug.cgi?id=692443
  64. # http://bugs.ghostscript.com/show_bug.cgi?id=692426
  65. CFLAGS += "-DHAVE_SYS_TIME_H=1"
  66. BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
  67. inherit autotools-brokensep
  68. do_configure_prepend_class-target () {
  69. rm -rf ${S}/jpeg/
  70. }
  71. do_configure_append () {
  72. # copy tools from the native ghostscript build
  73. if [ "${PN}" != "ghostscript-native" ]; then
  74. mkdir -p obj/aux soobj
  75. for i in genarch genconf mkromfs echogs gendev genht packps; do
  76. cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
  77. done
  78. fi
  79. }
  80. do_install_append () {
  81. mkdir -p ${D}${datadir}/ghostscript/${PV}/
  82. cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
  83. cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
  84. }
  85. do_compile_class-native () {
  86. mkdir -p obj
  87. for i in genarch genconf mkromfs echogs gendev genht packps; do
  88. oe_runmake obj/aux/$i
  89. done
  90. }
  91. do_install_class-native () {
  92. install -d ${D}${bindir}/ghostscript-${PV}
  93. for i in genarch genconf mkromfs echogs gendev genht packps; do
  94. install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
  95. done
  96. }
  97. BBCLASSEXTEND = "native"
  98. # ghostscript does not supports "arc"
  99. COMPATIBLE_HOST = "^(?!arc).*"
  100. # some entries in NVD uses gpl_ghostscript
  101. CVE_PRODUCT = "ghostscript gpl_ghostscript"