Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 44 lines 969 B view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 kernel, 6 kernelModuleMakeFlags, 7 nixosTests, 8}: 9 10let 11 sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; }; 12in 13 14stdenv.mkDerivation { 15 name = "jool-${sourceAttrs.version}-${kernel.version}"; 16 17 src = sourceAttrs.src; 18 19 nativeBuildInputs = kernel.moduleBuildDependencies; 20 hardeningDisable = [ "pic" ]; 21 22 prePatch = '' 23 sed -e 's@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@' -i src/mod/*/Makefile 24 ''; 25 26 makeFlags = kernelModuleMakeFlags ++ [ 27 "-C src/mod" 28 "INSTALL_MOD_PATH=${placeholder "out"}" 29 ]; 30 31 installTargets = "modules_install"; 32 33 passthru.tests = { 34 inherit (nixosTests) jool; 35 }; 36 37 meta = { 38 homepage = "https://www.jool.mx/"; 39 description = "Fairly compliant SIIT and Stateful NAT64 for Linux - kernel modules"; 40 platforms = lib.platforms.linux; 41 license = lib.licenses.gpl2Only; 42 maintainers = with lib.maintainers; [ fpletz ]; 43 }; 44}