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