forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrelease-common.nix
103 lines (92 loc) · 2.51 KB
/
release-common.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
92
93
94
95
96
97
98
99
100
101
102
103
{ pkgs }:
let
inherit (pkgs) stdenv lib curl;
# TODO upstream
mesonFlag = key: value: "-D${key}=${value}";
mesonBool = feature: cond: mesonFlag feature (if cond then "true" else "false");
mesonFeature = feature: cond: mesonFlag feature (if cond then "enabled" else "disabled");
in
rec {
# Use "busybox-sandbox-shell" if present,
# if not (legacy) fallback and hope it's sufficient.
sh = pkgs.busybox-sandbox-shell or (pkgs.busybox.override {
useMusl = true;
enableStatic = true;
enableMinimal = true;
extraConfig = ''
CONFIG_FEATURE_FANCY_ECHO y
CONFIG_FEATURE_SH_MATH y
CONFIG_FEATURE_SH_MATH_64 y
CONFIG_ASH y
CONFIG_ASH_OPTIMIZE_FOR_SIZE y
CONFIG_ASH_ALIAS y
CONFIG_ASH_BASH_COMPAT y
CONFIG_ASH_CMDCMD y
CONFIG_ASH_ECHO y
CONFIG_ASH_GETOPTS y
CONFIG_ASH_INTERNAL_GLOB y
CONFIG_ASH_JOB_CONTROL y
CONFIG_ASH_PRINTF y
CONFIG_ASH_TEST y
'';
});
mesonFlags = [
"-Ddefault_library=static"
(mesonFeature "with_gc" true)
(mesonFeature "with_libsodium" stdenv.hostPlatform.isLinux)
(mesonFeature "with_editline" (!stdenv.hostPlatform.isWindows))
];
configureFlags =
[
"--enable-gc"
] ++ lib.optionals stdenv.isLinux [
"--with-sandbox-shell=${sh}/bin/busybox"
];
tarballDeps = with pkgs.buildPackages;
[ bison
flex
libxml2
libxslt
docbook5
docbook_xsl_ns
autoconf-archive
autoreconfHook
];
nativeBuildDeps = with pkgs.buildPackages; [
pkgconfig
meson
ninja
## Tests
#git
#mercurial
];
buildDeps = with pkgs; [
bzip2
xz
brotli
(if stdenv.hostPlatform.isWindows then openssl_1_0_2 else openssl)
sqlite
boehmgc
boost
curl
] ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
editline
] ++ lib.optionals stdenv.isLinux [libseccomp utillinuxMinimal]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optional (stdenv.isLinux || stdenv.isDarwin)
((aws-sdk-cpp.override {
apis = ["s3" "transfer"];
customMemoryManagement = false;
}).overrideDerivation (args: {
/*
patches = args.patches or [] ++ [ (fetchpatch {
url = https://github.com/edolstra/aws-sdk-cpp/commit/3e07e1f1aae41b4c8b340735ff9e8c735f0c063f.patch;
sha256 = "1pij0v449p166f9l29x7ppzk8j7g9k9mp15ilh5qxp29c7fnvxy2";
}) ];
*/
}));
perlDeps = with pkgs;
[ perl
perlPackages.DBDSQLite
];
}