mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
Fix static build
This commit is contained in:
parent
874ff000d4
commit
f7ce10dbc1
3 changed files with 21 additions and 17 deletions
|
@ -33,7 +33,7 @@
|
||||||
, rapidcheck
|
, rapidcheck
|
||||||
, sqlite
|
, sqlite
|
||||||
, toml11
|
, toml11
|
||||||
, util-linux
|
, unixtools
|
||||||
, xz
|
, xz
|
||||||
|
|
||||||
, busybox-sandbox-shell ? null
|
, busybox-sandbox-shell ? null
|
||||||
|
@ -195,7 +195,7 @@ in {
|
||||||
man # for testing `nix-* --help`
|
man # for testing `nix-* --help`
|
||||||
] ++ lib.optionals (doInstallCheck || enableManual) [
|
] ++ lib.optionals (doInstallCheck || enableManual) [
|
||||||
jq # Also for custom mdBook preprocessor.
|
jq # Also for custom mdBook preprocessor.
|
||||||
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
] ++ lib.optional stdenv.hostPlatform.isStatic unixtools.hexdump
|
||||||
;
|
;
|
||||||
|
|
||||||
buildInputs = lib.optionals doBuild [
|
buildInputs = lib.optionals doBuild [
|
||||||
|
|
|
@ -99,15 +99,6 @@ deps_public += nlohmann_json
|
||||||
sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19')
|
sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19')
|
||||||
deps_private += sqlite
|
deps_private += sqlite
|
||||||
|
|
||||||
|
|
||||||
enable_embedded_sandbox_shell = get_option('embedded-sandbox-shell')
|
|
||||||
if enable_embedded_sandbox_shell
|
|
||||||
# This one goes in config.h
|
|
||||||
# The path to busybox is passed as a -D flag when compiling this_library.
|
|
||||||
# Idk why, ask the old buildsystem.
|
|
||||||
configdata.set('HAVE_EMBEDDED_SANDBOX_SHELL', 1)
|
|
||||||
endif
|
|
||||||
|
|
||||||
generated_headers = []
|
generated_headers = []
|
||||||
foreach header : [
|
foreach header : [
|
||||||
'schema.sql',
|
'schema.sql',
|
||||||
|
@ -122,7 +113,13 @@ foreach header : [
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if enable_embedded_sandbox_shell
|
busybox = find_program(get_option('sandbox-shell'), required : false)
|
||||||
|
|
||||||
|
if get_option('embedded-sandbox-shell')
|
||||||
|
# This one goes in config.h
|
||||||
|
# The path to busybox is passed as a -D flag when compiling this_library.
|
||||||
|
# Idk why, ask the old buildsystem.
|
||||||
|
configdata.set('HAVE_EMBEDDED_SANDBOX_SHELL', 1)
|
||||||
hexdump = find_program('hexdump', native : true)
|
hexdump = find_program('hexdump', native : true)
|
||||||
embedded_sandbox_shell_gen = custom_target(
|
embedded_sandbox_shell_gen = custom_target(
|
||||||
'embedded-sandbox-shell.gen.hh',
|
'embedded-sandbox-shell.gen.hh',
|
||||||
|
@ -371,11 +368,15 @@ cpp_str_defines += {
|
||||||
'LSOF': lsof_path
|
'LSOF': lsof_path
|
||||||
}
|
}
|
||||||
|
|
||||||
#if busybox.found()
|
if get_option('embedded-sandbox-shell')
|
||||||
cpp_str_defines += {
|
cpp_str_defines += {
|
||||||
# 'SANDBOX_SHELL': busybox.full_path()
|
'SANDBOX_SHELL': '__embedded_sandbox_shell__'
|
||||||
}
|
}
|
||||||
#endif
|
elif busybox.found()
|
||||||
|
cpp_str_defines += {
|
||||||
|
'SANDBOX_SHELL': busybox.full_path()
|
||||||
|
}
|
||||||
|
endif
|
||||||
|
|
||||||
cpp_args = []
|
cpp_args = []
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
, meson
|
, meson
|
||||||
, ninja
|
, ninja
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
, unixtools
|
||||||
|
|
||||||
, nix-util
|
, nix-util
|
||||||
, boost
|
, boost
|
||||||
|
@ -20,6 +21,8 @@
|
||||||
|
|
||||||
, versionSuffix ? ""
|
, versionSuffix ? ""
|
||||||
|
|
||||||
|
, embeddedSandboxShell ? stdenv.hostPlatform.isStatic
|
||||||
|
|
||||||
# Check test coverage of Nix. Probably want to use with at least
|
# Check test coverage of Nix. Probably want to use with at least
|
||||||
# one of `doCheck` or `doInstallCheck` enabled.
|
# one of `doCheck` or `doInstallCheck` enabled.
|
||||||
, withCoverageChecks ? false
|
, withCoverageChecks ? false
|
||||||
|
@ -66,7 +69,7 @@ mkDerivation (finalAttrs: {
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
pkg-config
|
pkg-config
|
||||||
];
|
] ++ lib.optional embeddedSandboxShell unixtools.hexdump;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
boost
|
boost
|
||||||
|
@ -96,7 +99,7 @@ mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
|
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
|
||||||
(lib.mesonBool "embedded-sandbox-shell" stdenv.hostPlatform.isStatic)
|
(lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell)
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
|
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue