2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoreconfHook
|
|
|
|
|
|
|
|
}:
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "libffi";
|
|
|
|
version = "3.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "https://sourceware.org/pub/libffi/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "info" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-gcc-arch=generic" # no detection of -march= or -mtune=
|
|
|
|
"--enable-pax_emutramp"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# The tests use -O0 which is not compatible with -D_FORTIFY_SOURCE.
|
|
|
|
NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/}
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A foreign function call interface library";
|
|
|
|
longDescription = ''
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
homepage = "http://sourceware.org/libffi/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ matthewbauer ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|