From patchwork Sat Sep 21 14:53:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dan X-Patchwork-Id: 68267 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 996B027BBE9; Sat, 21 Sep 2024 15:55:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 411BD27BBE2 for ; Sat, 21 Sep 2024 15:55:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ss1VZ-0001Kh-1y; Sat, 21 Sep 2024 10:54:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ss1VV-0001JH-3M for guix-patches@gnu.org; Sat, 21 Sep 2024 10:54:45 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ss1VU-0006VJ-R4 for guix-patches@gnu.org; Sat, 21 Sep 2024 10:54:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=vDfSucveZIK50iLboYcGc5vUmcjj0CcgMcm/xqh1bqA=; b=svlvCvV5aJNmlv9pkuNGHnb+Xe3eCSbY+nnwzLZfcHXGh4EZdPyK1sR7d16L6Y2b9ZQZ9Zwi3hitE9GZT1hxAr63I+N2nYtVJU14v2C0/7xBc8C5M6nS6AGkh/TQFJLb4Ie3YnSEqwol5PboyMZJQJ754k7f6ygUs4QYOtmikDpBtnVHcldLa4Hwzie3ou/sOyRmebldMLGJt9/9Bnw8GhXjMwvv8OK9pjhgyKPUnKLMCBEhZfgG7TccskqKJkIoWGkGqHZyAraw7dp9ZfRvon43G1kEyqLKmXVv+HMV2jI6t0Pu15HsXIQdlQ5pLf7RB2O8EQZ50EectCDS61tDDg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ss1Vp-0004dq-3C; Sat, 21 Sep 2024 10:55:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71897] [PATCH v8 6/8] gnu: Add cpp-ada-url-parser. Resent-From: dan Original-Sender: "Debbugs-submit" Resent-CC: i@dan.games, maxim.cournoyer@gmail.com, liliana.prikler@gmail.com, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 21 Sep 2024 14:55:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71897 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71897@debbugs.gnu.org Cc: dan , Maxim Cournoyer , Liliana Marie Prikler , Sharlatan Hellseher X-Debbugs-Original-Xcc: dan , Maxim Cournoyer , Liliana Marie Prikler , Sharlatan Hellseher Received: via spool by 71897-submit@debbugs.gnu.org id=B71897.172693046217703 (code B ref 71897); Sat, 21 Sep 2024 14:55:05 +0000 Received: (at 71897) by debbugs.gnu.org; 21 Sep 2024 14:54:22 +0000 Received: from localhost ([127.0.0.1]:40160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss1V7-0004bI-6v for submit@debbugs.gnu.org; Sat, 21 Sep 2024 10:54:21 -0400 Received: from fout1-smtp.messagingengine.com ([103.168.172.144]:57403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss1V4-0004ae-2e for 71897@debbugs.gnu.org; Sat, 21 Sep 2024 10:54:18 -0400 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 8F951138013A for <71897@debbugs.gnu.org>; Sat, 21 Sep 2024 10:53:52 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Sat, 21 Sep 2024 10:53:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dan.games; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1726930432; x= 1727016832; bh=vDfSucveZIK50iLboYcGc5vUmcjj0CcgMcm/xqh1bqA=; b=a D9L472asxXtDc4sDIysQknNFEfbh6Xg3c5VkqnjNxbJHRIuQTSg5V5FtxSdDOhXh +9DTs12MmQIl9y/jf5H9DsiQzIRryoMC7xBNBF0igUKE/sKNQpNRvswz6rsOoTSf 4OK7SEC1aLB6YCjVmSqt3MNskMLmnf1drK5JTi/020yE/mnvWv6Nwl2/G73N2wxA 0KN+2jWpKpTnO+ES0M930hOLm/LKc0A4L9ezEFKBd9SBH+yzjPhrQrNuOGs16BzQ riiGByerfbjV9/IsglVRISt+Fapg5Od93Rpp8N+mNOM14IQjTe3kkpcZaB6GRKrg /wgGiVrirtWJJkM0kt4JQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1726930432; x=1727016832; bh=vDfSucveZIK50 iLboYcGc5vUmcjj0CcgMcm/xqh1bqA=; b=ST1XhWDMNKKDnAQB/+mDzCxK9xD30 KWA+A/JYxW50MAB/9PwoH1BOB9YOH3yG2AZ0gMTGM5xq2xPFXEMXMMibrvfsq5Gg Lp18Sk0MUsCSg31G5douYvxtWT7WvkqrlU4UcFk5CWc8dKKqxk3JSzM+toYFOav3 y6scpa96KytRoN4AzC+/onEhYbEGUhHwoAYaA02d+GMxZ/OXK87ZsLa0QL0vHSgt i7wdJ0Og9JD3LS8yWvqtYgjROggmLtTa2fpdWyIBHAeRRMmpEAKkpZYmi8R9n5Lj 1+Vej3MymolAufUxcW2zA8YhNdSS/EvlLMkab7/v0yuWjVSE6Pjf0B1Hw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelhedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuff fkofgjfhgggfestdekredtredttdenucfhrhhomhepuggrnhcuoehisegurghnrdhgrghm vghsqeenucggtffrrghtthgvrhhnpefhjedvfeekkefhheeiveeuueeftdejveejleeute eludelgedtueetfefhudeuvdenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihesuggrnhdrgh grmhgvshdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjedukeeljeesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i3b5946ed:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <71897@debbugs.gnu.org>; Sat, 21 Sep 2024 10:53:51 -0400 (EDT) From: dan Date: Sat, 21 Sep 2024 22:53:12 +0800 Message-ID: <2ae23a993d9f52c8a4fd5ef0aff148fa5ab4e509.1726930328.git.i@dan.games> X-Mailer: git-send-email 2.46.0 In-Reply-To: <5fddf9f718d95467cd90d9d2625d749af580205c.1726930328.git.i@dan.games> References: <5fddf9f718d95467cd90d9d2625d749af580205c.1726930328.git.i@dan.games> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/cpp-ada-url-parser-find-system-testing-dependencies.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/cpp.scm (cpp-ada-url-parser): New variable. Change-Id: I9924bba53ed58bbf306bf073c9724cd7bd6f570a --- gnu/local.mk | 1 + gnu/packages/cpp.scm | 26 ++++ ...ser-find-system-testing-dependencies.patch | 130 ++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 gnu/packages/patches/cpp-ada-url-parser-find-system-testing-dependencies.patch diff --git a/gnu/local.mk b/gnu/local.mk index 802f4be4fe..829c5e166e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1103,6 +1103,7 @@ dist_patch_DATA = \ %D%/packages/patches/cool-retro-term-wctype.patch \ %D%/packages/patches/coq-autosubst-1.8-remove-deprecated-files.patch \ %D%/packages/patches/coreutils-gnulib-tests.patch \ + %D%/packages/patches/cpp-ada-url-parser-find-system-testing-dependencies.patch\ %D%/packages/patches/cppcheck-disable-char-signedness-test.patch \ %D%/packages/patches/cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch\ %D%/packages/patches/cpulimit-with-glib-2.32.patch \ diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index c805dae825..92be49967f 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -3284,3 +3284,29 @@ (define-public tl-optional the std::optional for C++11/14/17, with support for monadic operations added in C++23.") (license license:cc0))) + +(define-public cpp-ada-url-parser + (package + (name "cpp-ada-url-parser") + (version "2.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ada-url/ada.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "0xvvjlia627ajl966gdxzy2b1j0jiimx7zx8ypmffwx0k6x72qam")) + (patches (search-patches "cpp-ada-url-parser-find-system-testing-dependencies.patch")))) + (build-system cmake-build-system) + (native-inputs + (list cxxopts + fmt + googletest + python + simdjson)) + (home-page "https://github.com/ada-url/ada") + (synopsis "URL parser") + (description "Ada is a fast and spec-compliant URL parser written in C++. +Specification for URL parser can be found from the WHATWG website.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/cpp-ada-url-parser-find-system-testing-dependencies.patch b/gnu/packages/patches/cpp-ada-url-parser-find-system-testing-dependencies.patch new file mode 100644 index 0000000000..b32d162530 --- /dev/null +++ b/gnu/packages/patches/cpp-ada-url-parser-find-system-testing-dependencies.patch @@ -0,0 +1,130 @@ +From 74cac57a3cebe0cfbbc44f46270d5e51986f4881 Mon Sep 17 00:00:00 2001 +From: dan +Date: Sat, 21 Sep 2024 18:49:10 +0800 +Subject: [PATCH] find system testing dependencies. + +--- + CMakeLists.txt | 50 +++++++++----------------------------- + singleheader/amalgamate.py | 2 +- + tools/cli/CMakeLists.txt | 8 ++---- + 3 files changed, 14 insertions(+), 46 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a7ce3796..0903cc31 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,43 +28,23 @@ option(ADA_TESTING "Build tests" ${BUILD_TESTING}) + # errors due to CPM, so this is here to support disabling all the testing + # and tooling for ada if one only wishes to use the ada library. + if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) +- include(cmake/CPM.cmake) +- # CPM requires git as an implicit dependency +- find_package(Git QUIET) + # We use googletest in the tests +- if(Git_FOUND AND ADA_TESTING) +- CPMAddPackage( +- NAME GTest +- GITHUB_REPOSITORY google/googletest +- VERSION 1.14.0 +- OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF" +- ) ++ if(ADA_TESTING) ++ find_package(GTest) + endif() + # We use simdjson in both the benchmarks and tests +- if(Git_FOUND AND (ADA_TESTING OR ADA_BENCHMARKS)) +- CPMAddPackage("gh:simdjson/simdjson@3.9.1") ++ if(ADA_TESTING OR ADA_BENCHMARKS) ++ find_package(simdjson) + endif() + # We use Google Benchmark, but it does not build under several 32-bit systems. +- if(Git_FOUND AND ADA_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) +- CPMAddPackage( +- NAME benchmark +- GITHUB_REPOSITORY google/benchmark +- GIT_TAG f91b6b4 +- OPTIONS "BENCHMARK_ENABLE_TESTING OFF" +- "BENCHMARK_ENABLE_INSTALL OFF" +- "BENCHMARK_ENABLE_WERROR OFF" +- +- ) ++ if(ADA_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) ++ find_package(benchmark) + endif() + + if (ADA_TESTING AND NOT EMSCRIPTEN) +- if(Git_FOUND) +- set(CTEST_TEST_TIMEOUT 5) +- message(STATUS "The tests are enabled.") +- add_subdirectory(tests) +- else() +- message(STATUS "The tests are disabled because git was not found.") +- endif() ++ set(CTEST_TEST_TIMEOUT 5) ++ message(STATUS "The tests are enabled.") ++ add_subdirectory(tests) + else() + if(is_top_project) + message(STATUS "The tests are disabled.") +@@ -72,12 +52,8 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) + endif(ADA_TESTING AND NOT EMSCRIPTEN) + + If(ADA_BENCHMARKS AND NOT EMSCRIPTEN) +- if(Git_FOUND) +- message(STATUS "Ada benchmarks enabled.") +- add_subdirectory(benchmarks) +- else() +- message(STATUS "The benchmarks are disabled because git was not found.") +- endif() ++ message(STATUS "Ada benchmarks enabled.") ++ add_subdirectory(benchmarks) + else(ADA_BENCHMARKS AND NOT EMSCRIPTEN) + if(is_top_project) + message(STATUS "Ada benchmarks disabled. Set ADA_BENCHMARKS=ON to enable them.") +@@ -107,11 +83,7 @@ if(NOT ADA_COVERAGE AND NOT EMSCRIPTEN) + endif() + + if(ADA_TOOLS) +- if(Git_FOUND) + add_subdirectory(tools) +- else() +- message(STATUS "The tools are disabled because git was not found.") +- endif() + endif() + + install( +diff --git a/singleheader/amalgamate.py b/singleheader/amalgamate.py +index 52b154b6..94e4e638 100755 +--- a/singleheader/amalgamate.py ++++ b/singleheader/amalgamate.py +@@ -138,7 +138,7 @@ if SCRIPTPATH != AMALGAMATE_OUTPUT_PATH: + + shutil.copy2(os.path.join(AMALGAMATE_INCLUDE_PATH, 'ada_c.h'), AMALGAMATE_OUTPUT_PATH) + +-zf = zipfile.ZipFile(os.path.join(AMALGAMATE_OUTPUT_PATH, 'singleheader.zip'), 'w', zipfile.ZIP_DEFLATED) ++zf = zipfile.ZipFile(os.path.join(AMALGAMATE_OUTPUT_PATH, 'singleheader.zip'), 'w', zipfile.ZIP_DEFLATED, strict_timestamps=False) + zf.write(os.path.join(AMALGAMATE_OUTPUT_PATH, 'ada.cpp'), 'ada.cpp') + zf.write(os.path.join(AMALGAMATE_OUTPUT_PATH, 'ada.h'), 'ada.h') + zf.write(os.path.join(AMALGAMATE_INCLUDE_PATH, 'ada_c.h'), 'ada_c.h') +diff --git a/tools/cli/CMakeLists.txt b/tools/cli/CMakeLists.txt +index 9f0da167..d0f7e0c9 100644 +--- a/tools/cli/CMakeLists.txt ++++ b/tools/cli/CMakeLists.txt +@@ -8,12 +8,8 @@ if(MSVC AND BUILD_SHARED_LIBS) + "$" # <--this is in-file + "$") # <--this is out-file path + endif() +-CPMAddPackage("gh:fmtlib/fmt#10.2.1") +-CPMAddPackage( +- GITHUB_REPOSITORY jarro2783/cxxopts +- VERSION 3.2.0 +- OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES" +-) ++find_package(fmt) ++find_package(cxxopts) + target_link_libraries(adaparse PRIVATE cxxopts::cxxopts fmt::fmt) + + if(MSVC OR MINGW) +-- +2.45.2 +