From 68b4cf39a9f1852e9023ca577c83a8ae8325eadf Mon Sep 17 00:00:00 2001 From: embr Date: Sat, 20 Apr 2019 09:42:48 +0100 Subject: [PATCH 1/2] jool: unstable-20180706 -> 4.0.0 --- pkgs/os-specific/linux/jool/cli.nix | 14 ++++++-------- pkgs/os-specific/linux/jool/default.nix | 8 ++++---- pkgs/os-specific/linux/jool/source.nix | 6 +++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pkgs/os-specific/linux/jool/cli.nix b/pkgs/os-specific/linux/jool/cli.nix index d851a47924d6..fe5436625e87 100644 --- a/pkgs/os-specific/linux/jool/cli.nix +++ b/pkgs/os-specific/linux/jool/cli.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libnl }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libnl, iptables }: let sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; }; @@ -9,15 +9,13 @@ stdenv.mkDerivation { src = sourceAttrs.src; - setSourceRoot = '' - sourceRoot=$(echo */usr) - ''; - nativeBuildInputs = [ autoreconfHook pkgconfig ]; - buildInputs = [ libnl ]; + buildInputs = [ libnl iptables ]; - postPatch = '' - chmod u+w -R ../common + makeFlags = "-C src/usr"; + + prePatch = '' + sed -e 's%^XTABLES_SO_DIR = .*%XTABLES_SO_DIR = '"$out"'/lib/xtables%g' -i src/usr/iptables/Makefile ''; meta = with stdenv.lib; { diff --git a/pkgs/os-specific/linux/jool/default.nix b/pkgs/os-specific/linux/jool/default.nix index d65be175fc1d..d398b46166a3 100644 --- a/pkgs/os-specific/linux/jool/default.nix +++ b/pkgs/os-specific/linux/jool/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchFromGitHub, kernel }: -assert stdenv.lib.versionOlder kernel.version "4.18"; +assert stdenv.lib.versionOlder kernel.version "4.20"; let sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; }; @@ -15,15 +15,15 @@ stdenv.mkDerivation { hardeningDisable = [ "pic" ]; prePatch = '' - sed -e 's@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@' -i mod/*/Makefile + sed -e 's@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@' -i src/mod/*/Makefile ''; buildPhase = '' - make -C mod + make -C src/mod ''; installPhase = '' - make -C mod modules_install INSTALL_MOD_PATH=$out + make -C src/mod modules_install INSTALL_MOD_PATH=$out ''; meta = with stdenv.lib; { diff --git a/pkgs/os-specific/linux/jool/source.nix b/pkgs/os-specific/linux/jool/source.nix index 24134b8b8182..0dd0eeed616f 100644 --- a/pkgs/os-specific/linux/jool/source.nix +++ b/pkgs/os-specific/linux/jool/source.nix @@ -1,11 +1,11 @@ { fetchFromGitHub }: rec { - version = "unstable-20180706"; + version = "4.0.0"; src = fetchFromGitHub { owner = "NICMx"; repo = "Jool"; - rev = "de791931d94e972c36bb3c102a9cadab5230c285"; - sha256 = "09mr7lc9k17znpslsfmndx4vgl240llcgblxm92fizmwz23y1d6c"; + rev = "v${version}"; + sha256 = "1ivnx7ijqf41kxmi2bmsf9qfcv6b1rvag35754ddlndry3sgvimr"; }; } From d88c68167a4fc22a1d1ca83ebe9595c9a2c26583 Mon Sep 17 00:00:00 2001 From: embr Date: Sat, 20 Apr 2019 09:54:30 +0100 Subject: [PATCH 2/2] jool: removed kernel version assertion I don't think this really makes sense, because upstream doesn't list any constraints on supported kernel versions, and worst case it'll just fail to build. --- pkgs/os-specific/linux/jool/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/os-specific/linux/jool/default.nix b/pkgs/os-specific/linux/jool/default.nix index d398b46166a3..8d170583a6cd 100644 --- a/pkgs/os-specific/linux/jool/default.nix +++ b/pkgs/os-specific/linux/jool/default.nix @@ -1,7 +1,5 @@ { stdenv, fetchFromGitHub, kernel }: -assert stdenv.lib.versionOlder kernel.version "4.20"; - let sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; }; in