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 = " \ |
| 7 | intltool-native \ |
| 8 | bison-native \ |
| 9 | groff-native \ |
| 10 | libtool \ |
| 11 | gdk-pixbuf \ |
| 12 | cairo \ |
| 13 | pango \ |
| 14 | expat \ |
| 15 | freetype \ |
| 16 | " |
| 17 | DEPENDS:append:class-target = " ${BPN}-native" |
| 18 | DEPENDS:append:class-nativesdk = " ${BPN}-native" |
| 19 | |
| 20 | inherit autotools-brokensep pkgconfig gettext qemu |
| 21 | |
| 22 | SRC_URI = "https://gitlab.com/api/v4/projects/4207231/packages/generic/${BPN}-releases/${PV}/${BP}.tar.xz \ |
| 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 | " |
| 31 | |
| 32 | SRC_URI[sha256sum] = "6b16bf990df114195be669773a1dae975dbbffada45e1de2849ddeb5851bb9a8" |
| 33 | |
| 34 | PACKAGECONFIG ??= "librsvg" |
| 35 | PACKAGECONFIG[librsvg] = "--with-librsvg,--without-librsvg,librsvg" |
| 36 | |
| 37 | EXTRA_OECONF:append = " PS2PDF=/bin/echo" |
| 38 | |
| 39 | EXTRA_OECONF:class-target = "\ |
| 40 | --with-expatincludedir=${STAGING_INCDIR} \ |
| 41 | --with-expatlibdir=${STAGING_LIBDIR} \ |
| 42 | --without-included-ltdl \ |
| 43 | --disable-java \ |
| 44 | --disable-tcl \ |
| 45 | --disable-r \ |
| 46 | --disable-sharp \ |
| 47 | " |
| 48 | EXTRA_OECONF:class-nativesdk = "\ |
| 49 | --with-expatincludedir=${STAGING_INCDIR} \ |
| 50 | --with-expatlibdir=${STAGING_LIBDIR} \ |
| 51 | --without-included-ltdl \ |
| 52 | --disable-java \ |
| 53 | --disable-tcl \ |
| 54 | --disable-r \ |
| 55 | --disable-sharp \ |
| 56 | " |
| 57 | CFLAGS:append:class-target = " -D_typ_ssize_t=1 -D_long_double=1" |
| 58 | CFLAGS:append:class-nativesdk = " -D_typ_ssize_t=1 -D_long_double=1" |
| 59 | do_configure:prepend() { |
| 60 | cd ${S} |
| 61 | # create version.m4 and ignore libtoolize errors |
| 62 | ./autogen.sh NOCONFIG || true |
| 63 | } |
| 64 | |
| 65 | do_install:append:class-nativesdk() { |
| 66 | # graphviz-setup.sh must be executed at SDK installation |
| 67 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 68 | install -m 0755 ${WORKDIR}/graphviz-setup.sh ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 69 | } |
| 70 | FILES:${PN}:class-nativesdk += "${SDKPATHNATIVE}" |
| 71 | |
| 72 | # create /usr/lib/graphviz/config6 |
| 73 | graphviz_sstate_postinst() { |
| 74 | mkdir -p ${SYSROOT_DESTDIR}${bindir} |
| 75 | dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN} |
| 76 | echo '#!/bin/sh' > $dest |
| 77 | echo '' >> $dest |
| 78 | echo 'dot -c' >> $dest |
| 79 | chmod 0755 $dest |
| 80 | } |
| 81 | SYSROOT_PREPROCESS_FUNCS:append:class-native = " graphviz_sstate_postinst" |
| 82 | |
| 83 | pkg_postinst:${PN} () { |
| 84 | if [ -n "$D" ]; then |
| 85 | if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then |
| 86 | ${@qemu_run_binary(d, '$D', '${bindir}/dot')} -c |
| 87 | fi |
| 88 | else |
| 89 | dot -c |
| 90 | fi |
| 91 | } |
| 92 | |
| 93 | pkg_postrm:${PN} () { |
| 94 | rm -f $D${libdir}/graphviz/config* |
| 95 | rmdir --ignore-fail-on-non-empty $D${libdir}/graphviz |
| 96 | } |
| 97 | |
| 98 | PACKAGE_WRITE_DEPS += "qemu-native" |
| 99 | |
| 100 | PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo" |
| 101 | |
| 102 | FILES:${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/" |
| 103 | FILES:${PN}-perl += "${libdir}/perl5/*/vendor_perl/ ${libdir}/graphviz/perl/" |
| 104 | FILES:${PN}-demo += "${datadir}/graphviz/demo/" |
| 105 | |
| 106 | RDEPENDS:${PN}-perl += "perl" |
| 107 | RDEPENDS:${PN}-python += "python3" |
| 108 | RDEPENDS:${PN}-demo += "python3 perl" |
| 109 | |
| 110 | RRECOMMENDS:${PN} = "liberation-fonts" |
| 111 | |
| 112 | INSANE_SKIP:${PN}-perl = "dev-so" |
| 113 | INSANE_SKIP:${PN}-python = "dev-so" |
| 114 | |
| 115 | FILES_SOLIBSDEV:append = " ${libdir}/graphviz/lib*${SOLIBSDEV}" |
| 116 | |
| 117 | BBCLASSEXTEND = "native nativesdk" |