From patchwork Sat Nov 9 17:55:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Olivain X-Patchwork-Id: 2009104 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=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4Xm3Pf1w0jz1xy0 for ; Sun, 10 Nov 2024 04:55:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4BED6605B7; Sat, 9 Nov 2024 17:55:30 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YLDl5zZwuLlQ; Sat, 9 Nov 2024 17:55:29 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 59AD3605CB Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 59AD3605CB; Sat, 9 Nov 2024 17:55:29 +0000 (UTC) X-Original-To: buildroot@buildroot.org Delivered-To: buildroot@buildroot.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id A7161C2 for ; Sat, 9 Nov 2024 17:55:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 91D1040167 for ; Sat, 9 Nov 2024 17:55:27 +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 QER-_ggRc6Vg for ; Sat, 9 Nov 2024 17:55:26 +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 2F74B400D0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2F74B400D0 Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [IPv6:2a01:e0c:1:1599::10]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2F74B400D0 for ; Sat, 9 Nov 2024 17:55:25 +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 F1EC6B00579; Sat, 9 Nov 2024 18:55:19 +0100 (CET) From: Julien Olivain To: buildroot@buildroot.org Cc: Julien Olivain , Zoltan Gyarmati Date: Sat, 9 Nov 2024 18:55:08 +0100 Message-ID: <20241109175509.1364647-1-ju.o@free.fr> X-Mailer: git-send-email 2.47.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=1731174922; bh=/nkULZz3eG+tlMEvImRWBmXq7U8vV98Zp1Ecvpsh1io=; h=From:To:Cc:Subject:Date:From; b=sbEJj5x+Z/EBLwZC5Axi0AIWZkwgugfLoKjG3B2O3WVQGB8U6BldtL51uEOcuU6Wy Yp3mCrmj2nPZRL67bq4QT4i+vLKSBg7plQBuEwwHR4YlFtcbOYDqdDSk+Nlbi0sUb0 gRBK1H3eyFaSllmjlvpVCB/WdqKj9mJbbhM3j4Y2T1nBU+FnIO77cL1T31HuotcJLU L9XWwELAZwWNhHayMk5UaqNtlEhqFS1UOCRzrl8U4tkOdthyQ0QfNB99CgsS17KG7G z3pFFWeTn+hPziIvuTsJtwaDTvGzesEGwn/fF/vOvpuKNVQ3CKUtWp4mNsv9y8Q2sF qRtDLSdFYwZLA== 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=sbEJj5x+ Subject: [Buildroot] [PATCH 1/2] package/proj: add an option to build and install apps X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The proj package includes command line applications. Those have always been disabled in Buildroot. Those applications can be useful for scripting, and also for runtime testing the libraries. This commit adds a package Kconfig option to enable those apps. Signed-off-by: Julien Olivain Tested-by: Zoltan Gyarmati Acked-by: Zoltan Gyarmati --- package/proj/Config.in | 12 ++++++++++++ package/proj/proj.mk | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package/proj/Config.in b/package/proj/Config.in index 6d172e2ee9..86966a4d10 100644 --- a/package/proj/Config.in +++ b/package/proj/Config.in @@ -14,6 +14,18 @@ config BR2_PACKAGE_PROJ http://proj4.org/ +if BR2_PACKAGE_PROJ + +config BR2_PACKAGE_PROJ_APPS + bool "build apps" + select BR2_PACKAGE_LIBCURL + help + Build and install proj command line apps. Those command line + applications are: cct, cs2cs, geod, gie, invgeod, invproj, + proj, projinfo, projsync. + +endif + comment "proj needs a toolchain w/ C++, gcc >= 4.7, NPTL, wchar" depends on !BR2_INSTALL_LIBSTDCPP || \ !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || \ diff --git a/package/proj/proj.mk b/package/proj/proj.mk index a17a0a1feb..d6457b0e5b 100644 --- a/package/proj/proj.mk +++ b/package/proj/proj.mk @@ -20,7 +20,7 @@ PROJ_CXXFLAGS += -O0 endif PROJ_CONF_OPTS = \ - -DBUILD_APPS=OFF \ + -DBUILD_APPS=$(if $(BR2_PACKAGE_PROJ_APPS),ON,OFF) \ -DCMAKE_C_FLAGS="$(PROJ_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$(PROJ_CXXFLAGS)" From patchwork Sat Nov 9 17:55:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Olivain X-Patchwork-Id: 2009105 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::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (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 4Xm3Ph1CJxz1xy0 for ; Sun, 10 Nov 2024 04:55:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 45CC280F3B; Sat, 9 Nov 2024 17:55:34 +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 UI_ZrelF2zvf; Sat, 9 Nov 2024 17:55:33 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 458C680F45 Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 458C680F45; Sat, 9 Nov 2024 17:55:33 +0000 (UTC) X-Original-To: buildroot@buildroot.org Delivered-To: buildroot@buildroot.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id EDA49D92 for ; Sat, 9 Nov 2024 17:55:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D9B41403BB for ; Sat, 9 Nov 2024 17:55:31 +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 laWDrEfVBgoi for ; Sat, 9 Nov 2024 17:55:29 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.27.42.1; helo=smtp1-g21.free.fr; envelope-from=ju.o@free.fr; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 4C746403BD DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4C746403BD Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by smtp4.osuosl.org (Postfix) with ESMTPS id 4C746403BD for ; Sat, 9 Nov 2024 17:55:29 +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 BB405B00571; Sat, 9 Nov 2024 18:55:23 +0100 (CET) From: Julien Olivain To: buildroot@buildroot.org Cc: Julien Olivain , Zoltan Gyarmati Date: Sat, 9 Nov 2024 18:55:09 +0100 Message-ID: <20241109175509.1364647-2-ju.o@free.fr> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241109175509.1364647-1-ju.o@free.fr> References: <20241109175509.1364647-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=1731174927; bh=1qHjVcvN/E4QG1VyCh0KyFbKbKoLsWXI5l3qWSb95FE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YIQ1OSURwfN1DWP3bliW3Quid0raOM+h2Bi2tRXykypffVVIrSzF11j9k0x3VKDTx ldC6N8l422sxFglB4/lpTDvd+RWD9dfm22IiI8jtpPRXsa/nDnC5pG+WInaLa6jKUG +PIou50F9gwSf5UNVBu9GXAcm9osLO0frzSqKHARQDWPiDhHG5M6pVpwKFPTXjVLXv t8mREyZMHPbJgthkDkV3TJP8uMyeF31CMzaNcAi2sWtQg0YC4u14KJKOInmfHodYS+ uKIeyZiOTxhMPqo9OLhm4FDaJWcb5JsSYfjxvu6iKctPpLyNEpfgb3CWu1B7CS2jkT zzAa4GDWoN5nw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=free.fr X-Mailman-Original-Authentication-Results: smtp4.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=YIQ1OSUR Subject: [Buildroot] [PATCH 2/2] support/testing: new proj runtime test X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Julien Olivain Tested-by: Zoltan Gyarmati Reviewed-by: Zoltan Gyarmati --- Patch series runtime tested in: https://gitlab.com/jolivain/buildroot/-/jobs/8316072722 --- DEVELOPERS | 1 + support/testing/tests/package/test_proj.py | 59 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 support/testing/tests/package/test_proj.py diff --git a/DEVELOPERS b/DEVELOPERS index 1d70e46e8d..1eb2a58502 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1970,6 +1970,7 @@ F: support/testing/tests/package/test_pigz.py F: support/testing/tests/package/test_postgresql.py F: support/testing/tests/package/test_pppd.py F: support/testing/tests/package/test_pppd/ +F: support/testing/tests/package/test_proj.py F: support/testing/tests/package/test_pv.py F: support/testing/tests/package/test_python_distro.py F: support/testing/tests/package/test_python_gnupg.py diff --git a/support/testing/tests/package/test_proj.py b/support/testing/tests/package/test_proj.py new file mode 100644 index 0000000000..ed23c229fd --- /dev/null +++ b/support/testing/tests/package/test_proj.py @@ -0,0 +1,59 @@ +import os + +import infra.basetest + + +class TestProj(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_PROJ=y + BR2_PACKAGE_PROJ_APPS=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() + + # We check the program can run. The "proj" command does not + # have a "--version" option. It will just show its version + # when invoked without any argument. + self.assertRunOk("proj") + + # The commands in this tests are taken from the Proj + # documentation quickstart page, at: + # https://proj.org/en/9.5/usage/quickstart.html + + proj_str = "+proj=merc +lat_ts=56.5 +ellps=GRS80" + cmd = "echo 55.2 12.2" + cmd += f" | proj {proj_str}" + out, ret = self.emulator.run(cmd) + self.assertEqual(ret, 0) + expected_values = [3399483.80, 752085.60] + values = list(map(lambda x: float(x), out[0].split())) + for i in range(len(expected_values)): + self.assertAlmostEqual(values[i], expected_values[i]) + + proj_str = "+proj=merc +lat_ts=56.5 +ellps=GRS80 +to +proj=utm +zone=32" + cmd = "echo 3399483.80 752085.60" + cmd += f" | cs2cs {proj_str}" + out, ret = self.emulator.run(cmd) + self.assertEqual(ret, 0) + expected_values = [6103992.36, 1924052.47, 0.00] + values = list(map(lambda x: float(x), out[0].split())) + for i in range(len(expected_values)): + self.assertAlmostEqual(values[i], expected_values[i]) + + proj_str = "+init=epsg:4326 +to +init=epsg:25832" + cmd = "echo 56 12" + cmd += f" | cs2cs {proj_str}" + out, ret = self.emulator.run(cmd) + self.assertEqual(ret, 0) + expected_values = [6231950.54, 1920310.71, 0.00] + values = list(map(lambda x: float(x), out[0].split())) + for i in range(len(expected_values)): + self.assertAlmostEqual(values[i], expected_values[i])