GNU bug report logs - #64337
[PATCH v4 6/6] gnu: python-lief: Update to 0.13.2.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Wed, 28 Jun 2023 18:36:05 UTC

Severity: normal

Tags: patch

Done: hako <hako <at> ultrarare.space>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64337 in the body.
You can then email your comments to 64337 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to lars <at> 6xq.net, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#64337; Package guix-patches. (Wed, 28 Jun 2023 18:36:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hilton Chain <hako <at> ultrarare.space>:
New bug report received and forwarded. Copy sent to lars <at> 6xq.net, jgart <at> dismail.de, guix-patches <at> gnu.org. (Wed, 28 Jun 2023 18:36:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: guix-patches <at> gnu.org
Cc: Hilton Chain <hako <at> ultrarare.space>
Subject: [PATCH v4 6/6] gnu: python-lief: Update to 0.13.2.
Date: Thu, 29 Jun 2023 02:35:06 +0800
* gnu/packages/python-xyz.scm (python-lief): Update to 0.13.2.
[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 55531b2785..a52c640fc5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -212,6 +212,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)
@@ -33167,29 +33168,94 @@ (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))
+              (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))
+                "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")
+     (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
@@ -33237,7 +33303,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





Reply sent to hako <hako <at> ultrarare.space>:
You have taken responsibility. (Wed, 28 Jun 2023 18:45:06 GMT) Full text and rfc822 format available.

Notification sent to Hilton Chain <hako <at> ultrarare.space>:
bug acknowledged by developer. (Wed, 28 Jun 2023 18:45:06 GMT) Full text and rfc822 format available.

Message #10 received at 64337-close <at> debbugs.gnu.org (full text, mbox):

From: hako <hako <at> ultrarare.space>
To: 64332-close <at> debbugs.gnu.org, 64333-close <at> debbugs.gnu.org,
 64334-close <at> debbugs.gnu.org, 64335-close <at> debbugs.gnu.org,
 64336-close <at> debbugs.gnu.org, 64337-close <at> debbugs.gnu.org
Subject: Re: bug#64332: Acknowledgement ([PATCH v4 2/6] gnu: mbedtls-apache-for-hiawatha: Use inherited source.)
Date: Wed, 28 Jun 2023 18:44:12 +0000
[Message part 1 (text/plain, inline)]
...... 😣 Forgot to add a --to=

I'll resend the patches when I get up.
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 27 Jul 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.