about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-05-20 13:20:53 +0200
committerVladimír Čunát <vcunat@gmail.com>2018-05-20 13:20:53 +0200
commit392e6de7d0cc9a65a7fd195fd1304310a30a8489 (patch)
treefefd8ca07d3e2665a4746ac0fd43d0c7965d660e /pkgs/os-specific
parent90c01001396e166fabfbcfb955de2a5409a95d9b (diff)
parent68cdc9c09e38e704a3bed720fc182f1907035375 (diff)
downloadnixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.gz
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.bz2
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.lz
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.xz
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.zst
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.zip
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/darwin/m-cli/default.nix45
-rw-r--r--pkgs/os-specific/linux/dpdk/default.nix12
-rw-r--r--pkgs/os-specific/linux/odp-dpdk/configure.patch32
-rw-r--r--pkgs/os-specific/linux/odp-dpdk/default.nix26
-rw-r--r--pkgs/os-specific/linux/odp-dpdk/odp_crypto.patch18
-rw-r--r--pkgs/os-specific/linux/pktgen/Makefile.patch34
-rw-r--r--pkgs/os-specific/linux/pktgen/default.nix40
-rw-r--r--pkgs/os-specific/linux/tmon/default.nix1
-rw-r--r--pkgs/os-specific/linux/wireguard/default.nix81
9 files changed, 112 insertions, 177 deletions
diff --git a/pkgs/os-specific/darwin/m-cli/default.nix b/pkgs/os-specific/darwin/m-cli/default.nix
new file mode 100644
index 000000000000..75f1113e9f08
--- /dev/null
+++ b/pkgs/os-specific/darwin/m-cli/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "m-cli-${version}";
+  version = "0.2.5";
+
+  src = fetchFromGitHub {
+    owner = "rgcr";
+    repo = "m-cli";
+    rev = "v${version}";
+    sha512 = "0mkcx7jq91pbfs8327qc8434gj73fvjgdfdsrza0lyd9wns6jhsqsf0585klzl68aqscvksgzi2asdnim4va35cdkp2fdzl0g3sm4kd";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    local MPATH="$out/share/m"
+
+    gawk -i inplace '{
+      gsub(/^\[ -L.*|^\s+\|\| pushd.*|^popd.*/, "");
+      gsub(/MPATH=.*/, "MPATH='$MPATH'");
+      gsub(/(update|uninstall)_mcli \&\&.*/, "echo NOOP \\&\\& exit 0");
+      print
+    }' m
+
+    install -Dt "$MPATH/plugins" -m755 plugins/*
+
+    install -Dm755 m $out/bin/m
+
+    install -Dt "$out/share/bash-completion/completions/" -m444 completion/bash/m
+    install -Dt "$out/share/fish/vendor_completions.d/" -m444 completion/fish/m.fish
+    install -Dt "$out/share/zsh/site-functions/" -m444 completion/zsh/_m
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Swiss Army Knife for macOS";
+    inherit (src.meta) homepage;
+    repositories.git = git://github.com/rgcr/m-cli.git;
+
+    license = licenses.mit;
+
+    platforms = platforms.darwin;
+    maintainers = with maintainers; [ yurrriq ];
+  };
+}
diff --git a/pkgs/os-specific/linux/dpdk/default.nix b/pkgs/os-specific/linux/dpdk/default.nix
index 4bd50fdae40f..fd45e83c26b5 100644
--- a/pkgs/os-specific/linux/dpdk/default.nix
+++ b/pkgs/os-specific/linux/dpdk/default.nix
@@ -1,24 +1,22 @@
-{ stdenv, lib, kernel, fetchurl, pkgconfig, libvirt }:
-
-assert lib.versionAtLeast kernel.version "3.18";
+{ stdenv, kernel, fetchurl, pkgconfig, numactl }:
 
 stdenv.mkDerivation rec {
   name = "dpdk-${version}-${kernel.version}";
-  version = "17.05.1";
+  version = "17.11.2";
 
   src = fetchurl {
     url = "http://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
-    sha256 = "1w3nx5cqf8z600bdlbwz7brmdb5yn233qrqvv24kbmmxhbwp7qld";
+    sha256 = "19m5l3jkrns8r1zbjb6ry18w50ff36kbl5b5g6pfcp9p57sfisd2";
   };
 
   nativeBuildInputs = [ pkgconfig ] ++ kernel.moduleBuildDependencies;
-  buildInputs = [ libvirt ];
+  buildInputs = [ numactl ];
 
   RTE_KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
   RTE_TARGET = "x86_64-native-linuxapp-gcc";
 
   # we need sse3 instructions to build
-  NIX_CFLAGS_COMPILE = [ "-march=core2" ];
+  NIX_CFLAGS_COMPILE = [ "-msse3" ];
 
   enableParallelBuilding = true;
   outputs = [ "out" "kmod" ];
diff --git a/pkgs/os-specific/linux/odp-dpdk/configure.patch b/pkgs/os-specific/linux/odp-dpdk/configure.patch
deleted file mode 100644
index 3dadc98e8342..000000000000
--- a/pkgs/os-specific/linux/odp-dpdk/configure.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index 001ebfc2893b..7d19ebcd213f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -215,7 +215,7 @@ AC_SUBST([testdir])
- ##########################################################################
- AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ])
- AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ])
--AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])
-+AM_CONDITIONAL([HAVE_PCAP], [test x$have_pcap = xyes])
- AM_CONDITIONAL([DPDK_DEFAULT_DIR], [test "x${DPDK_DEFAULT_DIR}" = "x1"])
- AM_CONDITIONAL([test_installdir], [test "$testdir" != ""])
- AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
-@@ -320,18 +320,6 @@ ODP_CFLAGS="$ODP_CFLAGS -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonli
- ODP_CFLAGS="$ODP_CFLAGS -Wformat-security -Wundef -Wwrite-strings"
- ODP_CFLAGS="$ODP_CFLAGS -std=gnu99"
- 
--dnl Use -Werror in the checks below since Clang emits a warning instead of
--dnl an error when it encounters an unknown warning option.
--AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=0],
--                      [ODP_CFLAGS="$ODP_CFLAGS -Wimplicit-fallthrough=0"],
--                      [], [-Werror])
--AX_CHECK_COMPILE_FLAG([-Wformat-truncation=0],
--                      [ODP_CFLAGS="$ODP_CFLAGS -Wformat-truncation=0"],
--                      [], [-Werror])
--AX_CHECK_COMPILE_FLAG([-Wformat-overflow=0],
--                      [ODP_CFLAGS="$ODP_CFLAGS -Wformat-overflow=0"],
--                      [], [-Werror])
--
- # Extra flags for example to suppress certain warning types
- ODP_CFLAGS="$ODP_CFLAGS $ODP_CFLAGS_EXTRA"
- 
diff --git a/pkgs/os-specific/linux/odp-dpdk/default.nix b/pkgs/os-specific/linux/odp-dpdk/default.nix
index a444243e802e..cf4f9df26777 100644
--- a/pkgs/os-specific/linux/odp-dpdk/default.nix
+++ b/pkgs/os-specific/linux/odp-dpdk/default.nix
@@ -1,31 +1,27 @@
-{ stdenv, fetchgit, autoreconfHook, openssl, libpcap, dpdk }:
+{ stdenv, fetchurl, autoreconfHook, pkgconfig
+, dpdk, libconfig, libpcap, numactl, openssl
+}:
 
 stdenv.mkDerivation rec {
   name = "odp-dpdk-${version}";
-  version = "1.15.0.0";
+  version = "1.19.0.0_DPDK_17.11";
 
-  src = fetchgit {
-    url = "https://git.linaro.org/lng/odp-dpdk.git";
-    rev = "d8533b4e575d62c9f6f2caedd38d98a1a56fb8d3";
-    sha256 = "1p09rw7dxxqcxxrdb8wbwp2imapyjvdbvap7s9km2i9hbd8ipdif";
+  src = fetchurl {
+    url = "https://git.linaro.org/lng/odp-dpdk.git/snapshot/${name}.tar.gz";
+    sha256 = "05bwjaxl9hqc6fbkp95nniq11g3kvzmlxw0bq55i7p2v35nv38px";
   };
 
-  nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ openssl dpdk libpcap ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ dpdk libconfig libpcap numactl openssl ];
 
-  RTE_SDK = "${dpdk}";
+  RTE_SDK = dpdk;
   RTE_TARGET = "x86_64-native-linuxapp-gcc";
 
   dontDisableStatic = true;
 
   configureFlags = [
     "--disable-shared"
-    "--with-sdk-install-path=${dpdk}/${RTE_TARGET}"
-  ];
-
-  patches = [
-    ./configure.patch
-    ./odp_crypto.patch
+    "--with-dpdk-path=${dpdk}"
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/os-specific/linux/odp-dpdk/odp_crypto.patch b/pkgs/os-specific/linux/odp-dpdk/odp_crypto.patch
deleted file mode 100644
index 44ef155d69fb..000000000000
--- a/pkgs/os-specific/linux/odp-dpdk/odp_crypto.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c
-index d95b157805dc..d13ad5bbde95 100644
---- a/platform/linux-dpdk/odp_crypto.c
-+++ b/platform/linux-dpdk/odp_crypto.c
-@@ -900,11 +900,12 @@ int odp_crypto_session_create(odp_crypto_session_param_t *param,
- 	/* Setup session */
- 	session = rte_cryptodev_sym_session_create(cdev_id, first_xform);
- 
--	if (session == NULL)
-+	if (session == NULL) {
- 		/* remove the crypto_session_entry_t */
- 		memset(entry, 0, sizeof(*entry));
- 		free_session(entry);
- 		return -1;
-+	}
- 
- 	entry->rte_session  = (intptr_t)session;
- 	entry->cipher_xform = cipher_xform;
diff --git a/pkgs/os-specific/linux/pktgen/Makefile.patch b/pkgs/os-specific/linux/pktgen/Makefile.patch
deleted file mode 100644
index da948bcc5a08..000000000000
--- a/pkgs/os-specific/linux/pktgen/Makefile.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff --git a/app/Makefile b/app/Makefile
-index 5078b9a..99b208a 100644
---- a/app/Makefile
-+++ b/app/Makefile
-@@ -46,29 +46,10 @@ APP = pktgen
- CFLAGS += -O3 -g $(WERROR_FLAGS) -fno-stack-protector
- CFLAGS += -I$(RTE_SRCDIR) -I$(RTE_SRCDIR)/../lib/common
- 
--dpdk_ver := $(RTE_SDK)/xusertools/dpdk-version.sh
--pktgen_ver := $(RTE_SRCDIR)/../tools/dpdk-version.sh
--ver_cmd := $(if $(wildcard $(dpdk_ver)),$(dpdk_ver),$(pktgen_ver))
--# $(info ver_cmd=$(ver_cmd))
--
--yy := $(shell $(ver_cmd) -yy)
--# mm := $(shell $(ver_cmd) -mm)
--
--# $(info yy=$(yy))
--
--ifeq ($(yy),17)
- COMMON_PRE := $(RTE_SRCDIR)/../lib/common
- LUA_PRE := $(RTE_SRCDIR)/../lib/lua/src
- CLI_PRE := $(RTE_SRCDIR)/../lib/cli
- GUI_PRE := $(RTE_SRCDIR)/../gui/gui
--else
--ifeq ($(yy),16)
--COMMON_PRE := $(RTE_SRCDIR)/../lib/common/lib/common
--LUA_PRE := $(RTE_SRCDIR)/../lib/lua/src/lib/lua/src
--CLI_PRE := $(RTE_SRCDIR)/../lib/cli/lib/cli
--GUI_PRE := $(RTE_SRCDIR)/../gui
--endif
--endif
- 
- COMMON_LIB := $(COMMON_PRE)/$(RTE_TARGET)
- LUA_LIB    := $(LUA_PRE)/$(RTE_TARGET)
diff --git a/pkgs/os-specific/linux/pktgen/default.nix b/pkgs/os-specific/linux/pktgen/default.nix
index 9bc8967453b4..c443da7df3b4 100644
--- a/pkgs/os-specific/linux/pktgen/default.nix
+++ b/pkgs/os-specific/linux/pktgen/default.nix
@@ -1,34 +1,48 @@
-{ stdenv, fetchurl, dpdk, libpcap, utillinux
-, pkgconfig
+{ stdenv, lib, fetchurl, pkgconfig
+, dpdk, libpcap, numactl, utillinux
 , gtk2, withGtk ? false
 }:
 
-stdenv.mkDerivation rec {
+let
+
+  # pktgen needs a specific version of lua to apply its patch (see lib/lua/Makefile).
+  lua = rec {
+    name = "lua-5.3.4";
+    basename = name + ".tar.gz";
+    src = fetchurl {
+      url = "https://www.lua.org/ftp/${basename}";
+      sha256 = "0320a8dg3aci4hxla380dx1ifkw8gj4gbw5c4dz41g1kh98sm0gn";
+    };
+  };
+
+in stdenv.mkDerivation rec {
   name = "pktgen-${version}";
-  version = "3.4.0";
+  version = "3.5.0";
 
   src = fetchurl {
-    url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz";
-    sha256 = "0fcyb56d4mkvchi5i8s3m210f5c3xa8zbjb08ranpa1a2k1kzfg5";
+    url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.xz";
+    sha256 = "1gy99jr9dbwzi9pd3w5k673h3pfnbkz6rbzmrkwcyis72pnphy5z";
   };
 
   nativeBuildInputs = stdenv.lib.optionals withGtk [ pkgconfig ];
 
   buildInputs =
-    [ dpdk libpcap ]
+    [ dpdk libpcap numactl ]
     ++ stdenv.lib.optionals withGtk [gtk2];
 
   RTE_SDK = "${dpdk}";
   RTE_TARGET = "x86_64-native-linuxapp-gcc";
   GUI = stdenv.lib.optionalString withGtk "true";
 
-  NIX_CFLAGS_COMPILE = [ "-march=core2" ];
+  NIX_CFLAGS_COMPILE = [ "-msse3" ];
 
-  patches = [ ./Makefile.patch ];
-
-  postPatch = ''
-    substituteInPlace lib/lua/src/luaconf.h --replace /usr/local $out
+  postPatch = let dpdkMajor = lib.versions.major dpdk.version; in ''
+    substituteInPlace app/Makefile --replace 'yy :=' 'yy := ${dpdkMajor} #'
     substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
+
+    ln -s ${lua.src} lib/lua/${lua.basename}
+    make -C lib/lua get_tarball # unpack and patch
+    substituteInPlace lib/lua/${lua.name}/src/luaconf.h --replace /usr/local $out
   '';
 
   installPhase = ''
@@ -38,6 +52,8 @@ stdenv.mkDerivation rec {
     install -m 0644 Pktgen.lua $out/lib/lua/5.3
   '';
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Traffic generator powered by DPDK";
     homepage = http://dpdk.org/;
diff --git a/pkgs/os-specific/linux/tmon/default.nix b/pkgs/os-specific/linux/tmon/default.nix
index 01c84a1d1faa..690eb8b2eabb 100644
--- a/pkgs/os-specific/linux/tmon/default.nix
+++ b/pkgs/os-specific/linux/tmon/default.nix
@@ -12,6 +12,7 @@ stdenv.mkDerivation {
   '';
 
   makeFlags = kernel.makeFlags ++ [ "INSTALL_ROOT=\"$(out)\"" "BINDIR=bin" ];
+  NIX_CFLAGS_LINK = "-lgcc_s";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix
index c5daaabd5be8..ae31edcaaede 100644
--- a/pkgs/os-specific/linux/wireguard/default.nix
+++ b/pkgs/os-specific/linux/wireguard/default.nix
@@ -1,73 +1,36 @@
-{ stdenv, fetchurl, libmnl, kernel ? null }:
+{ stdenv, fetchzip, kernel, wireguard-tools }:
 
 # module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
-assert kernel != null -> stdenv.lib.versionAtLeast kernel.version "3.10";
+assert stdenv.lib.versionAtLeast kernel.version "3.10";
 
-let
+stdenv.mkDerivation rec {
   name = "wireguard-${version}";
-
   version = "0.0.20180514";
 
-  src = fetchurl {
-    url    = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
-    sha256 = "1nk6yj1gdmpar99zzw39n1v795m6fxsrilg37d02jm780rgbd5g8";
-  };
+  inherit (wireguard-tools) src;
 
-  meta = with stdenv.lib; {
-    homepage     = https://www.wireguard.com/;
-    downloadPage = https://git.zx2c4.com/WireGuard/refs/;
-    description  = "A prerelease of an experimental VPN tunnel which is not to be depended upon for security";
-    maintainers  = with maintainers; [ ericsagnes mic92 zx2c4 ];
-    license      = licenses.gpl2;
-    platforms    = platforms.linux;
-  };
-
-  module = stdenv.mkDerivation {
-    inherit src meta name;
+  preConfigure = ''
+    cd src
+    sed -i '/depmod/,+1d' Makefile
+  '';
 
-    preConfigure = ''
-      cd src
-      sed -i '/depmod/,+1d' Makefile
-    '';
+  hardeningDisable = [ "pic" ];
 
-    hardeningDisable = [ "pic" ];
+  KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
+  INSTALL_MOD_PATH = "\${out}";
 
-    KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
-    INSTALL_MOD_PATH = "\${out}";
+  NIX_CFLAGS = ["-Wno-error=cpp"];
 
-    NIX_CFLAGS = ["-Wno-error=cpp"];
-
-    nativeBuildInputs = kernel.moduleBuildDependencies;
-
-    buildPhase = "make module";
-  };
+  nativeBuildInputs = kernel.moduleBuildDependencies;
 
-  tools = stdenv.mkDerivation {
-    inherit src meta name;
+  buildPhase = "make module";
 
-    preConfigure = "cd src";
-
-    buildInputs = [ libmnl ];
-
-    enableParallelBuilding = true;
-
-    makeFlags = [
-      "WITH_BASHCOMPLETION=yes"
-      "WITH_WGQUICK=yes"
-      "WITH_SYSTEMDUNITS=yes"
-      "DESTDIR=$(out)"
-      "PREFIX=/"
-      "-C" "tools"
-    ];
-
-    buildPhase = "make tools";
-
-    postInstall = ''
-      substituteInPlace $out/lib/systemd/system/wg-quick@.service \
-        --replace /usr/bin $out/bin
-    '';
+  meta = with stdenv.lib; {
+    homepage     = https://www.wireguard.com/;
+    downloadPage = https://git.zx2c4.com/WireGuard/refs/;
+    description  = " Tools for the WireGuard secure network tunnel";
+    maintainers  = with maintainers; [ ericsagnes mic92 zx2c4 ];
+    license      = licenses.gpl2;
+    platforms    = platforms.linux;
   };
-
-in if kernel == null
-   then tools
-   else module
+}