blob: a9258e979ac066dc451a7317c1cfa5d50c4dc5de [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
34PACKAGECONFIG ??= "librsvg"
35PACKAGECONFIG[librsvg] = "--with-librsvg,--without-librsvg,librsvg"
36
37EXTRA_OECONF:append = " PS2PDF=/bin/echo"
38
39EXTRA_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 "
48EXTRA_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 "
57CFLAGS:append:class-target = " -D_typ_ssize_t=1 -D_long_double=1"
58CFLAGS:append:class-nativesdk = " -D_typ_ssize_t=1 -D_long_double=1"
59do_configure:prepend() {
60 cd ${S}
61 # create version.m4 and ignore libtoolize errors
62 ./autogen.sh NOCONFIG || true
63}
64
65do_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}
70FILES:${PN}:class-nativesdk += "${SDKPATHNATIVE}"
71
72# create /usr/lib/graphviz/config6
73graphviz_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}
81SYSROOT_PREPROCESS_FUNCS:append:class-native = " graphviz_sstate_postinst"
82
83pkg_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
93pkg_postrm:${PN} () {
94 rm -f $D${libdir}/graphviz/config*
95 rmdir --ignore-fail-on-non-empty $D${libdir}/graphviz
96}
97
98PACKAGE_WRITE_DEPS += "qemu-native"
99
100PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo"
101
102FILES:${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/"
103FILES:${PN}-perl += "${libdir}/perl5/*/vendor_perl/ ${libdir}/graphviz/perl/"
104FILES:${PN}-demo += "${datadir}/graphviz/demo/"
105
106RDEPENDS:${PN}-perl += "perl"
107RDEPENDS:${PN}-python += "python3"
108RDEPENDS:${PN}-demo += "python3 perl"
109
110RRECOMMENDS:${PN} = "liberation-fonts"
111
112INSANE_SKIP:${PN}-perl = "dev-so"
113INSANE_SKIP:${PN}-python = "dev-so"
114
115FILES_SOLIBSDEV:append = " ${libdir}/graphviz/lib*${SOLIBSDEV}"
116
117BBCLASSEXTEND = "native nativesdk"