diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml
index 465fa1e0b001..f39b393bf719 100644
--- a/doc/manual/expressions/builtins.xml
+++ b/doc/manual/expressions/builtins.xml
@@ -746,6 +746,11 @@ builtins.genList (x: x * x) 5
separate file, and use it from Nix expressions in other
files.
+ Unlike some languages, import is a regular
+ function in Nix. Paths using the angle bracket syntax (e.g.,
+ import <foo>) are normal path
+ values (see ).
+
A Nix expression loaded by import must
not contain any free variables (identifiers
that are not defined in the Nix expression itself and are not
diff --git a/doc/manual/packages/s3-substituter.xml b/doc/manual/packages/s3-substituter.xml
index 1722090efecc..868b5a66dc3c 100644
--- a/doc/manual/packages/s3-substituter.xml
+++ b/doc/manual/packages/s3-substituter.xml
@@ -159,7 +159,6 @@ the S3 URL:
"s3:ListBucket",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
- "s3:ListObjects",
"s3:PutObject"
],
"Resource": [
diff --git a/meson.build b/meson.build
index 8458312569bb..afa0f3255d51 100644
--- a/meson.build
+++ b/meson.build
@@ -44,7 +44,7 @@ config_h = configuration_data()
config_h.set(
'HAVE_CXX17', 1,
- description : 'define if the compiler supports basic C++17 syntax')
+ description : 'Define if the compiler supports basic C++17 syntax')
package_name = meson.project_name()
config_h.set_quoted(
@@ -163,7 +163,8 @@ if (cpp.has_header('sys/ndir.h'))
description : 'Define to 1 if you have the header file, and it defines `DIR`')
endif
-if (cpp.has_header('dirent.h'))
+has_dirent_h = cpp.has_header('dirent.h')
+if (has_dirent_h)
config_h.set(
'HAVE_DIRENT_H', 1,
description : 'Define to 1 if you have the header file, and it defines `DIR`')
@@ -309,6 +310,21 @@ if meson.get_compiler('cpp').compiles(
description : 'Define to 1 if you have the `pubsetbuf` function.')
endif
+
+
+# checking data types
+#============================================================================
+
+
+dirent_h_prefix = '''
+ #include
+ #include
+'''
+
+if has_dirent_h and meson.get_compiler('cpp').has_member('struct dirent', 'd_type', prefix: dirent_h_prefix)
+ config_h.set('HAVE_STRUCT_DIRENT_D_TYPE', 1)
+endif
+
# required dependancies
#============================================================================
@@ -330,8 +346,8 @@ tar = find_program('tar', required : true)
bzip2 = find_program('bzip2', required : true)
gzip = find_program('gzip', required : true)
xz = find_program('xz', required : true)
-dot = find_program('dot', required : true)
-lsof = find_program('lsof', required : true)
+dot = find_program('dot', required : false)
+lsof = find_program('lsof', required : false)
tr = find_program('tr', required : true)
coreutils = run_command('dirname', cat.path()).stdout().strip()
@@ -361,13 +377,13 @@ description : 'Whether link() works on symlinks')
#--------------------------------------------------
boost_dep = declare_dependency(
dependencies : [
- cpp.find_library('libboost_system', dirs : libdir),
- cpp.find_library('libboost_context', dirs : libdir),
- cpp.find_library('libboost_thread', dirs : libdir)],
+ cpp.find_library('boost_system'),
+ cpp.find_library('boost_context'),
+ cpp.find_library('boost_thread')],
link_args : get_option('boost_link_args'))
if (boost_dep.found())
- config_h.set('HAVE_BOOST', 1, description : 'define if the Boost library is available.')
+ config_h.set('HAVE_BOOST', 1, description : 'Define if the Boost library is available.')
endif
@@ -390,7 +406,7 @@ libbrotli_dep = declare_dependency(
# Look for OpenSSL, a required dependency.
#--------------------------------------------------
openssl_dep = declare_dependency(
- dependencies: cpp.find_library('libssl', dirs : libdir),
+ dependencies: cpp.find_library('ssl'),
link_args : get_option('openssl_link_args'))
@@ -418,14 +434,14 @@ pthread_dep = declare_dependency(
# Look for libdl, a required dependency.
#--------------------------------------------------
libdl_dep = declare_dependency(
- dependencies : cpp.find_library('dl', dirs : libdir),
+ dependencies : cpp.find_library('dl'),
link_args : get_option('dl_link_args'))
# Look for libbz2, a required dependency.
#--------------------------------------------------
libbz2_dep = declare_dependency(
- dependencies : cpp.find_library('bz2', dirs : libdir),
+ dependencies : cpp.find_library('bz2'),
link_args : get_option('bz2_link_args'))
@@ -437,7 +453,7 @@ libbz2_dep = declare_dependency(
# editline.h when the pkg-config approach fails.
editline_dep = declare_dependency(
- dependencies : cpp.find_library('libeditline'),
+ dependencies : cpp.find_library('editline'),
link_args : get_option('editline_link_args'))
if not (
@@ -458,13 +474,14 @@ endif
# Look for libsodium, an optional dependency.
#--------------------------------------------------
-if (get_option('with_libsodium'))
+libsodium_lib = cpp.find_library('sodium', required: get_option('with_libsodium'))
+if (libsodium_lib.found())
libsodium_dep = declare_dependency(
- dependencies : cpp.find_library('libsodium', dirs : libdir),
+ dependencies : libsodium_lib,
link_args : get_option('sodium_link_args'))
config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.')
else
- libsodium_dep = declare_dependency()
+ libsodium_dep = dependency('', required: false)
endif
@@ -478,7 +495,7 @@ if (get_option('with_gc'))
'HAVE_BOEHMGC', 1,
description : 'Whether to use the Boehm garbage collector.')
else
- gc_dep = declare_dependency()
+ gc_dep = dependency('', required: false)
endif
@@ -503,15 +520,16 @@ endif
# OS Specific checks
#============================================================================
# Look for libsecppomp, required for Linux sandboxing.
-libseccomp_dep = ''
if sys_name.contains('linux')
- libseccomp_dep = dependency('libseccomp', version : '>= 2.3.1', required: false)
- if not (libseccomp_dep.found())
- error('Nix requires libseccomp on a linux host system')
- endif
+ libseccomp_dep = dependency(
+ 'libseccomp',
+ version : '>= 2.3.1',
+ not_found_message : 'Nix requires libseccomp on a linux host system')
config_h.set(
'HAVE_SECCOMP', 1,
- description : 'Whether seccomp is available and should be used for sandboxing.')
+ description : 'Whether seccomp is available and should be used for sandboxing.')
+else
+ libseccomp_dep = dependency('', required: false)
endif
if (sys_name.contains('freebsd'))
@@ -552,4 +570,4 @@ project_dirs = [
foreach dir : project_dirs
subdir(dir)
-endforeach
\ No newline at end of file
+endforeach
diff --git a/meson_options.txt b/meson_options.txt
index 9bad1b2c4c65..96fced7d376d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -149,19 +149,19 @@ option(
'with_gc',
type : 'boolean',
value : 'false',
- description : 'build nix with Boehm garbage collector')
+ description : 'Build nix with Boehm garbage collector')
option(
'with_libsodium',
- type : 'boolean',
- value : 'true',
- description : 'build nix with shared libs')
+ type : 'feature',
+ value : 'auto',
+ description : 'Build nix with libsodium')
option(
'with_s3',
type : 'boolean',
value : 'false',
- description : 'build nix with s3')
+ description : 'Build nix with s3')
option(
'with_coreutils_bin',
@@ -182,7 +182,7 @@ option(
'build_shared_libs',
type : 'boolean',
value : 'false',
- description : 'build nix with shared libs')
+ description : 'Build nix with shared libs')
option(
'sandbox_shell',
diff --git a/release-common.nix b/release-common.nix
index 2e8a951b9cd2..1da042d95550 100644
--- a/release-common.nix
+++ b/release-common.nix
@@ -1,11 +1,17 @@
{ pkgs }:
-with 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 (busybox.override {
+ sh = pkgs.busybox-sandbox-shell or (pkgs.busybox.override {
useMusl = true;
enableStatic = true;
enableMinimal = true;
@@ -29,6 +35,11 @@ rec {
'';
});
+ mesonFlags = [
+ (mesonBool "with_gc" true)
+ (mesonFeature "with_libsodium" stdenv.hostPlatform.isLinux)
+ ];
+
configureFlags =
[
"--enable-gc"
@@ -36,7 +47,7 @@ rec {
"--with-sandbox-shell=${sh}/bin/busybox"
];
- tarballDeps =
+ tarballDeps = with pkgs.buildPackages;
[ bison
flex
libxml2
@@ -47,10 +58,22 @@ rec {
autoreconfHook
];
- buildDeps =
- [ curl
- bzip2 xz brotli editline
- openssl pkgconfig sqlite boehmgc
+ nativeBuildDeps = with pkgs.buildPackages; [
+ pkgconfig
+ meson
+ ninja
+ ];
+
+ buildDeps = with pkgs;
+ [
+ curl
+ bzip2
+ xz
+ brotli
+ editline
+ openssl
+ sqlite
+ boehmgc
boost
# Tests
@@ -72,7 +95,7 @@ rec {
*/
}));
- perlDeps =
+ perlDeps = with pkgs;
[ perl
perlPackages.DBDSQLite
];
diff --git a/release.nix b/release.nix
index 0fe6835186b0..a93fd8275688 100644
--- a/release.nix
+++ b/release.nix
@@ -1,5 +1,5 @@
{ nix ? builtins.fetchGit ./.
-, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz
+, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz
, officialRelease ? false
, systems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]
}:
@@ -23,7 +23,8 @@ let
src = nix;
inherit officialRelease;
- buildInputs = tarballDeps ++ buildDeps;
+ nativeBuildInputs = tarballDeps ++ nativeBuildDeps;
+ buildInputs = buildDeps;
configureFlags = "--enable-gc";
@@ -65,6 +66,7 @@ let
name = "nix";
src = tarball;
+ nativeBuildInputs = nativeBuildDeps;
buildInputs = buildDeps;
preConfigure =
@@ -80,6 +82,8 @@ let
''}
'';
+ inherit mesonFlags;
+
configureFlags = configureFlags ++
[ "--sysconfdir=/etc" ];
@@ -196,6 +200,7 @@ let
name = "nix-build";
src = tarball;
+ nativeBuildInputs = nativeBuildDeps;
buildInputs = buildDeps;
dontInstall = false;
diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh
index d060e5165a8b..13762cba3897 100644
--- a/scripts/install-multi-user.sh
+++ b/scripts/install-multi-user.sh
@@ -19,9 +19,6 @@ readonly BLUE_UL='\033[38;4;34m'
readonly GREEN='\033[38;32m'
readonly GREEN_UL='\033[38;4;32m'
readonly RED='\033[38;31m'
-readonly RED_UL='\033[38;4;31m'
-readonly YELLOW='\033[38;33m'
-readonly YELLOW_UL='\033[38;4;33m'
readonly NIX_USER_COUNT="32"
readonly NIX_BUILD_GROUP_ID="30000"
diff --git a/shell.nix b/shell.nix
index 8167f87a2929..f723ca2f8150 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,15 +1,21 @@
-{ useClang ? false }:
+{ useClang ? false, crossSystem ? null }:
-with import (builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz) {};
+let
+ pkgsSrc = builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz;
+in
+
+with import pkgsSrc { inherit crossSystem; };
with import ./release-common.nix { inherit pkgs; };
(if useClang then clangStdenv else stdenv).mkDerivation {
name = "nix";
- buildInputs = buildDeps ++ tarballDeps ++ perlDeps;
+ nativeBuildInputs = nativeBuildDeps ++ tarballDeps;
+
+ buildInputs = buildDeps ++ perlDeps;
- inherit configureFlags;
+ inherit mesonFlags configureFlags;
enableParallelBuilding = true;