summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-11-26 20:38:17 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-11-26 20:38:17 +0200
commit2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3 (patch)
treeee8626350d7cc181b68ed1511ddb4a16afaba78a /pkgs
parente24df8ea69667ba5965406860f9520ad7535fed3 (diff)
downloadnixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.tar
nixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.tar.gz
nixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.tar.bz2
nixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.tar.lz
nixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.tar.xz
nixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.tar.zst
nixpkgs-2d679dbe745e05e62a0f14c0fad12f83f3d4e2b3.zip
ntp: Don't use seccomp on non-x86
It only has the allowed system call numbers defined for i386 and x86_64
so it fails to build otherwise.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/ntp/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/tools/networking/ntp/default.nix b/pkgs/tools/networking/ntp/default.nix
index a37b1bdbd98..64f4b9008b1 100644
--- a/pkgs/tools/networking/ntp/default.nix
+++ b/pkgs/tools/networking/ntp/default.nix
@@ -1,8 +1,12 @@
-{ stdenv, fetchurl, openssl, perl, libcap ? null, libseccomp ? null }:
+{ stdenv, lib, fetchurl, openssl, perl, libcap ? null, libseccomp ? null }:
 
 assert stdenv.isLinux -> libcap != null;
 assert stdenv.isLinux -> libseccomp != null;
 
+let
+  withSeccomp = stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64);
+in
+
 stdenv.mkDerivation rec {
   name = "ntp-4.2.8p9";
 
@@ -17,12 +21,10 @@ stdenv.mkDerivation rec {
     "--with-openssl-libdir=${openssl.out}/lib"
     "--with-openssl-incdir=${openssl.dev}/include"
     "--enable-ignore-dns-errors"
-  ] ++ stdenv.lib.optionals stdenv.isLinux [
-    "--enable-linuxcaps"
-    "--enable-libseccomp"
-  ];
+  ] ++ stdenv.lib.optional stdenv.isLinux "--enable-linuxcaps"
+    ++ stdenv.lib.optional withSeccomp "--enable-libseccomp";
 
-  buildInputs = [ libcap openssl libseccomp perl ];
+  buildInputs = [ libcap openssl perl ] ++ lib.optional withSeccomp libseccomp;
 
   hardeningEnable = [ "pie" ];