;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2020, 2021 Ludovic Courtès ;;; Copyright © 2014 Federico Beffa ;;; Copyright © 2015, 2019 Ricardo Wurmus ;;; Copyright © 2016, 2017, 2020, 2021 Efraim Flashner ;;; Copyright © 2016, 2017 Ben Woodcroft ;;; Copyright © 2017, 2019, 2020, 2022 Marius Bakke ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2019, 2021 Maxim Cournoyer ;;; Copyright © 2020 John Doe ;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; Copyright © 2024 Sharlatan Hellseher ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages libffi) #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix gexp) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (gnu packages check) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-xyz) #:use-module (gnu packages ruby) #:use-module (gnu packages sphinx) #:use-module (guix build-system gnu) #:use-module (guix build-system pyproject) #:use-module ((guix build-system python) #:select (pypi-uri)) #:use-module (guix build-system ruby)) (define-public libffi (package (name "libffi") (version "3.4.4") (source (origin (method url-fetch) (uri (string-append "https://github.com/libffi/libffi/releases" "/download/v" version "/" name "-" version ".tar.gz")) (sha256 (base32 "0xpn5mqlbdmqgxgp910ba1qj79axpwr8nh7wklmcz0ls4nnmcv6n")))) (build-system gnu-build-system) (arguments `(;; Prevent the build system from passing -march and -mtune to the ;; compiler. See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4". #:configure-flags '("--enable-portable-binary" "--without-gcc-arch" ,@(if (or (target-hurd64?) (%current-target-system)) (list (string-append "CFLAGS=-g -O2" " -Wno-implicit-function-declaration")) '())))) (outputs '("out" "debug")) (synopsis "Foreign function call interface library") (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 "https://www.sourceware.org/libffi/") (properties `((release-monitoring-url . ,home-page))) ;; See . (license expat))) ;; Provide a variant without static trampolines as some packages ;; (particularly GHC < 9) cannot handle them. See ;; for a discussion. (define-public libffi-sans-static-trampolines (hidden-package (package/inherit libffi (arguments (substitute-keyword-arguments (package-arguments libffi) ((#:configure-flags flags #~'()) #~(append #$flags '("--disable-exec-static-tramp")))))))) (define-public python-cffi (package (name "python-cffi") (version "1.17.1") (source (origin (method url-fetch) (uri (pypi-uri "cffi" version)) (sha256 (base32 "0918qn4y