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