lol
at 23.05-pre 83 lines 2.8 kB view raw
1{ lib, stdenv, fetchurl, fetchpatch 2, autoreconfHook 3 4 # test suite depends on dejagnu which cannot be used during bootstrapping 5 # dejagnu also requires tcl which can't be built statically at the moment 6, doCheck ? !(stdenv.hostPlatform.isStatic) 7, dejagnu 8, nix-update-script 9}: 10 11stdenv.mkDerivation rec { 12 pname = "libffi"; 13 version = "3.4.4"; 14 15 src = fetchurl { 16 url = "https://github.com/libffi/libffi/releases/download/v${version}/${pname}-${version}.tar.gz"; 17 sha256 = "sha256-1mxWrSWags8qnfxAizK/XaUjcVALhHRff7i2RXEt9nY="; 18 }; 19 20 # Note: this package is used for bootstrapping fetchurl, and thus 21 # cannot use fetchpatch! All mutable patches (generated by GitHub or 22 # cgit) that are needed here should be included directly in Nixpkgs as 23 # files. 24 patches = [ 25 ]; 26 27 strictDeps = true; 28 outputs = [ "out" "dev" "man" "info" ]; 29 30 enableParallelBuilding = true; 31 32 configurePlatforms = [ "build" "host" ]; 33 34 configureFlags = [ 35 "--with-gcc-arch=generic" # no detection of -march= or -mtune= 36 "--enable-pax_emutramp" 37 38 # Causes issues in downstream packages which misuse ffi_closure_alloc 39 # Reenable once these issues are fixed and merged: 40 # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6155 41 # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/283 42 "--disable-exec-static-tramp" 43 ]; 44 45 preCheck = '' 46 # The tests use -O0 which is not compatible with -D_FORTIFY_SOURCE. 47 NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/} 48 ''; 49 50 dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling. 51 52 inherit doCheck; 53 54 checkInputs = [ dejagnu ]; 55 56 passthru = { 57 updateScript = nix-update-script { 58 attrPath = pname; 59 }; 60 }; 61 62 meta = with lib; { 63 description = "A foreign function call interface library"; 64 longDescription = '' 65 The libffi library provides a portable, high level programming 66 interface to various calling conventions. This allows a 67 programmer to call any function specified by a call interface 68 description at run-time. 69 70 FFI stands for Foreign Function Interface. A foreign function 71 interface is the popular name for the interface that allows code 72 written in one language to call code written in another 73 language. The libffi library really only provides the lowest, 74 machine dependent layer of a fully featured foreign function 75 interface. A layer must exist above libffi that handles type 76 conversions for values passed between the two languages. 77 ''; 78 homepage = "http://sourceware.org/libffi/"; 79 license = licenses.mit; 80 maintainers = with maintainers; [ matthewbauer ]; 81 platforms = platforms.all; 82 }; 83}