Skip to content

Commit 7fbc703

Browse files
committed
Merge bitcoin/bitcoin#27296: guix: import/sync python-lief (0.12.3) package definition from upstream
24f26e0 guix: use cmake-minimal for python-lief (fanquake) 43d8173 guix: import LIEF from upstream (0.12.3) (fanquake) Pull request description: Update to version 0.12.3. Retain our PPC64 patch. Mention when we can drop our local definition. Also switch to using cmake-minimal (see #27172), which fixes atleast one build failure I've seen on aarch64, where cmake dependencies fail to build. Fix that by using the cmake without all the dependencies we don't actually need: ```bash The following derivations will be built: /gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv /gnu/store/f9zwh1ldy63ga0i5w6cbbqlj6sfq226j-cmake-3.21.4.drv /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv building /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv... / 'check' phasenote: keeping build directory `/tmp/guix-build-python-sphinx-4.2.0.drv-5' builder for `/gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv' failed with exit code 1 build of /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv failed View build log at '/var/log/guix/drvs/3w/g6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv.gz'. cannot build derivation `/gnu/store/f9zwh1ldy63ga0i5w6cbbqlj6sfq226j-cmake-3.21.4.drv': 1 dependencies couldn't be built cannot build derivation `/gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv': 1 dependencies couldn't be built guix environment: error: build of `/gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv' failed ``` ACKs for top commit: TheCharlatan: ACK 24f26e0 Tree-SHA512: d4260cdf5121686fd2fa36c1fc85687848eeb26cabaad2c6566feb71a18ea7fb013cfc6353c99f6f74bc89108a9505adce513c1cfa22a0a67450e6a1c451d209
2 parents 3963067 + 24f26e0 commit 7fbc703

File tree

1 file changed

+34
-29
lines changed

1 file changed

+34
-29
lines changed

contrib/guix/manifest.scm

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -208,35 +208,40 @@ chain for " target " development."))
208208
(package-with-extra-patches lief
209209
(search-our-patches "lief-fix-ppc64-nx-default.patch")))
210210

211-
(define-public lief
211+
;; Our python-lief package can be removed once we are using
212+
;; guix 83bfdb409787cb2737e68b093a319b247b7858e6 or later.
213+
;; Note we currently use cmake-minimal.
214+
(define-public python-lief
212215
(package
213-
(name "python-lief")
214-
(version "0.12.1")
215-
(source
216-
(origin
217-
(method git-fetch)
218-
(uri (git-reference
219-
(url "https://github.com/lief-project/LIEF.git")
220-
(commit version)))
221-
(file-name (git-file-name name version))
222-
(sha256
223-
(base32
224-
"1xzbh3bxy4rw1yamnx68da1v5s56ay4g081cyamv67256g0qy2i1"))))
225-
(build-system python-build-system)
226-
(arguments
227-
`(#:phases
228-
(modify-phases %standard-phases
229-
(add-after 'unpack 'parallel-jobs
230-
;; build with multiple cores
231-
(lambda _
232-
(substitute* "setup.py" (("self.parallel if self.parallel else 1") (number->string (parallel-job-count)))))))))
233-
(native-inputs
234-
`(("cmake" ,cmake)))
235-
(home-page "https://github.com/lief-project/LIEF")
236-
(synopsis "Library to Instrument Executable Formats")
237-
(description "Python library to to provide a cross platform library which can
238-
parse, modify and abstract ELF, PE and MachO formats.")
239-
(license license:asl2.0)))
216+
(name "python-lief")
217+
(version "0.12.3")
218+
(source (origin
219+
(method git-fetch)
220+
(uri (git-reference
221+
(url "https://github.com/lief-project/LIEF")
222+
(commit version)))
223+
(file-name (git-file-name name version))
224+
(sha256
225+
(base32
226+
"11i6hqmcjh56y554kqhl61698n9v66j2qk1c1g63mv2w07h2z661"))))
227+
(build-system python-build-system)
228+
(native-inputs (list cmake-minimal))
229+
(arguments
230+
(list
231+
#:tests? #f ;needs network
232+
#:phases #~(modify-phases %standard-phases
233+
(replace 'build
234+
(lambda _
235+
(invoke
236+
"python" "setup.py" "--sdk" "build"
237+
(string-append
238+
"-j" (number->string (parallel-job-count)))))))))
239+
(home-page "https://github.com/lief-project/LIEF")
240+
(synopsis "Library to instrument executable formats")
241+
(description
242+
"@code{python-lief} is a cross platform library which can parse, modify
243+
and abstract ELF, PE and MachO formats.")
244+
(license license:asl2.0)))
240245

241246
(define osslsigncode
242247
(package
@@ -596,7 +601,7 @@ inspecting signatures in Mach-O binaries.")
596601
;; Git
597602
git-minimal
598603
;; Tests
599-
(fix-ppc64-nx-default lief))
604+
(fix-ppc64-nx-default python-lief))
600605
(let ((target (getenv "HOST")))
601606
(cond ((string-suffix? "-mingw32" target)
602607
;; Windows

0 commit comments

Comments
 (0)