gnu: gnome: Depend on xdg-user-dirs.
[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 (build-system gnu-build-system)
47 (arguments `(#:phases (alist-cons-after 'install 'post-install
48 ,post-install-phase
49 %standard-phases)))
50 (outputs '("out" "debug"))
51 (synopsis "Foreign function call interface library")
52 (description
53 "The libffi library provides a portable, high level programming interface
54 to various calling conventions. This allows a programmer to call any
55 function specified by a call interface description at run-time.
56
57 FFI stands for Foreign Function Interface. A foreign function interface is
58 the popular name for the interface that allows code written in one language
59 to call code written in another language. The libffi library really only
60 provides the lowest, machine dependent layer of a fully featured foreign
61 function interface. A layer must exist above libffi that handles type
62 conversions for values passed between the two languages.")
63 (home-page "http://sources.redhat.com/libffi/")
64
65 ;; See <https://github.com/atgreen/libffi/blob/master/LICENSE>.
66 (license expat))))
67