Merge pull request #46101 from oxij/pkg/nix-options

nix: fix a tiny option bug, make AWS support optional
This commit is contained in:
Eelco Dolstra 2018-09-05 19:57:21 +02:00 committed by GitHub
commit b4dd956bb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,12 @@
{ lib, stdenv, fetchurl, fetchFromGitHub, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz
, pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli, boost
, pkgconfig, boehmgc, perlPackages, libsodium, brotli, boost
, autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns
, busybox-sandbox-shell
, storeDir ? "/nix/store"
, stateDir ? "/nix/var"
, confDir ? "/etc"
, withLibseccomp ? libseccomp.meta.available, libseccomp
, withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
}:
let
@ -31,7 +32,7 @@ let
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optionals is20 [ brotli boost ]
++ lib.optional withLibseccomp libseccomp
++ lib.optional ((stdenv.isLinux || stdenv.isDarwin) && is20)
++ lib.optional (withAWS && is20)
((aws-sdk-cpp.override {
apis = ["s3" "transfer"];
customMemoryManagement = false;
@ -74,7 +75,7 @@ let
stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform ? nix && stdenv.hostPlatform.nix ? system
) ''--with-system=${stdenv.hostPlatform.nix.system}''
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
++ lib.optional (!libseccomp.meta.available) "--disable-seccomp-sandboxing";
++ lib.optional (!withLibseccomp) "--disable-seccomp-sandboxing";
makeFlags = "profiledir=$(out)/etc/profile.d";