guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add libiberty.


From: Ricardo Wurmus
Subject: [PATCH] Add libiberty.
Date: Sat, 27 Jun 2015 11:49:37 +0200

GCC 4.8.4 is the last GCC containing libiberty.a.  The attached patch
adds a package generator that creates a libiberty package for a given
GCC package.  It also adds a libiberty package for the default “gcc”.

>From 848a6b91a48abcfdc2eb0d9bbde6a0f22b019090 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Sat, 27 Jun 2015 11:47:04 +0200
Subject: [PATCH] gnu: Add libiberty.

* gnu/packages/gcc.scm (make-libiberty, libiberty): New variables.
---
 gnu/packages/gcc.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 4fc2e63..aba8565 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -373,6 +373,41 @@ using compilers other than GCC."
 (define-public libstdc++-4.9
   (make-libstdc++ gcc-4.9))
 
+(define (make-libiberty gcc)
+  "Return a libiberty package based on GCC."
+  (package
+    (inherit gcc)
+    (name "libiberty")
+    (arguments
+     `(#:out-of-source? #t
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir
+                     (lambda _
+                       (chdir "libiberty")
+                       #t))
+         (replace
+          'install
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out     (assoc-ref outputs "out"))
+                   (lib     (string-append out "/lib/"))
+                   (include (string-append out "/include/")))
+              (mkdir-p lib)
+              (mkdir-p include)
+              (copy-file "libiberty.a"
+                         (string-append lib "libiberty.a"))
+              (copy-file "../include/libiberty.h"
+                         (string-append include "libiberty.h"))
+              #t))))))
+    (inputs '())
+    (outputs '("out"))
+    (native-inputs '())
+    (propagated-inputs '())
+    (synopsis "Collection of subroutines used by various GNU programs")))
+
+(define-public libiberty
+  (make-libiberty gcc))
+
 (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t))
   "Return a custom version of GCC that supports LANGUAGES."
   (package (inherit gcc)
-- 
2.4.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]