From patchwork Wed Feb 8 15:25:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 19221 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 6FB15C64EC4 for ; Wed, 8 Feb 2023 15:25:55 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web10.538.1675869949442391499 for ; Wed, 08 Feb 2023 07:25:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=AX3EAM3c; spf=none, err=SPF record not found (domain: bgdev.pl, ip: 209.85.221.43, mailfrom: brgl@bgdev.pl) Received: by mail-wr1-f43.google.com with SMTP id bu23so1280870wrb.8 for ; Wed, 08 Feb 2023 07:25:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ryApW3BI9u5VA1hnBIPLuwck8hwesSlW6XcaboKPujU=; b=AX3EAM3chXmdojCe324sV0O2cfcbvJmSpr+M310D9n3UaYChiuurK1gepfTJ/BQTFJ gJSukyJqgeqct/xDUsTEVcSYl/ROUWMABjpE6aK+YypzDO8k1H0LC2O6zXD+6mIZOyvV foF6I9WRRrSYFQ9DySz8JZblux6cEnL5hx2MBmbuRR4bmh2OVh/Chh8NjjZ5ObHNEjYT xShT7R8WXRfOmx8XbCMeie9nhvI5528fSaszRmAqABRJVo7aaCxl17mWkIaDjF1GAo15 IFWKIeMGkpAF0e8KV4YniRp1PupGSzS4bhDO931IAYZ3fYR+Ds4Nz+wXKRvg/sjxIefb Bwcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ryApW3BI9u5VA1hnBIPLuwck8hwesSlW6XcaboKPujU=; b=ASZlVtaRY/eL8VCHvokFhNk7N/QHJ1CWbvc2mQWEpQT8ParCWaNj+NLuuMugPnAKtk 4v49YP2ATbJprXHu5CrI99fZ2tW0LbA3bSeL32BgmWCc++lAbhI4qhQ0CjZvXAwW4cpL J8ewW5j70kdWWFogMFc8N3m2CNQSk6AuF6mwvPH6hBzEngiY2llN3qOm1zz3GoNDPfs9 DIhnPk4ir0SSqTRRb71OnWwKSZwsTfDOY67Ms3eqhGOgecd1hk+laYVhbXhv02msMCWW KperLepHMmTBv1BOMZX7cL6a7NoOGqUIsp2sjpGDL51C+Ww2Oo0Oi79Ud7scAjjlMV1m ZOHQ== X-Gm-Message-State: AO0yUKWVphPCqyhp0aoqBUyI+i9QwQz4WbGLcGdlou5rqRzW7czYV+4O XD9tgmWxjDRV2+ngTjPSzkbXAQ== X-Google-Smtp-Source: AK7set8md+lMevdyHT4jQgqr3tdtkryMQPq1CTDpShvpvcnMOI15YxKnYDF8p5rK7kgYS+TkRuIE/A== X-Received: by 2002:a5d:4352:0:b0:2c2:6541:7afc with SMTP id u18-20020a5d4352000000b002c265417afcmr7076796wrr.64.1675869947706; Wed, 08 Feb 2023 07:25:47 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a9fe:4fba:ab76:6149]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c3b8200b003dfe659f9b1sm6713239wms.3.2023.02.08.07.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:25:47 -0800 (PST) From: Bartosz Golaszewski To: Khem Raj , Bruce Ashfield , openembedded-devel@lists.openembedded.org Cc: Bartosz Golaszewski Subject: [meta-oe][PATCH 1/3] libgpiod: update to v1.6.4 Date: Wed, 8 Feb 2023 16:25:39 +0100 Message-Id: <20230208152541.136848-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230208152541.136848-1-brgl@bgdev.pl> References: <20230208152541.136848-1-brgl@bgdev.pl> 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 ; Wed, 08 Feb 2023 15:25:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/100998 From: Bartosz Golaszewski This is a bug-fix release bringing in several fixes for build and testing issues. Remove the patch that's already present in this release. Signed-off-by: Bartosz Golaszewski --- ...-don-t-expect-automake-to-set-PYTHON.patch | 37 ------------------- .../{libgpiod_1.6.3.bb => libgpiod_1.6.4.bb} | 5 +-- 2 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch rename meta-oe/recipes-support/libgpiod/{libgpiod_1.6.3.bb => libgpiod_1.6.4.bb} (93%) diff --git a/meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch b/meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch deleted file mode 100644 index a3dc38188..000000000 --- a/meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3c461786feb1d5aa1ed2a911942a5f9fbc8b8086 Mon Sep 17 00:00:00 2001 -From: Bartosz Golaszewski -Date: Tue, 24 Jan 2023 17:38:43 +0100 -Subject: [libgpiod v1.6.x][PATCH] build: don't expect automake to set $PYTHON - -It seems that the implementation of AM_PATH_PYTHON() changed in automake -recently and no longer sets $PYTHON variable which breaks the build on -some systems. - -We know we use python3 so use python3-config explicitly. - -Signed-off-by: Bartosz Golaszewski ---- -Upstream-Status: Accepted - - configure.ac | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3149384..0460810 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -204,9 +204,9 @@ then - AC_MSG_ERROR([python3-config not found - needed for python bindings]) - fi - AS_IF([test -z "$PYTHON_CPPFLAGS"], -- [AC_SUBST(PYTHON_CPPFLAGS, [`$PYTHON-config --includes`])]) -+ [AC_SUBST(PYTHON_CPPFLAGS, [`python3-config --includes`])]) - AS_IF([test -z "$PYTHON_LIBS"], -- [AC_SUBST(PYTHON_LIBS, [`$PYTHON-config --libs`])]) -+ [AC_SUBST(PYTHON_LIBS, [`python3-config --libs`])]) - fi - - AC_CHECK_PROG([has_doxygen], [doxygen], [true], [false]) --- -2.37.2 - diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb similarity index 93% rename from meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb rename to meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb index 5164e7e02..70a77c883 100644 --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb @@ -7,11 +7,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" SRC_URI = " \ https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \ file://run-ptest \ - file://0001-build-don-t-expect-automake-to-set-PYTHON.patch \ " -SRC_URI[md5sum] = "28e79f6f70fee1da9079558d8b7b3736" -SRC_URI[sha256sum] = "841be9d788f00bab08ef22c4be5c39866f0e46cb100a3ae49ed816ac9c5dddc7" +SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc" +SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5" inherit autotools pkgconfig python3native ptest From patchwork Wed Feb 8 15:25:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 19222 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 6FBD8C64EC5 for ; Wed, 8 Feb 2023 15:25:55 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web11.543.1675869950331717944 for ; Wed, 08 Feb 2023 07:25:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=AQAMg4oG; spf=none, err=SPF record not found (domain: bgdev.pl, ip: 209.85.128.51, mailfrom: brgl@bgdev.pl) Received: by mail-wm1-f51.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so1735292wmb.2 for ; Wed, 08 Feb 2023 07:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Npn1WaG22IV81BF555c934wNQgGFGYHqerw0E+jBl6g=; b=AQAMg4oGaiG0lGAuCGRSkpaXfpQulUIod0GvUKuXZAU7DjztJJtlXknpTpWVnfhVAU 7+ELny6Bl8xmhD6IGP0Sg7dgoNyShNrVAgopM2C5CPPNMrRd8lhGimBYSKKNFdGPkARI uTdh26l3tmoylM8pC3O8JCt2gAERma4cpii1GWm+q4utEfVf1JJ2eCw2heuVV2WqetEU 0OrQPl5ESyyjYgTqmYSdDlT4RrgxzixKXg+J42Fk1fzZpTgiZfnGNGR785GYHSMUzOpi DuDrjj3fpJYS2Fwg0YT8V1I3yfz5Vn+8uzk4LZd+WtrEDk7MZ3t5PCmUL1BPzFhAasP4 wYOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Npn1WaG22IV81BF555c934wNQgGFGYHqerw0E+jBl6g=; b=S1zhmZ/XQwSTWOSgNg5qDu8RgBmV1JbrbePgeKDNdTaiTTdheEcLnLdMD+eEkeCsuA XKqQ8I+/pzNxhwhVNSGA6cO2a3iP6UZPt/fUPFGmwzs6nNMa3XtjOuFYCdE5O6L3FhG0 p+zxk8Uxnxc/6aPBllkViqilNofQrObtnadL0Sb8zuRXPXghFwHeG7pDTMrB1r6lTMp+ EOOpeyKMUNmmDwevUSsKAjR6vIoJ1/63QSE67r3cqvw7+U2OK65XJdts7uTvC2RZVQaY smTiDDWj9NvykDdhkaNWwqfss+ggVAjrwU8RyMddo0O+2Zse5Is1GSxmRLfIzyjdCV/J MsUg== X-Gm-Message-State: AO0yUKW5mfzpuA/H1I6FeZdSocA4K+JlEtuffkhtoKedyip2bdr1+tkE UqMSuA+ZN2Tv2Qz7Z6KGNe0j/A== X-Google-Smtp-Source: AK7set/4ZO2/lqdPZIB1Kl6jSsvTmlI6NgyWKyIPsZZcwaVfdVnnc52xITtdIorduoSvcBsDSFE5pg== X-Received: by 2002:a05:600c:4d22:b0:3db:1200:996e with SMTP id u34-20020a05600c4d2200b003db1200996emr6865242wmp.16.1675869948611; Wed, 08 Feb 2023 07:25:48 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a9fe:4fba:ab76:6149]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c3b8200b003dfe659f9b1sm6713239wms.3.2023.02.08.07.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:25:48 -0800 (PST) From: Bartosz Golaszewski To: Khem Raj , Bruce Ashfield , openembedded-devel@lists.openembedded.org Cc: Bartosz Golaszewski Subject: [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1 Date: Wed, 8 Feb 2023 16:25:40 +0100 Message-Id: <20230208152541.136848-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230208152541.136848-1-brgl@bgdev.pl> References: <20230208152541.136848-1-brgl@bgdev.pl> 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 ; Wed, 08 Feb 2023 15:25:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/100999 From: Bartosz Golaszewski This is a recipe for libgpiod v2 release candidate. Let's put common bits and pieces into an .inc file and the source fetching into a separate include that will be later reused by the python bindings that for v2 will be moved into a separate recipe in meta-python. Signed-off-by: Bartosz Golaszewski --- .../{files => libgpiod-1.6.4}/run-ptest | 0 .../libgpiod/libgpiod-2.0-rc1/run-ptest | 24 ++++++++ .../recipes-support/libgpiod/libgpiod-src.inc | 1 + meta-oe/recipes-support/libgpiod/libgpiod.inc | 61 +++++++++++++++++++ .../libgpiod/libgpiod_1.6.4.bb | 56 ++--------------- .../libgpiod/libgpiod_2.0-rc1.bb | 21 +++++++ 6 files changed, 113 insertions(+), 50 deletions(-) rename meta-oe/recipes-support/libgpiod/{files => libgpiod-1.6.4}/run-ptest (100%) create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-src.inc create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod.inc create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest similarity index 100% rename from meta-oe/recipes-support/libgpiod/files/run-ptest rename to meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest new file mode 100644 index 000000000..9475f0253 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest @@ -0,0 +1,24 @@ +#!/bin/sh + +testbins="gpiod-test gpio-tools-test gpiod-cxx-test" + +ptestdir=$(dirname "$(readlink -f "$0")") +cd $ptestdir/tests + +# libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to +# make sure configfs is mounted before running any tests. +modprobe configfs +mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config + +for testbin in $testbins; do + if test -e ./$testbin; then + ./$testbin > ./$testbin.out 2>&1 + if [ $? -ne 0 ]; then + echo "FAIL: $testbin" + else + echo "PASS: $testbin" + fi + else + echo "SKIP: $testbin" + fi +done diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-src.inc b/meta-oe/recipes-support/libgpiod/libgpiod-src.inc new file mode 100644 index 000000000..6bab4c1f4 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod-src.inc @@ -0,0 +1 @@ +SRC_URI += "https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz" diff --git a/meta-oe/recipes-support/libgpiod/libgpiod.inc b/meta-oe/recipes-support/libgpiod/libgpiod.inc new file mode 100644 index 000000000..abb6544ec --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc @@ -0,0 +1,61 @@ +SUMMARY = "C library and tools for interacting with the linux GPIO character device" +AUTHOR = "Bartosz Golaszewski " + +require libgpiod-src.inc + +inherit autotools pkgconfig ptest + +SRC_URI += "file://run-ptest" + +PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" + +# Enable cxx bindings by default. +PACKAGECONFIG ?= " \ + cxx \ + ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ +" + +# Always build tools - they don't have any additional +# requirements over the library. +EXTRA_OECONF = "--enable-tools" + +DEPENDS += "autoconf-archive-native" + +PACKAGES =+ "${PN}-tools libgpiodcxx" +FILES:${PN}-tools += " \ + ${bindir}/gpiodetect \ + ${bindir}/gpioinfo \ + ${bindir}/gpioget \ + ${bindir}/gpioset \ + ${bindir}/gpiomon \ +" +FILES:${PN}-ptest += " \ + ${bindir}/gpiod-test \ + ${bindir}/gpio-tools-test \ + ${bindir}/gpio-tools-test.bats \ + ${bindir}/gpiod-cxx-test \ +" +FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*" + +RRECOMMENDS:${PN}-ptest += "coreutils" +RDEPENDS:${PN}-ptest += "bats" + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests/ + + # These are the core C library tests + install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/ + + # Tools are always built so let's always install them for ptest even if + # we're not selecting libgpiod-tools. + install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/ + install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/ + for tool in ${FILES:${PN}-tools}; do + install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/ + done + + if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then + install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/ + fi +} + diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb index 70a77c883..df0e3f104 100644 --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb @@ -1,80 +1,36 @@ -SUMMARY = "C library and tools for interacting with the linux GPIO character device" -AUTHOR = "Bartosz Golaszewski " +require libgpiod.inc LICENSE = "LGPL-2.1-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" -SRC_URI = " \ - https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \ - file://run-ptest \ -" - -SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc" SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5" -inherit autotools pkgconfig python3native ptest +inherit python3native PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2" -PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3" -# Enable cxx bindings by default. -PACKAGECONFIG ?= "cxx \ - ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" - # Always build tools - they don't have any additional # requirements over the library. EXTRA_OECONF = "--enable-tools" -DEPENDS += "autoconf-archive-native" - -PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python" -FILES:${PN}-tools = " \ - ${bindir}/gpiodetect \ - ${bindir}/gpioinfo \ - ${bindir}/gpioget \ - ${bindir}/gpioset \ - ${bindir}/gpiofind \ - ${bindir}/gpiomon \ -" +PACKAGES =+ "${PN}-python" +FILES:${PN}-tools += "${bindir}/gpiofind" FILES:${PN}-ptest += " \ - ${bindir}/gpiod-test \ - ${bindir}/gpio-tools-test \ - ${bindir}/gpio-tools-test.bats \ - ${bindir}/gpiod-cxx-test \ ${bindir}/gpiod_py_test.py \ ${libdir}/libgpiomockup.so.* \ " -FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*" FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so" FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}" RRECOMMENDS:${PN}-ptest += " \ kernel-module-gpio-mockup \ - coreutils \ ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \ " -RDEPENDS:${PN}-ptest += "bats python3-packaging" - -do_install_ptest() { - install -d ${D}${PTEST_PATH}/tests - - # These are the core C library tests - install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/ - - # Tools are always built so let's always install them for ptest even if - # we're not selecting libgpiod-tools. - install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/ - install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/ - for tool in ${FILES:${PN}-tools}; do - install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/ - done - - if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then - install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/ - fi +RDEPENDS:${PN}-ptest += "python3-packaging" +do_install_ptest:append() { if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/ fi diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb new file mode 100644 index 000000000..6894932ee --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb @@ -0,0 +1,21 @@ +require libgpiod.inc + +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0" +LIC_FILES_CHKSUM = " \ + file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \ + file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \ +" + +SRC_URI[sha256sum] = "64a718e8f8e022afc1880bae0b6ddc874fca1ce1bf8a2ac88bab4ccca6b66a1e" + +S = "${WORKDIR}/libgpiod-2.0" + +# We must enable gpioset-interactive for all gpio-tools tests to pass +PACKAGECONFIG[tests] = "--enable-tests --enable-gpioset-interactive,--disable-tests,kmod util-linux glib-2.0 catch2 libedit" +PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit" + +FILES:${PN}-tools += "${bindir}/gpionotify" +FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*" + +RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim" From patchwork Wed Feb 8 15:25:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 19220 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 5EB5AC05027 for ; Wed, 8 Feb 2023 15:25:55 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.web10.541.1675869950861532711 for ; Wed, 08 Feb 2023 07:25:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=F6fVcuBw; spf=none, err=SPF record not found (domain: bgdev.pl, ip: 209.85.128.53, mailfrom: brgl@bgdev.pl) Received: by mail-wm1-f53.google.com with SMTP id m16-20020a05600c3b1000b003dc4050c94aso1756619wms.4 for ; Wed, 08 Feb 2023 07:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yijMRAhcpGUpwaLDewNuxZGUM/3gs1mO1+5hNrAm14Y=; b=F6fVcuBwPE8I9siQdSoYMVAB5V/j0aLBZVM/UYLvQ0EGKtw9umCOqUtuI7wd2lByHW 5WCPHU5lgG4zDezWGZDuiUfUBTYUoJZtVaXpqp3TNMSd7I1RBirbHLvi6vqY+NVXcyjB iJHRB8RkhMbEbZmzDfVVXgKarrBBAsHYb9ucvcqce+2/EWl2D1Tq0RBhEdBp85j7xMJz vukOzBRZtA1HO+J3IzPhPcOmC6/RPNgJDuAKoJfNjb+pe1HXo/1UP/Szsl+fNiHQ1mSx MtnAD9ksM8CzoCHrysXu2XyP54aA+E6tHwWUB+m6+PYM0MAB4VWMCWKAFBX46AdN6/AG yfxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yijMRAhcpGUpwaLDewNuxZGUM/3gs1mO1+5hNrAm14Y=; b=S9CPeCs7fZYCmTY7/fJyTPlhoM+7DI9oI0RPlryXWf5REBm2i0UcpJB+QuznGlRAEv 3MIY/bWmaNctWQyzOfhKpvimFGHK8W25nHyoXIxqdeK/Dklqhjxy4YxOVW/6mFHC2EiA plOccD3q6zxctcQYpx9UAjVOtSMIVTk9QIgdwhReD6NUrfV/TNTrk4kiH06TOT6SDCmS YLiCPdZ3OdY20ql9NK9mpzmdcYU8DIwkRM0hNNc4SL6mIv7NUeCCPVeY34t1HUxymaex EoxIoWTIU2U+KLWo100/T7tBRjKq4YEqM2NvagM8y5ueyJnIGZPQpgRBrDhSVCJsu+W/ XLqA== X-Gm-Message-State: AO0yUKXiWWMATlAgfa7SS1FLd2v5tFW8raBb/gIYG3l1LxNZIxzsS3yf uv84v8jjMWopuvKVlsL7hyx8Rg== X-Google-Smtp-Source: AK7set91FqOeTTxmthFf+xLRmBps/UqjToPCSxft+/HFB88YeIAz34wmFCoN3VK6ijRr1jGqqiBxzg== X-Received: by 2002:a05:600c:3317:b0:3e0:111:28a9 with SMTP id q23-20020a05600c331700b003e0011128a9mr6845918wmp.22.1675869949386; Wed, 08 Feb 2023 07:25:49 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a9fe:4fba:ab76:6149]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c3b8200b003dfe659f9b1sm6713239wms.3.2023.02.08.07.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:25:48 -0800 (PST) From: Bartosz Golaszewski To: Khem Raj , Bruce Ashfield , openembedded-devel@lists.openembedded.org Cc: Bartosz Golaszewski Subject: [meta-python][PATCH 3/3] python3-gpiod: new package Date: Wed, 8 Feb 2023 16:25:41 +0100 Message-Id: <20230208152541.136848-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230208152541.136848-1-brgl@bgdev.pl> References: <20230208152541.136848-1-brgl@bgdev.pl> 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 ; Wed, 08 Feb 2023 15:25:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/101000 From: Bartosz Golaszewski Add a recipe for libgpiod v2 python bindings. This is a release candidate but once the proper v2.0 is released, it will be made public on pypi and the recipe modified accordingly. As libgpiod python bindings now use setuptools and not make, we can separate the recipe from the rest of the library. Signed-off-by: Bartosz Golaszewski --- .../packagegroups/packagegroup-meta-python.bb | 1 + .../python/python3-gpiod/run-ptest | 15 +++++++ .../python/python3-gpiod_2.0-rc1.bb | 45 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-gpiod/run-ptest create mode 100644 meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb diff --git a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb index 2275ccd6c..2428674c4 100644 --- a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb +++ b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb @@ -157,6 +157,7 @@ RDEPENDS:packagegroup-meta-python3 = "\ python3-gmqtt \ python3-gnupg \ python3-google-api-python-client \ + python3-gpiod \ python3-gpsd-py3 \ python3-graphviz \ python3-greenlet \ diff --git a/meta-python/recipes-devtools/python/python3-gpiod/run-ptest b/meta-python/recipes-devtools/python/python3-gpiod/run-ptest new file mode 100644 index 000000000..bf1244b07 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-gpiod/run-ptest @@ -0,0 +1,15 @@ +#!/bin/sh + +cd $(dirname "$(readlink -f "$0")") + +# python3-gpiod uses gpio-sim - a configfs-based testing module. We need to +# make sure configfs is mounted before running any tests. +modprobe configfs +mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config + +python3 -m gpiod-test -v > ./python3-gpiod.out 2>&1 +if [ $? -ne 0 ]; then + echo "FAIL: python3-gpiod" +else + echo "PASS: python3-gpiod" +fi diff --git a/meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb b/meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb new file mode 100644 index 000000000..a05cc3619 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb @@ -0,0 +1,45 @@ +SUMMARY = "Python bindings for libgpiod." +AUTHOR = "Bartosz Golaszewski " + +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0" +LIC_FILES_CHKSUM = " \ + file://../../LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://../../LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \ + file://../../LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \ +" + +require recipes-support/libgpiod/libgpiod-src.inc + +SRC_URI += "file://run-ptest" + +SRC_URI[sha256sum] = "64a718e8f8e022afc1880bae0b6ddc874fca1ce1bf8a2ac88bab4ccca6b66a1e" +S = "${WORKDIR}/libgpiod-2.0/bindings/python" + +inherit setuptools3 ptest + +DEPENDS += "libgpiod" +RDEPENDS:${PN} += "libgpiod (>= 2.0)" +RDEPENDS:${PN}-ptest += "python3-setuptools" + +export GPIOD_WITH_TESTS = "${@bb.utils.contains("PTEST_ENABLED", "1", "1", "0", d)}" +PTEST_CFLAGS = "${@bb.utils.contains("PTEST_ENABLED", "1", "-I../../tests/gpiosim", "", d)}" +# Setuptools store full filesystem paths in DWARF files. Map them to './' to +# avoid QA warnings. +export CFLAGS = "${PTEST_CFLAGS} -fdebug-prefix-map=${B}=./" + +do_install:append() { + # Python setuptools have an issue where they install C extensions even if + # they're not in the list of packages to be packaged. This is how the test + # extensions end up being installed. Remove them here. + rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/tests/ +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/gpiod-test/gpiosim + install -d ${D}${PTEST_PATH}/gpiod-test/procname + install -m 0644 ${B}/tests/*.py ${D}${PTEST_PATH}/gpiod-test/ + install -m 0644 ${B}/build/lib*/tests/gpiosim/_ext* ${D}${PTEST_PATH}/gpiod-test/gpiosim + install -m 0644 ${B}/tests/gpiosim/*.py ${D}${PTEST_PATH}/gpiod-test/gpiosim + install -m 0644 ${B}/build/lib*/tests/procname/_ext* ${D}${PTEST_PATH}/gpiod-test/procname + install -m 0644 ${B}/tests/procname/*.py ${D}${PTEST_PATH}/gpiod-test/procname +}