blob: 4c51af669c3f4125d101af9f5a35007a76fe4df0 [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 "
61CFLAGS:append:class-target = " -D_typ_ssize_t=1 -D_long_double=1"
62CFLAGS:append:class-nativesdk = " -D_typ_ssize_t=1 -D_long_double=1"
63do_configure:prepend() {
64 cd ${S}
65 # create version.m4 and ignore libtoolize errors
66 ./autogen.sh NOCONFIG || true
67}
68
69do_install:append:class-nativesdk() {
70 # graphviz-setup.sh must be executed at SDK installation
71 install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
72 install -m 0755 ${WORKDIR}/graphviz-setup.sh ${D}${SDKPATHNATIVE}/post-relocate-setup.d
73}
74FILES:${PN}:class-nativesdk += "${SDKPATHNATIVE}"
75
76# create /usr/lib/graphviz/config6
77graphviz_sstate_postinst() {
78 mkdir -p ${SYSROOT_DESTDIR}${bindir}
79 dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
80 echo '#!/bin/sh' > $dest
81 echo '' >> $dest
82 echo 'dot -c' >> $dest
83 chmod 0755 $dest
84}
85SYSROOT_PREPROCESS_FUNCS:append:class-native = " graphviz_sstate_postinst"
86
87pkg_postinst:${PN} () {
88 if [ -n "$D" ]; then
89 if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then
90 ${@qemu_run_binary(d, '$D', '${bindir}/dot')} -c
91 fi
92 else
93 dot -c
94 fi
95}
96
97pkg_postrm:${PN} () {
98 rm -f $D${libdir}/graphviz/config*
99 rmdir --ignore-fail-on-non-empty $D${libdir}/graphviz
100}
101
102PACKAGE_WRITE_DEPS += "qemu-native"
103
104PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo"
105
106FILES:${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/"
107FILES:${PN}-perl += "${libdir}/perl5/*/vendor_perl/ ${libdir}/graphviz/perl/"
108FILES:${PN}-demo += "${datadir}/graphviz/demo/"
109
110RDEPENDS:${PN}-perl += "perl"
111RDEPENDS:${PN}-python += "python3"
112RDEPENDS:${PN}-demo += "python3 perl"
113
114RRECOMMENDS:${PN} = "liberation-fonts"
115
116INSANE_SKIP:${PN}-perl = "dev-so"
117INSANE_SKIP:${PN}-python = "dev-so"
118
119FILES_SOLIBSDEV:append = " ${libdir}/graphviz/lib*${SOLIBSDEV}"
120
Andrew Geissler78b72792022-06-14 06:47:25 -0500121RRECOMMENDS:${PN} = "liberation-fonts"
122
Andrew Geissler9aee5002022-03-30 16:27:02 +0000123BBCLASSEXTEND = "native nativesdk"