-
Notifications
You must be signed in to change notification settings - Fork 363
/
overlay.nix
91 lines (81 loc) · 3.18 KB
/
overlay.nix
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
final: prev: {
pkgsIncludeOS = prev.pkgsStatic.lib.makeScope prev.pkgsStatic.newScope (self: {
# self.callPackage will use this stdenv.
stdenv = prev.pkgsStatic.llvmPackages_16.libcxxStdenv;
# Deps
musl-includeos = self.callPackage ./deps/musl/default.nix { };
uzlib = self.callPackage ./deps/uzlib/default.nix { };
botan2 = self.callPackage ./deps/botan/default.nix { };
microsoft_gsl = self.callPackage ./deps/GSL/default.nix { };
s2n-tls = self.callPackage ./deps/s2n/default.nix { };
http-parser = self.callPackage ./deps/http-parser/default.nix { };
# IncludeOS
includeos = self.stdenv.mkDerivation rec {
enableParallelBuilding = true;
pname = "includeos";
version = "dev";
src = prev.pkgsStatic.lib.fileset.toSource {
root = ./.;
# Only include files needed by IncludeOS (not examples, docs etc)
fileset = prev.pkgsStatic.lib.fileset.unions [
./src
./api
./cmake
./deps
./userspace
./lib
./CMakeLists.txt
];
};
# If you need to patch, this is the place
postPatch = '''';
nativeBuildInputs = [
prev.cmake
prev.nasm
];
buildInputs = [
# TODO:
# including musl here makes the compiler pick up musl's libc headers
# before libc++'s libc headers, which doesn't work. See e.g. <cstdint>
# line 149;
# error <cstdint> tried including <stdint.h> but didn't find libc++'s <stdint.h> header.
# #ifndef _LIBCPP_STDINT_H
# error <cstdint> tried including <stdint.h> but didn't find libc++'s <stdint.h> header. \
# This usually means that your header search paths are not configured properly. \
# The header search paths should contain the C++ Standard Library headers before \
# any C Standard Library, and you are probably using compiler flags that make that \
# not be the case.
# #endif
#
# With this commented out IncludeOS builds with Nix libc++, which is great,
# but might bite us later because it then uses a libc we didn't patch.
# Best case we case we can adapt our own musl to be identical, use nix static
# musl for compilation, and includeos-musl only for linking.
#
# musl-includeos 👈 this has to come in after libc++ headers.
self.botan2
self.http-parser
self.microsoft_gsl
prev.pkgsStatic.openssl
prev.pkgsStatic.rapidjson
#self.s2n-tls 👈 This is postponed until we can fix the s2n build.
self.uzlib
];
# Add some pasthroughs, for easily building the depdencies (for debugging):
# $ nix-build -A NAME
passthru = {
inherit (self) uzlib;
inherit (self) http-parser;
inherit (self) botan2;
#inherit (self) s2n-tls;
inherit (self) musl-includeos;
inherit (self) cmake;
};
meta = {
description = "Run your application with zero overhead";
homepage = "https://www.includeos.org/";
license = prev.pkgsStatic.lib.licenses.asl20;
};
};
});
}