From patchwork Mon Mar 28 09:09:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai X-Patchwork-Id: 5907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA601C433EF for ; Mon, 28 Mar 2022 09:09:16 +0000 (UTC) Received: from mail1.wrs.com (mail1.wrs.com [147.11.3.146]) by mx.groups.io with SMTP id smtpd.web08.8837.1648458555191263829 for ; Mon, 28 Mar 2022 02:09:16 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 147.11.3.146, mailfrom: kai.kang@windriver.com) Received: from mail.windriver.com (mail.wrs.com [147.11.1.11]) by mail1.wrs.com (8.15.2/8.15.2) with ESMTPS id 22S99DfA021354 (version=TLSv1.1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 28 Mar 2022 02:09:13 -0700 Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.corp.ad.wrs.com [147.11.82.252]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 22S99CWq023148 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 28 Mar 2022 02:09:13 -0700 (PDT) Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 28 Mar 2022 02:09:12 -0700 Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 28 Mar 2022 02:09:12 -0700 Received: from pek-lpg-core3.wrs.com (128.224.153.232) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Mon, 28 Mar 2022 02:09:11 -0700 From: To: Subject: [meta-oe][PATCH] graphviz: add pkg_postinst script Date: Mon, 28 Mar 2022 17:09:09 +0800 Message-ID: <20220328090909.29481-1-kai.kang@windriver.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 28 Mar 2022 09:09:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/96225 From: Kai Kang It needs to run `dot -c` first before call 'dot' command, otherwise it fails with: | Format: "png" not recognized. No formats found. | Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins? Signed-off-by: Kai Kang --- .../graphviz/graphviz_2.50.0.bb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-graphics/graphviz/graphviz_2.50.0.bb b/meta-oe/recipes-graphics/graphviz/graphviz_2.50.0.bb index 0eca7fdba..04e5eaa6a 100644 --- a/meta-oe/recipes-graphics/graphviz/graphviz_2.50.0.bb +++ b/meta-oe/recipes-graphics/graphviz/graphviz_2.50.0.bb @@ -17,7 +17,7 @@ DEPENDS = " \ DEPENDS:append:class-target = " ${BPN}-native" DEPENDS:append:class-nativesdk = " ${BPN}-native" -inherit autotools-brokensep pkgconfig gettext +inherit autotools-brokensep pkgconfig gettext qemu SRC_URI = "https://gitlab.com/api/v4/projects/4207231/packages/generic/${BPN}-releases/${PV}/${BP}.tar.xz \ " @@ -81,6 +81,21 @@ graphviz_sstate_postinst() { } SYSROOT_PREPROCESS_FUNCS:append:class-native = " graphviz_sstate_postinst" +pkg_postinst:${PN} () { + if [ -n "$D" ]; then + ${@qemu_run_binary(d, '$D', '${bindir}/dot')} -c + else + dot -c + fi +} + +pkg_postrm:${PN} () { + rm -f $D${libdir}/graphviz/config* + rmdir --ignore-fail-on-non-empty $D${libdir}/graphviz +} + +PACKAGE_WRITE_DEPS += "qemu-native" + PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo" FILES:${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/"