nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ fetchurl, stdenv, dejagnu, doCheck ? false
2, buildPlatform, hostPlatform
3}:
4
5stdenv.mkDerivation rec {
6 name = "libffi-3.2.1";
7
8 src = fetchurl {
9 url = "ftp://sourceware.org/pub/libffi/${name}.tar.gz";
10 sha256 = "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh";
11 };
12
13 patches = stdenv.lib.optional stdenv.isCygwin ./3.2.1-cygwin.patch;
14
15 outputs = [ "out" "dev" "man" "info" ];
16
17 buildInputs = stdenv.lib.optional doCheck dejagnu;
18
19 configureFlags = [
20 "--with-gcc-arch=generic" # no detection of -march= or -mtune=
21 "--enable-pax_emutramp"
22 ];
23
24 inherit doCheck;
25
26 dontStrip = hostPlatform != buildPlatform; # Don't run the native `strip' when cross-compiling.
27
28 # Install headers and libs in the right places.
29 postFixup = ''
30 mkdir -p "$dev/"
31 mv "$out/lib/${name}/include" "$dev/include"
32 rmdir "$out/lib/${name}"
33 substituteInPlace "$dev/lib/pkgconfig/libffi.pc" \
34 --replace 'includedir=''${libdir}/libffi-3.2.1' "includedir=$dev"
35 '';
36
37 meta = with stdenv.lib; {
38 description = "A foreign function call interface library";
39 longDescription = ''
40 The libffi library provides a portable, high level programming
41 interface to various calling conventions. This allows a
42 programmer to call any function specified by a call interface
43 description at run-time.
44
45 FFI stands for Foreign Function Interface. A foreign function
46 interface is the popular name for the interface that allows code
47 written in one language to call code written in another
48 language. The libffi library really only provides the lowest,
49 machine dependent layer of a fully featured foreign function
50 interface. A layer must exist above libffi that handles type
51 conversions for values passed between the two languages.
52 '';
53 homepage = http://sourceware.org/libffi/;
54 # See http://github.com/atgreen/libffi/blob/master/LICENSE .
55 license = licenses.free;
56 maintainers = [ ];
57 platforms = platforms.all;
58 };
59}