Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1 | SUMMARY = "Graph Visualization Tools" |
| 2 | HOMEPAGE = "http://www.graphviz.org" |
| 3 | LICENSE = "EPL-1.0" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=9109f5fc16cf963fb3cdd32781b3ce04" |
| 5 | |
| 6 | DEPENDS = " \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 7 | bison-native \ |
| 8 | groff-native \ |
| 9 | libtool \ |
| 10 | gdk-pixbuf \ |
| 11 | cairo \ |
| 12 | pango \ |
| 13 | expat \ |
| 14 | freetype \ |
| 15 | " |
| 16 | DEPENDS:append:class-target = " ${BPN}-native" |
| 17 | DEPENDS:append:class-nativesdk = " ${BPN}-native" |
| 18 | |
| 19 | inherit autotools-brokensep pkgconfig gettext qemu |
| 20 | |
| 21 | SRC_URI = "https://gitlab.com/api/v4/projects/4207231/packages/generic/${BPN}-releases/${PV}/${BP}.tar.xz \ |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 22 | file://0001-Autotools-fix-do-not-put-prefix-based-paths-in-compi.patch \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 23 | " |
| 24 | # Use native mkdefs |
| 25 | SRC_URI:append:class-target = "\ |
| 26 | file://0001-Set-use_tcl-to-be-empty-string-if-tcl-is-disabled.patch \ |
| 27 | " |
| 28 | SRC_URI:append:class-nativesdk = "\ |
| 29 | file://graphviz-setup.sh \ |
| 30 | " |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 31 | SRC_URI[sha256sum] = "d593695fdaa8a19297523b679ad13d3ef2027b0b7f14cc2bc23e77969ed81565" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 32 | |
| 33 | PACKAGECONFIG ??= "librsvg" |
| 34 | PACKAGECONFIG[librsvg] = "--with-librsvg,--without-librsvg,librsvg" |
| 35 | |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 36 | EXTRA_OECONF:append = " PS2PDF=/bin/echo --disable-man-pdfs" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 37 | |
| 38 | EXTRA_OECONF:class-target = "\ |
| 39 | --with-expatincludedir=${STAGING_INCDIR} \ |
| 40 | --with-expatlibdir=${STAGING_LIBDIR} \ |
| 41 | --without-included-ltdl \ |
| 42 | --disable-java \ |
| 43 | --disable-tcl \ |
| 44 | --disable-r \ |
| 45 | --disable-sharp \ |
| 46 | " |
| 47 | EXTRA_OECONF:class-nativesdk = "\ |
| 48 | --with-expatincludedir=${STAGING_INCDIR} \ |
| 49 | --with-expatlibdir=${STAGING_LIBDIR} \ |
| 50 | --without-included-ltdl \ |
| 51 | --disable-java \ |
| 52 | --disable-tcl \ |
| 53 | --disable-r \ |
| 54 | --disable-sharp \ |
| 55 | " |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 56 | EXTRA_OECONF:class-native = "\ |
| 57 | --disable-tcl \ |
| 58 | " |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 59 | CFLAGS:append:class-target = " -D_typ_ssize_t=1 -D_long_double=1" |
| 60 | CFLAGS:append:class-nativesdk = " -D_typ_ssize_t=1 -D_long_double=1" |
| 61 | do_configure:prepend() { |
| 62 | cd ${S} |
| 63 | # create version.m4 and ignore libtoolize errors |
| 64 | ./autogen.sh NOCONFIG || true |
| 65 | } |
| 66 | |
| 67 | do_install:append:class-nativesdk() { |
| 68 | # graphviz-setup.sh must be executed at SDK installation |
| 69 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 70 | install -m 0755 ${WORKDIR}/graphviz-setup.sh ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 71 | } |
| 72 | FILES:${PN}:class-nativesdk += "${SDKPATHNATIVE}" |
| 73 | |
| 74 | # create /usr/lib/graphviz/config6 |
| 75 | graphviz_sstate_postinst() { |
| 76 | mkdir -p ${SYSROOT_DESTDIR}${bindir} |
| 77 | dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN} |
| 78 | echo '#!/bin/sh' > $dest |
| 79 | echo '' >> $dest |
| 80 | echo 'dot -c' >> $dest |
| 81 | chmod 0755 $dest |
| 82 | } |
| 83 | SYSROOT_PREPROCESS_FUNCS:append:class-native = " graphviz_sstate_postinst" |
| 84 | |
| 85 | pkg_postinst:${PN} () { |
| 86 | if [ -n "$D" ]; then |
| 87 | if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then |
| 88 | ${@qemu_run_binary(d, '$D', '${bindir}/dot')} -c |
| 89 | fi |
| 90 | else |
| 91 | dot -c |
| 92 | fi |
| 93 | } |
| 94 | |
| 95 | pkg_postrm:${PN} () { |
| 96 | rm -f $D${libdir}/graphviz/config* |
| 97 | rmdir --ignore-fail-on-non-empty $D${libdir}/graphviz |
| 98 | } |
| 99 | |
| 100 | PACKAGE_WRITE_DEPS += "qemu-native" |
| 101 | |
| 102 | PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo" |
| 103 | |
| 104 | FILES:${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/" |
| 105 | FILES:${PN}-perl += "${libdir}/perl5/*/vendor_perl/ ${libdir}/graphviz/perl/" |
| 106 | FILES:${PN}-demo += "${datadir}/graphviz/demo/" |
| 107 | |
| 108 | RDEPENDS:${PN}-perl += "perl" |
| 109 | RDEPENDS:${PN}-python += "python3" |
| 110 | RDEPENDS:${PN}-demo += "python3 perl" |
| 111 | |
| 112 | RRECOMMENDS:${PN} = "liberation-fonts" |
| 113 | |
| 114 | INSANE_SKIP:${PN}-perl = "dev-so" |
| 115 | INSANE_SKIP:${PN}-python = "dev-so" |
| 116 | |
| 117 | FILES_SOLIBSDEV:append = " ${libdir}/graphviz/lib*${SOLIBSDEV}" |
| 118 | |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 119 | RRECOMMENDS:${PN} = "liberation-fonts" |
| 120 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 121 | BBCLASSEXTEND = "native nativesdk" |