guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 258284a93e9401b2ab3195804cebd084f0222f63
Author: Luca Cirrottola <[email protected]>
AuthorDate: Tue Jul 15 19:06:00 2025 +0200

    gnu: Add libbfd.
    
    * gnu/packages/base.scm (libbfd): New variable.
    
    Change-Id: I82d246e822876841dc64adfab9e13b27941d028a
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 gnu/packages/base.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 22e1836f96..d9501a27ad 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -783,6 +783,36 @@ included.")
     (native-inputs (modify-inputs (package-native-inputs binutils)
                      (append bc)))))
 
+(define-public libbfd
+  (package/inherit binutils
+    (name "libbfd")
+    (inputs
+     (modify-inputs (package-native-inputs binutils)
+       (append texinfo))) ; because makeinfo is needed when building bfd alone
+    (arguments
+     (substitute-keyword-arguments (package-arguments binutils)
+       ;; Only build as a shared library
+       ((#:configure-flags flags)
+        #~(append #$flags '("--enable-shared" "--disable-static")))
+       ;; Only build and install bfd
+       ((#:phases phases #~%standard-phases)
+        #~(modify-phases #$phases
+            (replace 'build
+              (lambda _
+                (invoke "make" "-j" (number->string (parallel-job-count))
+                        "all-bfd")))
+            (replace 'check
+              (lambda _
+                (invoke "make" "check-bfd"
+                        "-j" (number->string (parallel-job-count))
+                        "MAKEINFO=true")))
+            (replace 'install
+              (lambda _ (invoke "make" "install-bfd")))))))
+    (synopsis "GNU BFD library for operating on object files")
+    (description "This package provides a standalone shared library version of
+BFD, which is otherwise distributed and installed as part of the Binutils
+package release.")))
+
 (define* (make-ld-wrapper name #:key
                           (target (const #f))
                           binutils

Reply via email to