all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: 63765@debbugs.gnu.org
Cc: Hilton Chain <hako@ultrarare.space>
Subject: [bug#63765] [PATCH 8/8] gnu: python-lief: Update to 0.13.0.
Date: Sun, 28 May 2023 16:11:07 +0800	[thread overview]
Message-ID: <20230528081107.24209-8-hako@ultrarare.space> (raw)
In-Reply-To: <20230528081107.24209-1-hako@ultrarare.space>

* gnu/packages/python-xyz.scm (python-lief): Update to 0.13.0.
[snippet]: Unbundle third-party dependencies.
[build-system]: Change to cmake-build-system
[native-inputs]: Add python-minimal-wrapper, python-tomli.
Remove cmake.
[inputs]: Add frozen, mbedtls-apache, nlohmann-json, pybind11, utfcpp, spdlog.
[outputs]: Add "python" output.
[home-page]: Update homepage.
(shrinkwrap)[inputs]: Replace python-lief to its "python" output.
---
 gnu/packages/python-xyz.scm | 96 +++++++++++++++++++++++++++++++------
 1 file changed, 81 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f7e3f6f538..f600ffc47b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -208,6 +208,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)
@@ -32815,29 +32816,94 @@ (define-public python-misskey
 (define-public python-lief
   (package
     (name "python-lief")
-    (version "0.12.3")
+    (version "0.13.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/lief-project/LIEF")
                     (commit version)))
               (file-name (git-file-name name version))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Configure build for Python bindings.
+                  (substitute* "api/python/config-default.toml"
+                    (("(ninja         = )true" all m)
+                     (string-append m "false"))
+                    (("(parallel-jobs = )0" all m)
+                     (string-append m (number->string (parallel-job-count)))))
+                  ;; Unbundle third-party dependencies.
+                  (for-each delete-file
+                            (find-files "third-party/"
+                                        (string-join '("spdlog"
+                                                       "frozen"
+                                                       "json"
+                                                       "mbedtls"
+                                                       "pybind11"
+                                                       "utfcpp")
+                                                     "|" )))
+                  ;; Same in argument #:configure-flags.
+                  (substitute* "api/python/setup.py"
+                    (("self\\._get_third_party_opt\\(\\)")
+                     "[\"-DLIEF_EXTERNAL_SPDLOG=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\"]"))))
               (sha256
                (base32
-                "11i6hqmcjh56y554kqhl61698n9v66j2qk1c1g63mv2w07h2z661"))))
-    (build-system python-build-system)
-    (native-inputs (list cmake))
+                "17901jddr9idzbi3ijq96m3hpfwzxnfyyf4pmxbpdj98czpqy75r"))))
+    (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")
+     (list #:modules
+           '((guix build utils)
+             (guix build cmake-build-system)
+             ((guix build python-build-system) #:prefix python:))
+           #:imported-modules
+           (append %cmake-build-system-modules
+                   '((guix build python-build-system)))
+           #:configure-flags
+           #~'("-DCMAKE_LINK_WHAT_YOU_USE=ON"
+               "-DBUILD_SHARED_LIBS=ON"
+               "-DLIEF_INSTALL_COMPILED_EXAMPLES=ON"
+               "-DLIEF_TESTS=ON"
+               ;; Unbundle third-party dependencies
+               "-DLIEF_EXTERNAL_SPDLOG=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
+           ;; Phases from python-build-system, for Python bindings.
+           #~(modify-phases %standard-phases
+               (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 'ensure-no-cythonized-files
+                 (assoc-ref python:%standard-phases 'ensure-no-cythonized-files))
+               (add-after 'ensure-no-cythonized-files '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 python-minimal-wrapper python-tomli))
+    (inputs (list frozen mbedtls-apache nlohmann-json pybind11 utfcpp spdlog))
+    (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
@@ -32885,7 +32951,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.40.1





  parent reply	other threads:[~2023-05-28  8:13 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <832fd8ce-7234-0521-55bf-a2c81f8c48d8@housseini.me>
2023-05-28  8:07 ` [bug#63765] [PATCH 0/8] gnu: python-lief: Update to 0.13.0 Hilton Chain via Guix-patches via
2023-05-28  8:11   ` [bug#63765] [PATCH 1/8] gnu: Add ftest-for-utfcpp Hilton Chain via Guix-patches via
2023-05-28  8:11     ` [bug#63765] [PATCH 2/8] gnu: utfcpp: Update to 3.2.3 Hilton Chain via Guix-patches via
2023-05-28  8:11     ` [bug#63765] [PATCH 3/8] gnu: mbedtls-apache: Rename package to mbedtls-apache-lts Hilton Chain via Guix-patches via
2023-05-28  8:11     ` [bug#63765] [PATCH 4/8] gnu: mbedtls-apache-for-hiawatha: Use inherited source Hilton Chain via Guix-patches via
2023-05-28  8:11     ` [bug#63765] [PATCH 5/8] gnu: mbedtls-apache-lts: Update to 2.28.3 Hilton Chain via Guix-patches via
2023-05-28  8:11     ` [bug#63765] [PATCH 6/8] gnu: Add mbedtls-apache, version 3.4.0 Hilton Chain via Guix-patches via
2023-05-28  8:11     ` [bug#63765] [PATCH 7/8] gnu: Add frozen Hilton Chain via Guix-patches via
2023-05-28  8:11     ` Hilton Chain via Guix-patches via [this message]
2023-05-28 12:54   ` [bug#63765] [PATCH v2 0/8] gnu: python-lief: Update to 0.13.1 Hilton Chain via Guix-patches via
2023-05-28 12:56     ` [bug#63765] [PATCH v2 1/8] gnu: Add ftest-for-utfcpp Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 2/8] gnu: utfcpp: Update to 3.2.3 Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 3/8] gnu: mbedtls-apache: Rename package to mbedtls-apache-lts Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 4/8] gnu: mbedtls-apache-for-hiawatha: Use inherited source Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 5/8] gnu: mbedtls-apache-lts: Update to 2.28.3 Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 6/8] gnu: Add mbedtls-apache, version 3.4.0 Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 7/8] gnu: Add frozen Hilton Chain via Guix-patches via
2023-05-28 12:56       ` [bug#63765] [PATCH v2 8/8] gnu: python-lief: Update to 0.13.1 Hilton Chain via Guix-patches via
2023-06-23  6:24   ` [bug#63765] [PATCH v3 0/8] gnu: python-lief: Update to 0.13.2 Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 1/8] gnu: Add ftest-for-utfcpp Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 2/8] gnu: utfcpp: Update to 3.2.3 Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 3/8] gnu: mbedtls-apache: Rename package to mbedtls-apache-lts Hilton Chain via Guix-patches via
2023-06-26 18:59       ` Liliana Marie Prikler
2023-06-23  6:24     ` [bug#63765] [PATCH v3 4/8] gnu: mbedtls-apache-for-hiawatha: Use inherited source Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 5/8] gnu: mbedtls-apache-lts: Update to 2.28.3 Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 6/8] gnu: Add mbedtls-apache, version 3.4.0 Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 7/8] gnu: Add frozen Hilton Chain via Guix-patches via
2023-06-23  6:24     ` [bug#63765] [PATCH v3 8/8] gnu: python-lief: Update to 0.13.2 Hilton Chain via Guix-patches via
2023-06-23  7:24   ` [bug#63765] ftest and utfcpp in issue 62473 reza via Guix-patches via
2023-06-23  7:39     ` Hilton Chain via Guix-patches via
     [not found]       ` <d4281dd0-6488-00bd-1ee0-8d92a1104c67@housseini.me>
2023-06-23  7:58         ` reza via Guix-patches via
2023-06-23 15:33   ` [bug#63765] [PATCH 0/2] gnu: utfcpp: Update to 3.2.3 Hilton Chain via Guix-patches via
2023-06-23 15:35     ` [bug#64255] [PATCH 1/2] gnu: Add ftest Hilton Chain via Guix-patches via
2023-06-23 15:35     ` [bug#64255] [PATCH 2/2] gnu: utfcpp: Update to 3.2.3 Hilton Chain via Guix-patches via
2023-08-03 14:05     ` [bug#64255] [PATCH v2 0/2] " Hilton Chain via Guix-patches via
2023-08-03 14:06       ` [bug#64255] [PATCH v2 1/2] gnu: Add ftest Hilton Chain via Guix-patches via
2023-08-03 14:06       ` [bug#64255] [PATCH v2 2/2] gnu: utfcpp: Update to 3.2.3 Hilton Chain via Guix-patches via
2023-08-13  4:50     ` [bug#64255] [PATCH v3 0/2] gnu: utfcpp: Update to 3.2.4 Hilton Chain via Guix-patches via
2023-08-13  4:51       ` [bug#64255] [PATCH v3 1/2] gnu: Add ftest Hilton Chain via Guix-patches via
2023-08-13  4:51       ` [bug#64255] [PATCH v3 2/2] gnu: utfcpp: Update to 3.2.4 Hilton Chain via Guix-patches via
2023-08-30 12:57     ` [bug#64255] Green light Andreas Enge
2023-09-01  9:00       ` bug#64255: " Hilton Chain via Guix-patches via
2023-06-28 18:33   ` [bug#63765] [PATCH v4 0/6] gnu: python-lief: Update to 0.13.2 Hilton Chain via Guix-patches via
2023-06-28 18:35     ` [bug#64333] [PATCH v4 1/6] gnu: mbedtls-apache: Rename package to mbedtls-apache-lts Hilton Chain via Guix-patches via
2023-06-29  4:22       ` Liliana Marie Prikler
2023-06-28 18:35     ` [bug#64332] [PATCH v4 2/6] gnu: mbedtls-apache-for-hiawatha: Use inherited source Hilton Chain via Guix-patches via
     [not found]       ` <handler.64332.B.168797732415505.ack@debbugs.gnu.org>
2023-06-28 18:44         ` bug#64336: bug#64332: Acknowledgement ([PATCH v4 2/6] gnu: mbedtls-apache-for-hiawatha: Use inherited source.) hako via Guix-patches via
2023-06-28 18:35     ` [bug#64334] [PATCH v4 3/6] gnu: mbedtls-apache-lts: Update to 2.28.3 Hilton Chain via Guix-patches via
2023-06-28 18:35     ` [bug#64335] [PATCH v4 4/6] gnu: Add mbedtls-apache, version 3.4.0 Hilton Chain via Guix-patches via
2023-06-28 18:35     ` [bug#64336] [PATCH v4 5/6] gnu: Add frozen Hilton Chain via Guix-patches via
2023-06-28 18:35     ` [bug#64337] [PATCH v4 6/6] gnu: python-lief: Update to 0.13.2 Hilton Chain via Guix-patches via
2023-06-30  7:43   ` [bug#63765] [PATCH v5 0/6] " Hilton Chain via Guix-patches via
2023-06-30  7:44     ` [bug#63765] [PATCH v5 1/6] gnu: mbedtls-apache: Rename package to mbedtls-apache-lts Hilton Chain via Guix-patches via
2023-06-30  7:44     ` [bug#63765] [PATCH v5 2/6] gnu: mbedtls-apache-for-hiawatha: Use inherited source Hilton Chain via Guix-patches via
2023-06-30  7:44     ` [bug#63765] [PATCH v5 3/6] gnu: mbedtls-apache-lts: Update to 2.28.3 Hilton Chain via Guix-patches via
2023-06-30  7:44     ` [bug#63765] [PATCH v5 4/6] gnu: Add mbedtls-apache, version 3.4.0 Hilton Chain via Guix-patches via
2023-06-30  7:44     ` [bug#63765] [PATCH v5 5/6] gnu: Add frozen Hilton Chain via Guix-patches via
2023-06-30  7:44     ` [bug#63765] [PATCH v5 6/6] gnu: python-lief: Update to 0.13.2 Hilton Chain via Guix-patches via
2023-08-05 13:18   ` [bug#63765] [PATCH v6 00/10] " Hilton Chain via Guix-patches via
2023-08-05 13:18     ` [bug#63765] [PATCH v6 01/10] gnu: mbedtls-apache: Rename to mbedtls-apache-lts Hilton Chain via Guix-patches via
2023-08-05 13:18     ` [bug#63765] [PATCH v6 02/10] gnu: mbedtls-apache-for-hiawatha: Use inherited source Hilton Chain via Guix-patches via
2023-08-05 13:18     ` [bug#63765] [PATCH v6 03/10] gnu: mbedtls-apache-lts: Update to 2.28.4 Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 04/10] gnu: Add mbedtls-apache, version 3.4.1 Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 05/10] gnu: Add frozen Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 06/10] gnu: Add boost-leaf Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 07/10] gnu: Add tcb-span Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 08/10] gnu: Add melkor Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 09/10] gnu: python-lief: Update to 0.13.2 Hilton Chain via Guix-patches via
2023-08-05 13:19     ` [bug#63765] [PATCH v6 10/10] gnu: python-lief: Rename to lief Hilton Chain via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230528081107.24209-8-hako@ultrarare.space \
    --to=guix-patches@gnu.org \
    --cc=63765@debbugs.gnu.org \
    --cc=hako@ultrarare.space \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.