diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libffi')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libffi/default.nix | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libffi/default.nix b/nixpkgs/pkgs/development/libraries/libffi/default.nix new file mode 100644 index 000000000000..cc080e7c6388 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libffi/default.nix @@ -0,0 +1,58 @@ +{ stdenv, fetchurl, fetchpatch +, autoreconfHook + +# libffi is used in darwin stdenv +# we cannot run checks within it +, doCheck ? !stdenv.isDarwin, dejagnu +}: + +stdenv.mkDerivation rec { + name = "libffi-3.3"; + + src = fetchurl { + url = "https://sourceware.org/pub/libffi/${name}.tar.gz"; + 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/} + ''; + + checkInputs = [ dejagnu ]; + + inherit doCheck; + + dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling. + + meta = with stdenv.lib; { + 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; + }; +} |