From patchwork Thu May 9 19:37:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Olivain X-Patchwork-Id: 1933584 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vb2Ns6ztcz20fc for ; Fri, 10 May 2024 05:38:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6364040701; Thu, 9 May 2024 19:38:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id mW74ISzPSba9; Thu, 9 May 2024 19:38:02 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5488541EF2 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 5488541EF2; Thu, 9 May 2024 19:38:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 196081BF2EC for ; Thu, 9 May 2024 19:38:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0638B41DE0 for ; Thu, 9 May 2024 19:38:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FYUGexNPN0RH for ; Thu, 9 May 2024 19:37:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:e0c:1:1599::10; helo=smtp1-g21.free.fr; envelope-from=ju.o@free.fr; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 21036405C8 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 21036405C8 Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [IPv6:2a01:e0c:1:1599::10]) by smtp2.osuosl.org (Postfix) with ESMTPS id 21036405C8 for ; Thu, 9 May 2024 19:37:58 +0000 (UTC) Received: from home.juju.sh (unknown [IPv6:2a01:e0a:485:b220:8213:2270:4a8d:a1d5]) (Authenticated sender: ju.o@free.fr) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 524FAB0051B; Thu, 9 May 2024 21:37:53 +0200 (CEST) From: Julien Olivain To: buildroot@buildroot.org Date: Thu, 9 May 2024 21:37:36 +0200 Message-ID: <20240509193737.168634-1-ju.o@free.fr> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1715283475; bh=H8V9qAJGRngjx8DioqAKI7RWXd/AxN41OtFb1wWY6bQ=; h=From:To:Cc:Subject:Date:From; b=qkl8QfjX749AtmiePS/S1wenh9ffQv3vD0oBb/uQ72o5jakz8WQpwW+9K4LjKPUoT uBlr5G3WmY67SFD9F1w/fm8Y0lyf2fwlbFQwUPHvlZJ8NlKyLbBFNyJ3BZKnQVa/11 M84MQrUXdma7dsbtAWVsOF8BOLMRxF50GZsPEfYI8+m1XTWn8nw2F8vZIG2dmFll3K BDLEEDy3yEZP8ls7FHf3d19cZikJrHkwk88qaPvYUGnHeygqCSPFt4VF8W1RbQ8crX RT+BRzmzB95UEUW9NS45OCn78MiRBZ7uaMAUcaN5hdmD+dLEsZZDSrO46g2tnIcgYo oB1WT/Fy/3cRQ== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=free.fr X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=free.fr header.i=@free.fr header.a=rsa-sha256 header.s=smtp-20201208 header.b=qkl8QfjX Subject: [Buildroot] [PATCH 1/2] package/zbar: add the optional imagemagick dependency X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Olivain , Volkov Viacheslav Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" When ImageMagick is selected, the "zbarimg" program is compiled and installed on target. It allows to decode a QR code from an image file. Signed-off-by: Julien Olivain --- package/zbar/zbar.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/zbar/zbar.mk b/package/zbar/zbar.mk index 0e79004bb30..86f33796a24 100644 --- a/package/zbar/zbar.mk +++ b/package/zbar/zbar.mk @@ -18,7 +18,6 @@ ZBAR_CONF_ENV = \ LIBS=$(TARGET_NLS_LIBS) ZBAR_CONF_OPTS = \ --disable-doc \ - --without-imagemagick \ --without-qt \ --without-qt5 \ --without-gtk \ @@ -32,6 +31,13 @@ else ZBAR_CONF_OPTS += --without-dbus endif +ifeq ($(BR2_PACKAGE_IMAGEMAGICK),y) +ZBAR_DEPENDENCIES += imagemagick +ZBAR_CONF_OPTS += --with-imagemagick +else +ZBAR_CONF_OPTS += --without-imagemagick +endif + ifeq ($(BR2_PACKAGE_PYTHON3),y) ZBAR_DEPENDENCIES += host-python3 python3 ZBAR_CONF_OPTS += --with-python=python3 From patchwork Thu May 9 19:37:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Olivain X-Patchwork-Id: 1933585 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vb2P05741z20fc for ; Fri, 10 May 2024 05:38:12 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D419241FB2; Thu, 9 May 2024 19:38:10 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OVgy38Z9NS2g; Thu, 9 May 2024 19:38:10 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B220741F9B Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B220741F9B; Thu, 9 May 2024 19:38:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4398B1BF2EC for ; Thu, 9 May 2024 19:38:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 38DAB83F97 for ; Thu, 9 May 2024 19:38:07 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WSDwLh9Mk7J6 for ; Thu, 9 May 2024 19:38:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:e0c:1:1599::10; helo=smtp1-g21.free.fr; envelope-from=ju.o@free.fr; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 6521B83F44 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6521B83F44 Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [IPv6:2a01:e0c:1:1599::10]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6521B83F44 for ; Thu, 9 May 2024 19:38:06 +0000 (UTC) Received: from home.juju.sh (unknown [IPv6:2a01:e0a:485:b220:8213:2270:4a8d:a1d5]) (Authenticated sender: ju.o@free.fr) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 0E557B0051E; Thu, 9 May 2024 21:38:01 +0200 (CEST) From: Julien Olivain To: buildroot@buildroot.org Date: Thu, 9 May 2024 21:37:37 +0200 Message-ID: <20240509193737.168634-2-ju.o@free.fr> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240509193737.168634-1-ju.o@free.fr> References: <20240509193737.168634-1-ju.o@free.fr> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1715283484; bh=yX0e6f0UUnZ4PaOo07NXDPjhlzcH5c22YaGSpdJENm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/WbokPIPdKxDH83GPmkpV9YOrrf8jrR7ehfDjRZ0QK9wiWd/g8gIXMLzSLvP/XMj nEM2uocbXQ4cymeglF92nnURKaeGAkyFC2zKPOGLMIvl4qETEyiHNNK0KX3utIURLZ 5074AH4CiSjS2bvDcOvUqFYZMwDclCnlBdzH9lpJAt+Xwlao/EvZfaJDM6qfYnz+1d dura7oBOA2cOBBeKrb83Wgh8hZLbvJfh6idrNsC5HbpbipfsCg0B2mnzVcUqbcRkX1 W3S44wzOf7jVhumD8ZmMMqCAGtokgq56LptDx7o0tXesTIGuVEXlv/3nL39BfQNJbV mkUSf0otdT8AA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=free.fr X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=free.fr header.i=@free.fr header.a=rsa-sha256 header.s=smtp-20201208 header.b=T/WbokPI Subject: [Buildroot] [PATCH 2/2] support/testing: add zbar runtime test X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Olivain , Volkov Viacheslav Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Julien Olivain --- Patch tested on branch master at commit 1223c11 with commands: make check-package ... 0 warnings generated support/testing/run-tests \ -d dl -o output_folder \ tests.package.test_zbar ... OK --- DEVELOPERS | 1 + support/testing/tests/package/test_zbar.py | 37 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 support/testing/tests/package/test_zbar.py diff --git a/DEVELOPERS b/DEVELOPERS index ce0c7d62ded..b60321f01fa 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1900,6 +1900,7 @@ F: support/testing/tests/package/test_wine.py F: support/testing/tests/package/test_xz.py F: support/testing/tests/package/test_z3.py F: support/testing/tests/package/test_z3/ +F: support/testing/tests/package/test_zbar.py F: support/testing/tests/package/test_zchunk.py F: support/testing/tests/package/test_zstd.py diff --git a/support/testing/tests/package/test_zbar.py b/support/testing/tests/package/test_zbar.py new file mode 100644 index 00000000000..b840df089af --- /dev/null +++ b/support/testing/tests/package/test_zbar.py @@ -0,0 +1,37 @@ +import os + +import infra.basetest + + +class TestZbar(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_IMAGEMAGICK=y + BR2_PACKAGE_LIBQRENCODE=y + BR2_PACKAGE_LIBQRENCODE_TOOLS=y + BR2_PACKAGE_ZBAR=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + txt_msg = "Hello Buildroot!" + qr_img = "qr.png" + + # We check the program can execute. + self.assertRunOk("zbarimg --version") + + # We generate a QR code image containing a message. + self.assertRunOk(f"qrencode -o '{qr_img}' '{txt_msg}'") + + # We decode the QR code image and check the extracted message + # is the expected one. + out, ret = self.emulator.run(f"zbarimg -q --raw {qr_img}") + self.assertEqual(ret, 0) + self.assertEqual(out[0], txt_msg)