Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
cab24961 | 2 | ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> |
c44899a2 | 3 | ;;; |
233e7676 | 4 | ;;; This file is part of GNU Guix. |
c44899a2 | 5 | ;;; |
233e7676 | 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
c44899a2 LC |
7 | ;;; under the terms of the GNU General Public License as published by |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
9 | ;;; your option) any later version. | |
10 | ;;; | |
233e7676 | 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
c44899a2 LC |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ;;; GNU General Public License for more details. | |
15 | ;;; | |
16 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
c44899a2 | 18 | |
1ffa7090 | 19 | (define-module (gnu packages libffi) |
4a44e743 | 20 | #:use-module (guix licenses) |
c44899a2 | 21 | #:use-module (guix packages) |
87f5d366 | 22 | #:use-module (guix download) |
c44899a2 LC |
23 | #:use-module (guix build-system gnu)) |
24 | ||
25 | (define-public libffi | |
26 | (let ((post-install-phase | |
27 | ;; Install headers in the right place. | |
28 | '(lambda* (#:key outputs #:allow-other-keys) | |
29 | (define out (assoc-ref outputs "out")) | |
30 | (mkdir (string-append out "/include")) | |
31 | (with-directory-excursion | |
a62b83d5 | 32 | (string-append out "/lib/libffi-3.0.13/include") |
c44899a2 LC |
33 | (for-each (lambda (h) |
34 | (format #t "moving `~a' to includedir~%" h) | |
35 | (rename-file h (string-append out "/include/" h))) | |
36 | (scandir "." | |
37 | (lambda (x) | |
38 | (not (member x '("." "..")))))))))) | |
39 | (package | |
40 | (name "libffi") | |
a62b83d5 | 41 | (version "3.0.13") |
c44899a2 | 42 | (source (origin |
87f5d366 | 43 | (method url-fetch) |
c44899a2 LC |
44 | (uri |
45 | (string-append "ftp://sourceware.org/pub/libffi/" | |
46 | name "-" version ".tar.gz")) | |
47 | (sha256 | |
48 | (base32 | |
a62b83d5 | 49 | "077ibkf84bvcd6rw1m6jb107br63i2pp301rkmsbgg6300adxp8x")))) |
c44899a2 LC |
50 | (build-system gnu-build-system) |
51 | (arguments `(#:modules ((guix build utils) (guix build gnu-build-system) | |
56c092ce | 52 | (ice-9 ftw) (srfi srfi-26)) |
c44899a2 LC |
53 | #:phases (alist-cons-after 'install 'post-install |
54 | ,post-install-phase | |
56c092ce | 55 | %standard-phases))) |
9bf62d9b | 56 | (outputs '("out" "debug")) |
089b0634 | 57 | (synopsis "Foreign function call interface library") |
c44899a2 LC |
58 | (description |
59 | "The libffi library provides a portable, high level programming interface | |
60 | to various calling conventions. This allows a programmer to call any | |
61 | function specified by a call interface description at run-time. | |
62 | ||
63 | FFI stands for Foreign Function Interface. A foreign function interface is | |
64 | the popular name for the interface that allows code written in one language | |
65 | to call code written in another language. The libffi library really only | |
66 | provides the lowest, machine dependent layer of a fully featured foreign | |
67 | function interface. A layer must exist above libffi that handles type | |
68 | conversions for values passed between the two languages.") | |
69 | (home-page "http://sources.redhat.com/libffi/") | |
70 | ||
71 | ;; See <http://github.com/atgreen/libffi/blob/master/LICENSE>. | |
4a44e743 | 72 | (license expat)))) |
c44899a2 | 73 |