|
22 | 22 | (gnu packages moreutils) |
23 | 23 | (gnu packages pkg-config) |
24 | 24 | (gnu packages python) |
| 25 | + ((gnu packages python-build) #:select (python-tomli)) |
25 | 26 | (gnu packages python-crypto) |
26 | 27 | (gnu packages python-web) |
27 | 28 | (gnu packages shells) |
@@ -203,38 +204,44 @@ chain for " target " development.")) |
203 | 204 | (search-our-patches "nsis-gcc-10-memmove.patch" |
204 | 205 | "nsis-disable-installer-reloc.patch"))) |
205 | 206 |
|
206 | | -(define (fix-ppc64-nx-default lief) |
207 | | - (package-with-extra-patches lief |
208 | | - (search-our-patches "lief-fix-ppc64-nx-default.patch"))) |
209 | | - |
210 | | -;; Our python-lief package can be removed once we are using |
211 | | -;; guix 83bfdb409787cb2737e68b093a319b247b7858e6 or later. |
212 | | -;; Note we currently use cmake-minimal. |
| 207 | +;; While LIEF is packaged in Guix, we maintain our own package, |
| 208 | +;; to simplify building, and more easily apply updates. |
| 209 | +;; Moreover, the Guix's package uses cmake, which caused build |
| 210 | +;; failure; see https://github.com/bitcoin/bitcoin/pull/27296. |
213 | 211 | (define-public python-lief |
214 | 212 | (package |
215 | 213 | (name "python-lief") |
216 | | - (version "0.12.3") |
| 214 | + (version "0.13.2") |
217 | 215 | (source (origin |
218 | 216 | (method git-fetch) |
219 | 217 | (uri (git-reference |
220 | 218 | (url "https://github.com/lief-project/LIEF") |
221 | 219 | (commit version))) |
222 | 220 | (file-name (git-file-name name version)) |
| 221 | + (modules '((guix build utils))) |
| 222 | + (snippet |
| 223 | + '(begin |
| 224 | + ;; Configure build for Python bindings. |
| 225 | + (substitute* "api/python/config-default.toml" |
| 226 | + (("(ninja = )true" all m) |
| 227 | + (string-append m "false")) |
| 228 | + (("(parallel-jobs = )0" all m) |
| 229 | + (string-append m (number->string (parallel-job-count))))))) |
223 | 230 | (sha256 |
224 | 231 | (base32 |
225 | | - "11i6hqmcjh56y554kqhl61698n9v66j2qk1c1g63mv2w07h2z661")))) |
| 232 | + "0y48x358ppig5xp97ahcphfipx7cg9chldj2q5zrmn610fmi4zll")))) |
226 | 233 | (build-system python-build-system) |
227 | | - (native-inputs (list cmake-minimal)) |
| 234 | + (native-inputs (list cmake-minimal python-tomli)) |
228 | 235 | (arguments |
229 | 236 | (list |
230 | 237 | #:tests? #f ;needs network |
231 | 238 | #:phases #~(modify-phases %standard-phases |
| 239 | + (add-before 'build 'change-directory |
| 240 | + (lambda _ |
| 241 | + (chdir "api/python"))) |
232 | 242 | (replace 'build |
233 | 243 | (lambda _ |
234 | | - (invoke |
235 | | - "python" "setup.py" "--sdk" "build" |
236 | | - (string-append |
237 | | - "-j" (number->string (parallel-job-count))))))))) |
| 244 | + (invoke "python" "setup.py" "build")))))) |
238 | 245 | (home-page "https://github.com/lief-project/LIEF") |
239 | 246 | (synopsis "Library to instrument executable formats") |
240 | 247 | (description |
@@ -596,7 +603,7 @@ inspecting signatures in Mach-O binaries.") |
596 | 603 | ;; Git |
597 | 604 | git-minimal |
598 | 605 | ;; Tests |
599 | | - (fix-ppc64-nx-default python-lief)) |
| 606 | + python-lief) |
600 | 607 | (let ((target (getenv "HOST"))) |
601 | 608 | (cond ((string-suffix? "-mingw32" target) |
602 | 609 | ;; Windows |
|
0 commit comments