From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id eAwXHgpNzmSfwgAASxT56A (envelope-from ) for ; Sat, 05 Aug 2023 15:22:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cAIRHQpNzmRHmAAAG6o9tA (envelope-from ) for ; Sat, 05 Aug 2023 15:22:18 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E896537E3F for ; Sat, 5 Aug 2023 15:22:17 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=HUJhNN4N; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691241738; a=rsa-sha256; cv=none; b=pB2g8uACMS20TV/dvubHuWpHZzOPFYgdj2+6Oc66JZuCfDWlm90kdNkKoiI41yj8ujsrZO ROMQCyR2E/79jWdaTs6qEIzD7twZdBhHhHbeD2zXK9kfICT15QpxuFoDOb+QR0Qnci8nTM 0rMV04TPgzAHrpnW64DVQB+MWHGC8VKNwuEAc4OEjuf1ta1Oh4iXpxQMSyAp71AmYrE3H9 fQO1bdKEOMi9dj5HUlAUYDxBCEgCiGLfyBdbLDuJ2uZEhx9LLGW0QKVQ1nrVU7OlvWW9lD On+/OK1dVK2WRJbe1K0ID3Fww4Y8aa3KEAcerGj5TTfo1yYV9jrYYnJkHq+QKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691241738; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zqIT7MxidQLRqmNmR4f3++5bvP3jlLbDTSxBycka7FY=; b=SqfldCL+0K48z9XKTkolq4tLUceC/uicx6Ji6/+1p1mK++sS+9biMbsgaI5G/qhuzjx4+f Ry2WJCq4WpM7Wa67zK/a4uFgrSEG0ESPumXTQrokTaOg4U0PGL2vT+IrlS2N5uJ6M9OJE+ a1DYrXKbJxj7G9m0taOR241kpH8UmhQXFeXvXAZ8IQFrx0h6g5MSwvsNdUx84XTGEv6CEz IHpHramB7CDOokHoZGWv7x2afkFcP9sQRdBengPNrrJ9r0yt480Uc55VuiWLuyOaUeoAhr DGRTnlZrSCV6ro8okJl92fqToPVMsdmUseQyId8y5RDLgBGCK8VgygxmHdsF0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=HUJhNN4N; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSHEO-000415-3L; Sat, 05 Aug 2023 09:22:08 -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 1qSHEK-0003yr-Vy for guix-patches@gnu.org; Sat, 05 Aug 2023 09:22:06 -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 1qSHEK-0003m2-Ng for guix-patches@gnu.org; Sat, 05 Aug 2023 09:22:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qSHEH-00069c-RU; Sat, 05 Aug 2023 09:22:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63765] [PATCH v6 09/10] gnu: python-lief: Update to 0.13.2. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Sat, 05 Aug 2023 13:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63765 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63765@debbugs.gnu.org Cc: Hilton Chain , Lars-Dominik Braun , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , jgart Received: via spool by 63765-submit@debbugs.gnu.org id=B63765.169124166823570 (code B ref 63765); Sat, 05 Aug 2023 13:22:01 +0000 Received: (at 63765) by debbugs.gnu.org; 5 Aug 2023 13:21:08 +0000 Received: from localhost ([127.0.0.1]:56159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSHDP-000683-Ro for submit@debbugs.gnu.org; Sat, 05 Aug 2023 09:21:08 -0400 Received: from mail.boiledscript.com ([144.168.59.46]:35192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSHDN-00067T-75 for 63765@debbugs.gnu.org; Sat, 05 Aug 2023 09:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1691241656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zqIT7MxidQLRqmNmR4f3++5bvP3jlLbDTSxBycka7FY=; b=HUJhNN4N37FbgSHePpBWSh0zh0TZk+WwmdnKCXT4bk3sYZAk8FYpodKIcbmUSye1CEc99v 0/heM+DYqslIjPML9UPGcz4d9YwPoFzoT1FEBZ7r6BOHHT21J+nP4kuFgb2SWVw5bKsBrd uyFGEJymZ0Cx2dGGToafreuT3q4bnzi6RTl7eOeL/Pk41kM4TuVhV5C9RSP7iV1ys83Jqb u7kZwQNtSWm0Ft3LSE4kXKeqVV9wQPneTU5Spi63267JUKK5PEucJu+pB2Aabf/S2EubrN ajv0JAsLn62XFtoVQTdNqrBlBPYpdVxg5ZG05TaZlLYDTEa9XzShvQKFZ4rvXw== Date: Sat, 5 Aug 2023 21:19:05 +0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- 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: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.14 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: E896537E3F X-Spam-Score: -3.14 X-TUID: HZvGokLMlk4W * gnu/packages/patches/lief-unbundle-test-dependencies.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python-xyz.scm (python-lief): Update to 0.13.2. [snippet]: Unbundle third-party dependencies. [build-system]: Switch to cmake-build-system [native-inputs]: Add catch2, melkor, python-wrapper, python-tomli. Remove cmake. [inputs]: Add boost-leaf, frozen, mbedtls-apache, nlohmann-json, pybind11, spdlog, tcb-span, utfcpp. [outputs]: Add "python" output. [home-page]: Update homepage. (shrinkwrap)[inputs]: Replace python-lief to its "python" output. --- gnu/local.mk | 1 + .../lief-unbundle-test-dependencies.patch | 103 ++++++++++++++++ gnu/packages/python-xyz.scm | 112 +++++++++++++++--- 3 files changed, 202 insertions(+), 14 deletions(-) create mode 100644 gnu/packages/patches/lief-unbundle-test-dependencies.patch diff --git a/gnu/local.mk b/gnu/local.mk index 77707127a7..c79299a592 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1544,6 +1544,7 @@ dist_patch_DATA = \ %D%/packages/patches/libwpd-gcc-compat.patch \ %D%/packages/patches/libxslt-generated-ids.patch \ %D%/packages/patches/libxt-guix-search-paths.patch \ + %D%/packages/patches/lief-unbundle-test-dependencies.patch \ %D%/packages/patches/lierolibre-check-unaligned-access.patch \ %D%/packages/patches/lierolibre-is-free-software.patch \ %D%/packages/patches/lierolibre-newer-libconfig.patch \ diff --git a/gnu/packages/patches/lief-unbundle-test-dependencies.patch b/gnu/packages/patches/lief-unbundle-test-dependencies.patch new file mode 100644 index 0000000000..d86126c657 --- /dev/null +++ b/gnu/packages/patches/lief-unbundle-test-dependencies.patch @@ -0,0 +1,103 @@ +From 0e0f105e984eeac51147b5fd87cf95668e8fa235 Mon Sep 17 00:00:00 2001 +From: Hilton Chain +Date: Fri, 4 Aug 2023 10:57:32 +0800 +Subject: [PATCH] Use system Catch2 and Melkor. + +--- + tests/CMakeLists.txt | 47 ++++------------------------------------ + tests/test_iterators.cpp | 2 +- + 2 files changed, 5 insertions(+), 44 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 1d34b711..cf79ab74 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -8,23 +8,6 @@ set(LIEF_EXAMPLES_DIRECTORY "${PROJECT_SOURCE_DIR}/examples") + set(LIEF_EXAMPLES_BINARY_DIR "${PROJECT_BINARY_DIR}/examples") + + +-# Catch +-# ===== +-set(CATCH_VERSION 2.13.8) +-set(CATCH_SHA256 SHA256=532f163e4f2db66dae33f1d0a279e8d9befec8bc6cca60d7b82155f7d06bd89c) +-set(CATCH_URL "${THIRD_PARTY_DIRECTORY}/Catch2-${CATCH_VERSION}.zip" CACHE STRING "URL to the Catch repo") +- +-ExternalProject_Add(catch +- PREFIX ${CATCH_PREFIX} +- URL ${CATCH_URL} +- URL_HASH ${CATCH_SHA256} +- CONFIGURE_COMMAND "" +- BUILD_COMMAND "" +- INSTALL_COMMAND "" +-) +-ExternalProject_Get_Property(catch source_dir) +-set(CATCH_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "Path to include folder for Catch") +- + # Code covergage + # ============== + if(LIEF_COVERAGE) +@@ -58,31 +41,6 @@ if(LIEF_COVERAGE) + endif() + + +-# Fuzzing +-# ======= +-if(UNIX AND NOT APPLE) +- set(MELKOR_VERSION ac2495b) # From the fork: https://github.com/romainthomas/elf_fuzzer +- set(MELKOR_SHA256 SHA256=8cccc4ca5e05e305215cc74761413746b660b76f5869a563f52cec1f23d79f2e) +- set(MELKOR_URL "${THIRD_PARTY_DIRECTORY}/Melkor_ELF_Fuzzer-${MELKOR_VERSION}.zip" CACHE STRING "URL to the Melkor package") +- +- set(MELKOR_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/Melkor") +- set(MELKOR_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/Melkor") +- ExternalProject_Add(MELKOR +- PREFIX ${MELKOR_PREFIX} +- URL ${MELKOR_URL} +- URL_HASH ${MELKOR_SHA256} +- INSTALL_DIR ${MELKOR_INSTALL_DIR} +- UPDATE_COMMAND "" +- CONFIGURE_COMMAND "" +- INSTALL_COMMAND "" +- BUILD_COMMAND make clean && make +- BUILD_IN_SOURCE ON) +- +- ExternalProject_get_property(MELKOR SOURCE_DIR) +- set(MELKOR_BINARY "${SOURCE_DIR}/melkor") +- message(STATUS "${MELKOR_BINARY}") +-endif() +- + # Tests + # ===== + add_executable(test_iterators "${CMAKE_CURRENT_SOURCE_DIR}/test_iterators.cpp") +@@ -100,10 +58,13 @@ if (LIEF_COVERAGE) + target_link_libraries(test_iterators gcov) + endif() + +-add_dependencies(test_iterators catch LIB_LIEF) ++find_package(Catch2 REQUIRED) ++add_dependencies(test_iterators Catch2::Catch2 LIB_LIEF) + + target_link_libraries(test_iterators LIB_LIEF) + ++find_program(MELKOR_FOUND melkor REQUIRED) ++ + add_test(test_iterators + ${CMAKE_CURRENT_BINARY_DIR}/test_iterators) + +diff --git a/tests/test_iterators.cpp b/tests/test_iterators.cpp +index 2d837371..df3d2ed5 100644 +--- a/tests/test_iterators.cpp ++++ b/tests/test_iterators.cpp +@@ -14,7 +14,7 @@ + * limitations under the License. + */ + #define CATCH_CONFIG_MAIN +-#include ++#include + + #include + + +base-commit: 2d9855fc7f9d4ce6325245f8b75c98eb7663db60 +-- +2.41.0 + diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index b8e8097c7b..5066fcd1dd 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -167,6 +167,7 @@ (define-module (gnu packages python-xyz) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bdw-gc) + #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) @@ -180,6 +181,7 @@ (define-module (gnu packages python-xyz) #:use-module (gnu packages djvu) #:use-module (gnu packages docker) #:use-module (gnu packages documentation) + #:use-module (gnu packages elf) #:use-module (gnu packages enchant) #:use-module (gnu packages file) #:use-module (gnu packages fonts) @@ -213,6 +215,7 @@ (define-module (gnu packages python-xyz) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) + #:use-module (gnu packages logging) #:use-module (gnu packages machine-learning) #:use-module (gnu packages man) #:use-module (gnu packages markup) @@ -33438,29 +33441,110 @@ (define-public python-misskey (define-public python-lief (package (name "python-lief") - (version "0.12.3") + (version "0.13.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/lief-project/LIEF") (commit version))) (file-name (git-file-name name version)) + (patches (search-patches "lief-unbundle-test-dependencies.patch")) + (modules '((guix build utils))) + (snippet + '(begin (delete-file-recursively "third-party") + (substitute* "api/python/config-default.toml" + (("(ninja *= ).*" _ m) + (string-append m "false\n"))))) (sha256 (base32 - "11i6hqmcjh56y554kqhl61698n9v66j2qk1c1g63mv2w07h2z661")))) - (build-system python-build-system) - (native-inputs (list cmake)) + "0y48x358ppig5xp97ahcphfipx7cg9chldj2q5zrmn610fmi4zll")))) + (build-system cmake-build-system) (arguments (list - #:tests? #f ;needs network - #:phases #~(modify-phases %standard-phases - (replace 'build - (lambda _ - (invoke - "python" "setup.py" "--sdk" "build" - (string-append - "-j" (number->string (parallel-job-count))))))))) - (home-page "https://github.com/lief-project/LIEF") + #:imported-modules + `(,@%cmake-build-system-modules + (guix build python-build-system)) + #:modules + '(((guix build python-build-system) #:prefix python:) + (guix build cmake-build-system) + (guix build utils)) + #:configure-flags + #~'("-DBUILD_SHARED_LIBS=ON" + "-DLIEF_INSTALL_COMPILED_EXAMPLES=ON" + "-DLIEF_TESTS=ON" + ;; Use dependencies from Guix. + "-DLIEF_EXTERNAL_SPDLOG=ON" + "-DLIEF_OPT_EXTERNAL_LEAF=ON" + "-DLIEF_OPT_EXTERNAL_SPAN=ON" + "-DLIEF_OPT_FROZEN_EXTERNAL=ON" + "-DLIEF_OPT_MBEDTLS_EXTERNAL=ON" + "-DLIEF_OPT_NLOHMANN_JSON_EXTERNAL=ON" + "-DLIEF_OPT_PYBIND11_EXTERNAL=ON" + "-DLIEF_OPT_UTFCPP_EXTERNAL=ON") + #:phases + ;; Python bindings. + #~(modify-phases %standard-phases + (add-after 'unpack 'configure-python-build + (lambda* (#:key configure-flags build-type parallel-build? + #:allow-other-keys) + (with-directory-excursion "api/python" + (substitute* "config-default.toml" + ;; Honor `#:build-type'. + (("(type *)= .*" _ m) + (format #f "~a= \"~a\"~%" + m build-type)) + ;; Honor `#:parallel-build?'. + (("(parallel-jobs *)= .*" _ m) + (format #f "~a= ~a~%" + m (if parallel-build? + (parallel-job-count) + 1)))) + (substitute* "setup.py" + ;; Honor `#:configure-flags'. + (("(configure_cmd = .*)\n" _ m) + (format #f "~a + [~a]~%" + m (apply string-append + (map (lambda (flag) + (format #f "\"~a\"," flag)) + (append configure-flags + '("-DBUILD_SHARED_LIBS=OFF")))) + )))))) + (add-after 'install 'chdir + (lambda _ + (chdir "../source/api/python/"))) + (add-after 'chdir 'ensure-no-mtimes-pre-1980 + (assoc-ref python:%standard-phases 'ensure-no-mtimes-pre-1980)) + (add-after 'ensure-no-mtimes-pre-1980 'enable-bytecode-determinism + (assoc-ref python:%standard-phases 'enable-bytecode-determinism)) + (add-after 'enable-bytecode-determinism 'python-install + (lambda* (#:key inputs outputs #:allow-other-keys) + ((assoc-ref python:%standard-phases 'install) + #:inputs inputs + #:outputs outputs + #:configure-flags '() + #:use-setuptools? #t))) + (add-after 'python-install 'add-install-to-pythonpath + (assoc-ref python:%standard-phases 'add-install-to-pythonpath)) + (add-after 'add-install-to-pythonpath 'add-install-to-path + (assoc-ref python:%standard-phases 'add-install-to-path)) + (add-after 'add-install-to-path 'python-wrap + (assoc-ref python:%standard-phases 'wrap))))) + (native-inputs + (list catch2 + melkor + python-wrapper + python-tomli)) + (inputs + (list boost-leaf + frozen + mbedtls-apache + nlohmann-json + pybind11 + spdlog + tcb-span + utfcpp)) + (outputs '("out" "python")) + (home-page "https://lief-project.github.io/") (synopsis "Library to instrument executable formats") (description "@code{python-lief} is a cross platform library which can parse, modify @@ -33508,7 +33592,7 @@ (define-public shrinkwrap python-poetry-core python-pypa-build python-pytest)) - (inputs (list python-lief python-sh)) + (inputs (list `(,python-lief "python") python-sh)) (home-page "https://github.com/fzakaria/shrinkwrap") (synopsis "Emboss needed dependencies on the top level executable") (description -- 2.41.0