[bug#57058,v2] gnu: Add python-lief.

Message ID y767d38elua.wl-hako@ultrarare.space
State New
Headers
Series [bug#57058,v2] gnu: Add python-lief. |

Commit Message

Hilton Chain Aug. 16, 2022, 6:36 a.m. UTC
From b9ce692513271f33baf8e45cd10d0a350047986c Mon Sep 17 00:00:00 2001
From: Hilton Chain <hako@ultrarare.space>
Date: Tue, 16 Aug 2022 14:31:05 +0800
Subject: [PATCH v2] gnu: Add python-lief.

* gnu/packages/python-xyz.scm (python-lief): New variable.
---

v1 -> v2: Enable parallel compilation.

Sorry for the latency! >_<

 gnu/packages/python-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)


base-commit: ace7b5babe118adb9caf116eb8273f7db6e7f152
  

Comments

Mathieu Othacehe Aug. 16, 2022, 9:29 a.m. UTC | #1
Hey,

> v1 -> v2: Enable parallel compilation.
>
> Sorry for the latency! >_<

No worries. I confirm that it compiles faster :)

It looks like no tests are run though:

--8<---------------cut here---------------start------------->8---
Copying /tmp/guix-build-python-lief-0.12.1.drv-0/source/build/lief.so into build/lib.linux-x86_64-3.9/lief.cpython-39-x86_64-linux-gnu.so
copying /tmp/guix-build-python-lief-0.12.1.drv-0/source/build/lief.so -> build/lib.linux-x86_64-3.9/lief.cpython-39-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.9/lief.cpython-39-x86_64-linux-gnu.so -> 

----------------------------------------------------------------------
Ran 0 tests in 0.000s
--8<---------------cut here---------------end--------------->8---

Any idea why?

Thanks,

Mathieu
  
Hilton Chain Aug. 16, 2022, 1:06 p.m. UTC | #2
Found the option in the setup script, however the tests require network. There's
also options for docs, for now I'll try out if they are worthy enabling.
  

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3259f46881..ecc1eab67c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -30644,3 +30644,33 @@  (define-public python-misskey
      "This package provides access to Misskey's API.  Misskey is a SNS
 platform using the ActivityPub protocol.")
     (license license:expat)))
+
+(define-public python-lief
+  (package
+    (name "python-lief")
+    (version "0.12.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/lief-project/LIEF")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1xzbh3bxy4rw1yamnx68da1v5s56ay4g081cyamv67256g0qy2i1"))))
+    (build-system python-build-system)
+    (native-inputs (list cmake))
+    (arguments
+     (list #: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")
+    (synopsis "Library to instrument executable formats")
+    (description
+     "LIEF is a cross platform library which can parse, modify and abstract ELF,
+PE and MachO formats.")
+    (license license:asl2.0)))