summary refs log tree commit diff
path: root/distro
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-07-13 12:12:34 +0200
committerLudovic Courtès <ludo@gnu.org>2012-07-13 12:12:34 +0200
commitf66963df93f9ebf93c550914ffc9450bea75c7fd (patch)
tree7fcfaefa2a62842c381526112cab3f7f9403b6c1 /distro
parent1788a456376f795295673f0658848115ea33a486 (diff)
downloadguix-f66963df93f9ebf93c550914ffc9450bea75c7fd.tar.gz
distro: Add libffi.
* distro/base.scm (libffi): New variable.
  (guile-2.0): Use it.
Diffstat (limited to 'distro')
-rw-r--r--distro/base.scm50
1 files changed, 49 insertions, 1 deletions
diff --git a/distro/base.scm b/distro/base.scm
index dce43b7bd6..765826b504 100644
--- a/distro/base.scm
+++ b/distro/base.scm
@@ -421,6 +421,54 @@ extensible.  It supports many SRFIs.")
    (home-page "http://www.gnu.org/software/guile/")
    (license "LGPLv2+")))
 
+(define-public libffi
+  (let ((post-install-phase
+         ;; Install headers in the right place.
+         '(lambda* (#:key outputs #:allow-other-keys)
+            (define out (assoc-ref outputs "out"))
+            (mkdir (string-append out "/include"))
+            (with-directory-excursion
+                (string-append out "/lib/libffi-3.0.9/include")
+              (for-each (lambda (h)
+                          (format #t "moving `~a' to includedir~%" h)
+                          (rename-file h (string-append out "/include/" h)))
+                        (scandir "."
+                                 (lambda (x)
+                                   (not (member x '("." ".."))))))))))
+   (package
+    (name "libffi")
+    (version "3.0.9")
+    (source (origin
+             (method http-fetch)
+             (uri ;; FIXME: should be ftp://
+              (string-append "http://sourceware.org/pub/libffi/"
+                             name "-" version ".tar.gz"))
+             (sha256
+              (base32
+               "0ln4jbpb6clcsdpb9niqk0frgx4k0xki96wiv067ig0q4cajb7aq"))))
+    (build-system gnu-build-system)
+    (arguments `(#:modules ((guix build utils) (guix build gnu-build-system)
+                            (ice-9 ftw) (srfi srfi-26))
+                 #:phases (alist-cons-after 'install 'post-install
+                                            ,post-install-phase
+                                            %standard-phases)))
+    (description "libffi, a foreign function call interface library")
+    (long-description
+     "The libffi library provides a portable, high level programming interface
+to various calling conventions.  This allows a programmer to call any
+function specified by a call interface description at run-time.
+
+FFI stands for Foreign Function Interface.  A foreign function interface is
+the popular name for the interface that allows code written in one language
+to call code written in another language.  The libffi library really only
+provides the lowest, machine dependent layer of a fully featured foreign
+function interface.  A layer must exist above libffi that handles type
+conversions for values passed between the two languages.")
+    (home-page "http://sources.redhat.com/libffi/")
+
+    ;; See <http://github.com/atgreen/libffi/blob/master/LICENSE>.
+    (license "free, non-copyleft"))))
+
 (define-public guile-2.0
   (package
    (name "guile")
@@ -435,7 +483,7 @@ extensible.  It supports many SRFIs.")
    (build-system gnu-build-system)
    (native-inputs `(("xz" ,(nixpkgs-derivation* "xz"))
                     ("pkgconfig" ,(nixpkgs-derivation* "pkgconfig"))))
-   (inputs `(("libffi" ,(nixpkgs-derivation* "libffi"))
+   (inputs `(("libffi" ,libffi)
              ("readline" ,readline)))
 
    (propagated-inputs