You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
3.3 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  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. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  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
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages libffi)
  19. #:use-module (gnu packages)
  20. #:use-module (guix licenses)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu))
  24. (define-public libffi
  25. (let ((post-install-phase
  26. ;; Install headers in the right place.
  27. '(lambda* (#:key outputs #:allow-other-keys)
  28. (define out (assoc-ref outputs "out"))
  29. (mkdir (string-append out "/include"))
  30. (with-directory-excursion
  31. (string-append out "/lib/libffi-3.0.13/include")
  32. (for-each (lambda (h)
  33. (format #t "moving `~a' to includedir~%" h)
  34. (rename-file h (string-append out "/include/" h)))
  35. (scandir "."
  36. (lambda (x)
  37. (not (member x '("." ".."))))))))))
  38. (package
  39. (name "libffi")
  40. (version "3.0.13")
  41. (source (origin
  42. (method url-fetch)
  43. (uri
  44. (string-append "ftp://sourceware.org/pub/libffi/"
  45. name "-" version ".tar.gz"))
  46. (sha256
  47. (base32
  48. "077ibkf84bvcd6rw1m6jb107br63i2pp301rkmsbgg6300adxp8x"))
  49. (patches (list (search-patch "libffi-mips-n32-fix.patch")))))
  50. (build-system gnu-build-system)
  51. (arguments `(#:modules ((guix build utils) (guix build gnu-build-system)
  52. (ice-9 ftw) (srfi srfi-26))
  53. #:phases (alist-cons-after 'install 'post-install
  54. ,post-install-phase
  55. %standard-phases)))
  56. (outputs '("out" "debug"))
  57. (synopsis "Foreign function call interface library")
  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. FFI stands for Foreign Function Interface. A foreign function interface is
  63. the popular name for the interface that allows code written in one language
  64. to call code written in another language. The libffi library really only
  65. provides the lowest, machine dependent layer of a fully featured foreign
  66. function interface. A layer must exist above libffi that handles type
  67. conversions for values passed between the two languages.")
  68. (home-page "http://sources.redhat.com/libffi/")
  69. ;; See <http://github.com/atgreen/libffi/blob/master/LICENSE>.
  70. (license expat))))