Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / libffi.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages libffi)
21 #:use-module (gnu packages)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu))
26
27 (define-public libffi
28 (let ((post-install-phase
29 ;; Keep headers where libffi.pc expects them, but also make them
30 ;; available in $includedir where some users expect them.
31 '(lambda* (#:key outputs #:allow-other-keys)
32 (define out (assoc-ref outputs "out"))
33 (symlink (string-append out "/lib/libffi-3.2.1/include")
34 (string-append out "/include")))))
35 (package
36 (name "libffi")
37 (version "3.2.1")
38 (source (origin
39 (method url-fetch)
40 (uri
41 (string-append "ftp://sourceware.org/pub/libffi/"
42 name "-" version ".tar.gz"))
43 (sha256
44 (base32
45 "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh"))
46 (patches (search-patches "libffi-3.2.1-complex-alpha.patch"))))
47 (build-system gnu-build-system)
48 (arguments `(#:phases (alist-cons-after 'install 'post-install
49 ,post-install-phase
50 %standard-phases)))
51 (outputs '("out" "debug"))
52 (synopsis "Foreign function call interface library")
53 (description
54 "The libffi library provides a portable, high level programming interface
55 to various calling conventions. This allows a programmer to call any
56 function specified by a call interface description at run-time.
57
58 FFI stands for Foreign Function Interface. A foreign function interface is
59 the popular name for the interface that allows code written in one language
60 to call code written in another language. The libffi library really only
61 provides the lowest, machine dependent layer of a fully featured foreign
62 function interface. A layer must exist above libffi that handles type
63 conversions for values passed between the two languages.")
64 (home-page "http://sources.redhat.com/libffi/")
65
66 ;; See <https://github.com/atgreen/libffi/blob/master/LICENSE>.
67 (license expat))))
68