blob: 4d40ee4dee3843435c6e11a2167ec2b4310a5c73 [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 \
Andrew Geissler20137392023-10-12 04:59:14 -060022 file://0001-Autotools-fix-do-not-put-prefix-based-paths-in-compi.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000023 "
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"
Andrew Geissler8f840682023-07-21 09:09:43 -050031SRC_URI[sha256sum] = "d593695fdaa8a19297523b679ad13d3ef2027b0b7f14cc2bc23e77969ed81565"
Andrew Geissler9aee5002022-03-30 16:27:02 +000032
33PACKAGECONFIG ??= "librsvg"
34PACKAGECONFIG[librsvg] = "--with-librsvg,--without-librsvg,librsvg"
35
Andrew Geissler8f840682023-07-21 09:09:43 -050036EXTRA_OECONF:append = " PS2PDF=/bin/echo --disable-man-pdfs"
Andrew Geissler9aee5002022-03-30 16:27:02 +000037
38EXTRA_OECONF:class-target = "\
39 --with-expatincludedir=${STAGING_INCDIR} \
40 --with-expatlibdir=${STAGING_LIBDIR} \
41 --without-included-ltdl \
42 --disable-java \
43 --disable-tcl \
44 --disable-r \
45 --disable-sharp \
46 "
47EXTRA_OECONF:class-nativesdk = "\
48 --with-expatincludedir=${STAGING_INCDIR} \
49 --with-expatlibdir=${STAGING_LIBDIR} \
50 --without-included-ltdl \
51 --disable-java \
52 --disable-tcl \
53 --disable-r \
54 --disable-sharp \
55 "
Andrew Geissler517393d2023-01-13 08:55:19 -060056EXTRA_OECONF:class-native = "\
57 --disable-tcl \
58 "
Andrew Geissler9aee5002022-03-30 16:27:02 +000059CFLAGS:append:class-target = " -D_typ_ssize_t=1 -D_long_double=1"
60CFLAGS:append:class-nativesdk = " -D_typ_ssize_t=1 -D_long_double=1"
61do_configure:prepend() {
62 cd ${S}
63 # create version.m4 and ignore libtoolize errors
64 ./autogen.sh NOCONFIG || true
65}
66
67do_install:append:class-nativesdk() {
68 # graphviz-setup.sh must be executed at SDK installation
69 install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
70 install -m 0755 ${WORKDIR}/graphviz-setup.sh ${D}${SDKPATHNATIVE}/post-relocate-setup.d
71}
72FILES:${PN}:class-nativesdk += "${SDKPATHNATIVE}"
73
74# create /usr/lib/graphviz/config6
75graphviz_sstate_postinst() {
76 mkdir -p ${SYSROOT_DESTDIR}${bindir}
77 dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
78 echo '#!/bin/sh' > $dest
79 echo '' >> $dest
80 echo 'dot -c' >> $dest
81 chmod 0755 $dest
82}
83SYSROOT_PREPROCESS_FUNCS:append:class-native = " graphviz_sstate_postinst"
84
85pkg_postinst:${PN} () {
86 if [ -n "$D" ]; then
87 if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then
88 ${@qemu_run_binary(d, '$D', '${bindir}/dot')} -c
89 fi
90 else
91 dot -c
92 fi
93}
94
95pkg_postrm:${PN} () {
96 rm -f $D${libdir}/graphviz/config*
97 rmdir --ignore-fail-on-non-empty $D${libdir}/graphviz
98}
99
100PACKAGE_WRITE_DEPS += "qemu-native"
101
102PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo"
103
104FILES:${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/"
105FILES:${PN}-perl += "${libdir}/perl5/*/vendor_perl/ ${libdir}/graphviz/perl/"
106FILES:${PN}-demo += "${datadir}/graphviz/demo/"
107
108RDEPENDS:${PN}-perl += "perl"
109RDEPENDS:${PN}-python += "python3"
110RDEPENDS:${PN}-demo += "python3 perl"
111
112RRECOMMENDS:${PN} = "liberation-fonts"
113
114INSANE_SKIP:${PN}-perl = "dev-so"
115INSANE_SKIP:${PN}-python = "dev-so"
116
117FILES_SOLIBSDEV:append = " ${libdir}/graphviz/lib*${SOLIBSDEV}"
118
Andrew Geissler78b72792022-06-14 06:47:25 -0500119RRECOMMENDS:${PN} = "liberation-fonts"
120
Andrew Geissler9aee5002022-03-30 16:27:02 +0000121BBCLASSEXTEND = "native nativesdk"