wireguard: split module and tools (#16883)

This commit is contained in:
Eric Sagnes 2016-07-14 04:15:11 +09:00 committed by Franz Pletz
parent 5630ac1d92
commit c6f99a3a92
2 changed files with 42 additions and 19 deletions

View File

@ -1,7 +1,8 @@
{ stdenv, fetchgit, libmnl, kernel }:
{ stdenv, fetchgit, libmnl, kernel ? null }:
stdenv.mkDerivation rec {
let
name = "wireguard-${version}";
version = "20160708";
src = fetchgit {
@ -10,25 +11,45 @@ stdenv.mkDerivation rec {
sha256 = "1ciyjpp8c3fv95y1cypk9qyqynp8cqyh2676afq2hd33110d37ni";
};
preConfigure = ''
cd src
sed -i /depmod/d Makefile
'';
buildInputs = [ libmnl ];
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
makeFlags = [
"DESTDIR=$(out)"
"PREFIX=/"
"INSTALL_MOD_PATH=$(out)"
];
meta = with stdenv.lib; {
homepage = https://www.wireguard.io/;
description = "Fast, modern, secure VPN tunnel";
license = licenses.gpl2;
platforms = platforms.linux;
};
}
module = stdenv.mkDerivation {
inherit src meta name;
preConfigure = ''
cd src
sed -i '/depmod/,+1d' Makefile
'';
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
INSTALL_MOD_PATH = "\${out}";
buildPhase = "make module";
};
tools = stdenv.mkDerivation {
inherit src meta name;
preConfigure = "cd src";
buildInputs = [ libmnl ];
makeFlags = [
"DESTDIR=$(out)"
"PREFIX=/"
"-C" "tools"
];
buildPhase = "make tools";
};
in if kernel == null
then tools
else module

View File

@ -11132,7 +11132,7 @@ in
virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions { };
wireguard = callPackage ../os-specific/linux/wireguard {};
wireguard = callPackage ../os-specific/linux/wireguard { };
x86_energy_perf_policy = callPackage ../os-specific/linux/x86_energy_perf_policy { };
@ -14911,6 +14911,8 @@ in
wings = callPackage ../applications/graphics/wings { };
wireguard = callPackage ../os-specific/linux/wireguard { };
wmname = callPackage ../applications/misc/wmname { };
wmctrl = callPackage ../tools/X11/wmctrl { };