-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlibffi-cosmo.nix
More file actions
57 lines (44 loc) · 1.22 KB
/
libffi-cosmo.nix
File metadata and controls
57 lines (44 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ pkgs
, cosmocc-4-bin
}:
pkgs.stdenv.mkDerivation rec {
pname = "libffi-cosmo";
version = pkgs.libffi.version;
src = pkgs.libffi.src;
patches = pkgs.libffi.patches;
strictDeps = pkgs.libffi.strictDeps;
outputs = [
"out"
"dev"
];
configurePlatforms = [
"host"
];
nativeBuildInputs = pkgs.libffi.nativeBuildInputs;
dontDisableStatic = true;
configureFlags = [
"--enable-static"
"--disable-raw-api"
"--disable-shared"
"--disable-docs"
"--with-gcc-arch=generic"
"--enable-pax_emutramp"
];
preConfigure = ''
#NOTYET export CC=${cosmocc-4-bin}/bin/cosmocc
export CC=${cosmocc-4-bin}/bin/x86_64-unknown-cosmo-cc
export CPP=${cosmocc-4-bin}/bin/x86_64-unknown-cosmo-cc
export TMPDIR=.
'';
postConfigure = ''
echo '#define __linux__ 1' >> x86_64-unknown-linux-gnu/fficonfig.h
echo '#define off_t ssize_t' >> x86_64-unknown-linux-gnu/fficonfig.h
echo '#define NO_JAVA_RAW_API' >> x86_64-unknown-linux-gnu/fficonfig.h
echo '#undef HAVE_MEMFD_CREATE' >> x86_64-unknown-linux-gnu/fficonfig.h
'';
meta = with pkgs.lib; {
description = "libffi built with Cosmopolitan libc";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
}