diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-04-10 12:12:56 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-04-10 12:12:56 +0200 |
commit | 1ab03c3a76dd142a44c27951018f145ff78fb57e (patch) | |
tree | 3b5d5847cddc04766e5a755a33bbcc0f0b9ab88c /pkgs/os-specific | |
parent | 2e6fb229923cc2fd7275d26ea87f22898bdc24fa (diff) | |
parent | 807ca93fadd5197c2260490de0c76e500562dc05 (diff) | |
download | nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.tar nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.tar.gz nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.tar.bz2 nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.tar.lz nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.tar.xz nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.tar.zst nixlib-1ab03c3a76dd142a44c27951018f145ff78fb57e.zip |
Merge branch 'master' into staging-next
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/acpi-call/default.nix | 46 | ||||
-rw-r--r-- | pkgs/os-specific/linux/ddcci/default.nix | 10 | ||||
-rw-r--r-- | pkgs/os-specific/linux/device-tree/raspberrypi.nix | 3 | ||||
-rw-r--r-- | pkgs/os-specific/linux/fwts/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/g15daemon/default.nix | 88 | ||||
-rw-r--r-- | pkgs/os-specific/linux/g15daemon/pid_location.patch | 25 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-5.4.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-5.5.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-5.6.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix | 8 | ||||
-rw-r--r-- | pkgs/os-specific/linux/lxc/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/lxcfs/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/nfs-utils/default.nix | 7 | ||||
-rw-r--r-- | pkgs/os-specific/linux/nvidia-x11/default.nix | 10 | ||||
-rw-r--r-- | pkgs/os-specific/linux/uvcdynctrl/default.nix | 13 | ||||
-rw-r--r-- | pkgs/os-specific/linux/zfs/default.nix | 23 |
16 files changed, 192 insertions, 65 deletions
diff --git a/pkgs/os-specific/linux/acpi-call/default.nix b/pkgs/os-specific/linux/acpi-call/default.nix index bd12373da884..bb3aef885a7c 100644 --- a/pkgs/os-specific/linux/acpi-call/default.nix +++ b/pkgs/os-specific/linux/acpi-call/default.nix @@ -1,43 +1,33 @@ -{ stdenv, fetchgit, fetchpatch, kernel }: +{ stdenv, fetchFromGitHub, kernel }: -stdenv.mkDerivation { - name = "acpi-call-${kernel.version}"; +stdenv.mkDerivation rec { + pname = "acpi-call"; + version = "2020-04-07-${kernel.version}"; - src = fetchgit { - url = "git://github.com/mkottman/acpi_call.git"; - rev = "ac67445bc75ec4fcf46ceb195fb84d74ad350d51"; - sha256 = "0jl19irz9x9pxab2qp4z8c3jijv2m30zhmnzi6ygbrisqqlg4c75"; + src = fetchFromGitHub { + owner = "nix-community"; + repo = "acpi_call"; + rev = "3d7c9fe5ed3fc5ed5bafd39d54b1fdc7a09ce710"; + sha256 = "09kp8zl392h99wjwzqrdw2xcfnsc944hzmfwi8n1y7m2slpdybv3"; }; - patches = [ - (fetchpatch { - url = "https://github.com/mkottman/acpi_call/pull/67.patch"; - sha256 = "0z07apvdl8nvl8iwfk1sl1iidfjyx12fc0345bmp2nq1537kpbri"; - }) - ]; - hardeningDisable = [ "pic" ]; nativeBuildInputs = kernel.moduleBuildDependencies; - preBuild = '' - sed -e 's/break/true/' -i examples/turn_off_gpu.sh - sed -e 's@/bin/bash@.bin/sh@' -i examples/turn_off_gpu.sh - sed -e "s@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@" -i Makefile - sed -e 's@acpi/acpi[.]h@linux/acpi.h@g' -i acpi_call.c - ''; + makeFlags = [ + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; installPhase = '' - mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc - cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc - mkdir -p $out/bin - cp examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh - chmod a+x $out/bin/test_discrete_video_off.sh + install -D acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc/acpi_call.ko + install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh ''; - meta = { - maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.linux; + meta = with stdenv.lib; { + maintainers = with maintainers; [ raskin mic92 ]; + inherit (src.meta) homepage; + platforms = platforms.linux; description = "A module allowing arbitrary ACPI calls; use case: hybrid video"; }; } diff --git a/pkgs/os-specific/linux/ddcci/default.nix b/pkgs/os-specific/linux/ddcci/default.nix index a399ad7029f9..c977db64ee8a 100644 --- a/pkgs/os-specific/linux/ddcci/default.nix +++ b/pkgs/os-specific/linux/ddcci/default.nix @@ -2,28 +2,26 @@ stdenv.mkDerivation rec { pname = "ddcci-driver"; - version = "0.3.2"; + version = "0.3.3"; name = "${pname}-${kernel.version}-${version}"; src = fetchFromGitLab { owner = "${pname}-linux"; repo = "${pname}-linux"; rev = "v${version}"; - sha256 = "0jl4l3vvxn85cbqr80p6bgyhf2vx9kbadrwx086wkj9ni8k6x5m6"; + sha256 = "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"; }; hardeningDisable = [ "pic" ]; nativeBuildInputs = kernel.moduleBuildDependencies; - NIX_CFLAGS_COMPILE = [ "-Wno-error=incompatible-pointer-types" ]; - prePatch = '' substituteInPlace ./ddcci/Makefile \ - --replace 'SUBDIRS="$(src)"' 'M=$(PWD)' \ + --replace '"$(src)"' '$(PWD)' \ --replace depmod \# substituteInPlace ./ddcci-backlight/Makefile \ - --replace 'SUBDIRS="$(src)"' 'M=$(PWD)' \ + --replace '"$(src)"' '$(PWD)' \ --replace depmod \# ''; diff --git a/pkgs/os-specific/linux/device-tree/raspberrypi.nix b/pkgs/os-specific/linux/device-tree/raspberrypi.nix index 5e99e870ac83..b5886f6bd116 100644 --- a/pkgs/os-specific/linux/device-tree/raspberrypi.nix +++ b/pkgs/os-specific/linux/device-tree/raspberrypi.nix @@ -30,4 +30,7 @@ stdenvNoCC.mkDerivation { # Compatible overlays that may be used overlays = "${raspberrypifw}/share/raspberrypi/boot/overlays"; }; + meta = with stdenvNoCC.lib; { + platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ]; + }; } diff --git a/pkgs/os-specific/linux/fwts/default.nix b/pkgs/os-specific/linux/fwts/default.nix index c230ecaae79f..76ec3c691d06 100644 --- a/pkgs/os-specific/linux/fwts/default.nix +++ b/pkgs/os-specific/linux/fwts/default.nix @@ -3,11 +3,11 @@ stdenv.mkDerivation rec { pname = "fwts"; - version = "20.02.00"; + version = "20.03.00"; src = fetchzip { url = "http://fwts.ubuntu.com/release/${pname}-V${version}.tar.gz"; - sha256 = "1mplv4866w3w1vixn7abq9cgh8gxgzhdyxsvj952vkhv3b8in4jq"; + sha256 = "0h56lclvs8l5jf6zh790ki9k4mp9r8sqv2pynnciqlkz8nj71qah"; stripRoot = false; }; diff --git a/pkgs/os-specific/linux/g15daemon/default.nix b/pkgs/os-specific/linux/g15daemon/default.nix new file mode 100644 index 000000000000..d00bf2f74335 --- /dev/null +++ b/pkgs/os-specific/linux/g15daemon/default.nix @@ -0,0 +1,88 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchurl +, fetchpatch +, patchelf +, freetype +, libusb +}: +let + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ peterhoeg ]; + + g15src = { pname, version, sha256 }: fetchurl { + url = "mirror://sourceforge/g15tools/${pname}/${version}/${pname}-${version}.tar.bz2"; + inherit sha256; + }; + + libg15 = stdenv.mkDerivation rec { + pname = "libg15"; + version = "1.2.7"; + + src = g15src { + inherit pname version; + sha256 = "1mkrf622n0cmz57lj8w9q82a9dcr1lmyyxbnrghrxzb6gvifnbqk"; + }; + + buildInputs = [ libusb ]; + + enableParallelBuilding = true; + + meta = { + description = "Provides low-level access to Logitech G11/G15 keyboards and Z10 speakers"; + inherit license maintainers; + }; + }; + + libg15render = stdenv.mkDerivation rec { + pname = "libg15render"; + version = "1.2"; + + src = g15src { + inherit pname version; + sha256 = "03yjb78j1fnr2fwklxy54sdljwi0imvp29m8kmwl9v0pdapka8yj"; + }; + + buildInputs = [ libg15 ]; + + enableParallelBuilding = true; + + meta = { + description = "A small graphics library optimised for drawing on an LCD"; + inherit license maintainers; + }; + }; +in +stdenv.mkDerivation rec { + pname = "g15daemon"; + version = "1.9.5.3"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/G15Daemon%201.9x/${version}/${pname}-${version}.tar.bz2"; + sha256 = "1613gsp5dgilwbshqxxhiyw73ksngnam7n1iw6yxdjkp9fyd2a3d"; + }; + + patches = let + patch = fname: sha256: fetchurl rec { + url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/${pname}-${version}-${fname}.patch?h=packages/${pname}"; + name = "${fname}.patch"; + inherit sha256; + }; + in + [ + (patch "uinput" "1misfff7a1vg0qgfk3n25y7drnm86a4gq96iflpcwr5x3lw7q0h7") + (patch "config-write" "0jkrbqvzqrvxr14h5qi17cb4d32caq7vw9kzlz3qwpxdgxjrjvy2") + (patch "recv-oob-answer" "1f67iqpj5hcgpakagi7gbw1xviwhy5vizs546l9bfjimx8r2d29g") + ./pid_location.patch + ]; + + buildInputs = [ libg15 libg15render ]; + + enableParallelBuilding = true; + + meta = { + description = "A daemon that makes it possible to use the Logitech keyboard G-Buttons and draw on various Logitech LCDs"; + inherit license maintainers; + }; +} diff --git a/pkgs/os-specific/linux/g15daemon/pid_location.patch b/pkgs/os-specific/linux/g15daemon/pid_location.patch new file mode 100644 index 000000000000..f88c4a809626 --- /dev/null +++ b/pkgs/os-specific/linux/g15daemon/pid_location.patch @@ -0,0 +1,25 @@ +diff --git a/g15daemon/main.c b/g15daemon/main.c +index e674475..97b8242 100644 +--- a/g15daemon/main.c ++++ b/g15daemon/main.c +@@ -574,7 +574,7 @@ exitnow: + g15daemon_quit_refresh(); + uf_conf_write(lcdlist,"/etc/g15daemon.conf"); + uf_conf_free(lcdlist); +- unlink("/var/run/g15daemon.pid"); ++ unlink("/run/g15daemon/g15daemon.pid"); + } + return 0; + } +diff --git a/g15daemon/utility_funcs.c b/g15daemon/utility_funcs.c +index c93d164..2e9c679 100644 +--- a/g15daemon/utility_funcs.c ++++ b/g15daemon/utility_funcs.c +@@ -48,7 +48,7 @@ + + extern unsigned int g15daemon_debug; + extern volatile int leaving; +-#define G15DAEMON_PIDFILE "/var/run/g15daemon.pid" ++#define G15DAEMON_PIDFILE "/run/g15daemon/g15daemon.pid" + + pthread_cond_t lcd_refresh = PTHREAD_COND_INITIALIZER; diff --git a/pkgs/os-specific/linux/kernel/linux-5.4.nix b/pkgs/os-specific/linux/kernel/linux-5.4.nix index 21f7bb888322..e18048ef4c9d 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.4.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.4.30"; + version = "5.4.31"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "1vwx6j87pkfyq68chng1hy0c85hpc2byabiv1pcikrmw07vpip8i"; + sha256 = "1svf4wf4j1vqhdpgx63ry4c99fc54d9nfi4d1xm7z209z3w86451"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-5.5.nix b/pkgs/os-specific/linux/kernel/linux-5.5.nix index 410f8811a722..3b6555bde53d 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.5.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.5.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.5.15"; + version = "5.5.16"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "0572gkkz3460x0z4494vy3as57ks5gwndmm0y1dxwlry5q2xh7y4"; + sha256 = "0207yw1vkyzvnvbfbkyam6nac1dd9p4hmmbqw09ljki0ia531yw5"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-5.6.nix b/pkgs/os-specific/linux/kernel/linux-5.6.nix index cfab9e0d405e..052343467db4 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.6.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.6.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.6.2"; + version = "5.6.3"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "1fdmcx5fk9wq9yx6vvnw76nvdysbvm83cik1dj1d67lw6bc92k9d"; + sha256 = "1ajh1iw3bplm6ckcycg45wfmmqkvfiqmh6i3m1895dfapfd6h4qx"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix index f4b9e5b8da63..456913c5e6d1 100644 --- a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix +++ b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix @@ -1,13 +1,13 @@ { stdenv, buildPackages, fetchgit, fetchpatch, perl, buildLinux, ... } @ args: buildLinux (args // { - version = "5.2.2019.10.12"; - modDirVersion = "5.2.0"; + version = "5.3.2020.04.04"; + modDirVersion = "5.3.0"; src = fetchgit { url = "https://evilpiepirate.org/git/bcachefs.git"; - rev = "de906c3e2eddad291d46bd0e7c81c68eaadcd08a"; - sha256 = "1ahabp8pd9slf4lchkbyfkagg9vhic0cw3kwvwryzaxxxjmf2hkk"; + rev = "a27d7265e75f6d65c2b972ce4ac27abfc153c230"; + sha256 = "0wnjl4xs7073d5ipcsplv5qpcxb7zpfqd5gqvh3mhqc5j3qn816x"; }; extraConfig = "BCACHEFS_FS m"; diff --git a/pkgs/os-specific/linux/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix index 741d4ab14820..405c816ea309 100644 --- a/pkgs/os-specific/linux/lxc/default.nix +++ b/pkgs/os-specific/linux/lxc/default.nix @@ -9,11 +9,11 @@ with stdenv.lib; stdenv.mkDerivation rec { pname = "lxc"; - version = "4.0.0"; + version = "4.0.1"; src = fetchurl { url = "https://linuxcontainers.org/downloads/lxc/lxc-${version}.tar.gz"; - sha256 = "1x63nbfsicqxckq62ga3k0g8fm4qgcpn45ianj6m7rvw4lnaxwxk"; + sha256 = "178kqjz0n5nnjw0z8ac5lbfpqprna9xfd9ckakp34zq9vz0smfvh"; }; nativeBuildInputs = [ diff --git a/pkgs/os-specific/linux/lxcfs/default.nix b/pkgs/os-specific/linux/lxcfs/default.nix index 15a3fa5f04ff..65615f5c2406 100644 --- a/pkgs/os-specific/linux/lxcfs/default.nix +++ b/pkgs/os-specific/linux/lxcfs/default.nix @@ -3,13 +3,13 @@ with stdenv.lib; stdenv.mkDerivation rec { - name = "lxcfs-4.0.0"; + name = "lxcfs-4.0.1"; src = fetchFromGitHub { owner = "lxc"; repo = "lxcfs"; rev = name; - sha256 = "0p9fl7zya65wsxg2vabdc0jrhw6mdz081cacd7np4zrppv16v6dx"; + sha256 = "09y26ln2wxpi809kd3r352my64aal0yz2a5kin0i25gnvivl32cs"; }; nativeBuildInputs = [ pkgconfig help2man autoreconfHook ]; diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index 74363be47f42..20dc6a094e7a 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -1,6 +1,7 @@ { stdenv, fetchurl, fetchpatch, lib, pkgconfig, utillinux, libcap, libtirpc, libevent , sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers , python3, buildPackages, nixosTests +, enablePython ? true }: let @@ -25,8 +26,7 @@ stdenv.mkDerivation rec { buildInputs = [ libtirpc libcap libevent sqlite lvm2 libuuid keyutils kerberos tcp_wrappers - python3 - ]; + ] ++ lib.optional enablePython python3; enableParallelBuilding = true; @@ -96,6 +96,9 @@ stdenv.mkDerivation rec { -e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \ -e "s,/usr/sbin,$out/bin,g" \ $out/etc/systemd/system/* + '' + lib.optionalString (!enablePython) '' + # Remove all scripts that require python (currently mountstats and nfsiostat) + grep -l /usr/bin/python $out/bin/* | xargs -I {} rm -v {} ''; # One test fails on mips. diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 9a9c48a79088..e195bf587eed 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -1,4 +1,4 @@ -{ lib, callPackage, fetchurl, stdenv }: +{ lib, callPackage, fetchpatch, fetchurl, stdenv }: let @@ -22,10 +22,10 @@ rec { # Policy: use the highest stable version as the default (on our master). stable = if stdenv.hostPlatform.system == "x86_64-linux" then generic { - version = "440.59"; - sha256_64bit = "162gq6w44l8sgnn4qnl2rdlx8c008p04zv4c3i1ps20p21n1mjv1"; - settingsSha256 = "0vxhmirqzyav5ljf0f04yk0az48ir5v0817dq9z9kyqfdvnby93g"; - persistencedSha256 = "0npjh7nashasydp8q6bbcp21w8fc1dycgjy50ics775hjnvm61qn"; + version = "440.82"; + sha256_64bit = "13km9800skyraa0s312fc4hwyw5pzb0jfkrv1yg6anppyan1bm7d"; + settingsSha256 = "15psxvd65wi6hmxmd2vvsp2v0m07axw613hb355nh15r1dpkr3ma"; + persistencedSha256 = "13izz9p2kg9g38gf57g3s2sw7wshp1i9m5pzljh9v82c4c22x1fw"; } else legacy_390; diff --git a/pkgs/os-specific/linux/uvcdynctrl/default.nix b/pkgs/os-specific/linux/uvcdynctrl/default.nix index cfb93684f3bd..c2afa23efc06 100644 --- a/pkgs/os-specific/linux/uvcdynctrl/default.nix +++ b/pkgs/os-specific/linux/uvcdynctrl/default.nix @@ -15,9 +15,16 @@ stdenv.mkDerivation { buildInputs = [ libxml2 ]; prePatch = '' - substituteInPlace uvcdynctrl/CMakeLists.txt \ - --replace "/etc/udev" "$out/etc/udev" \ - --replace "/lib/udev" "$out/lib/udev" + local fixup_list=( + uvcdynctrl/CMakeLists.txt + uvcdynctrl/udev/rules/80-uvcdynctrl.rules + uvcdynctrl/udev/scripts/uvcdynctrl + ) + for f in "''${fixup_list[@]}"; do + substituteInPlace "$f" \ + --replace "/etc/udev" "$out/etc/udev" \ + --replace "/lib/udev" "$out/lib/udev" + done ''; meta = with stdenv.lib; { diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index 738171bb5ec8..2486f82d2ee5 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, utillinux, nukeReferences, coreutils +{ stdenv, fetchFromGitHub, fetchpatch +, autoreconfHook, utillinux, nukeReferences, coreutils , perl, buildPackages , configFile ? "all" @@ -11,6 +12,7 @@ # Kernel dependencies , kernel ? null +, enablePython ? true }: with stdenv.lib; @@ -40,7 +42,12 @@ let inherit rev sha256; }; - patches = extraPatches; + patches = [ (fetchpatch { + # https://github.com/openzfs/zfs/pull/9961#issuecomment-585827288 + # will be included in zfs 0.5.4 as well + url = "https://gist.githubusercontent.com/satmandu/67cbae9c4d461be0e64428a1707aef1c/raw/ba0fb65f17ccce5b710e4ce86a095de577f7dfe1/k5.6.3.patch"; + sha256 = "0zay7cz078v7wcnk7xl96blp7j6y64q1migb91c7h66zkpikqvgb"; + }) ] ++ extraPatches; postPatch = optionalString buildKernel '' patchShebangs scripts @@ -51,7 +58,12 @@ let '' + optionalString buildUser '' substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount" "${utillinux}/bin/umount" \ --replace "/bin/mount" "${utillinux}/bin/mount" - substituteInPlace ./lib/libshare/nfs.c --replace "/usr/sbin/exportfs" "${nfs-utils}/bin/exportfs" + substituteInPlace ./lib/libshare/nfs.c --replace "/usr/sbin/exportfs" "${ + # We don't *need* python support, but we set it like this to minimize closure size: + # If it's disabled by default, no need to enable it, even if we have python enabled + # And if it's enabled by default, only change that if we explicitly disable python to remove python from the closure + nfs-utils.override (old: { enablePython = old.enablePython or true && enablePython; }) + }/bin/exportfs" substituteInPlace ./config/user-systemd.m4 --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d" substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d" substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc" @@ -86,7 +98,8 @@ let nativeBuildInputs = [ autoreconfHook nukeReferences ] ++ optionals buildKernel (kernel.moduleBuildDependencies ++ [ perl ]); buildInputs = optionals buildUser [ zlib libuuid attr ] - ++ optionals (buildUser) [ openssl python3 ] + ++ optional buildUser openssl + ++ optional (buildUser && enablePython) python3 ++ optional stdenv.hostPlatform.isMusl libtirpc; # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work @@ -96,7 +109,7 @@ let configureFlags = [ "--with-config=${configFile}" - (withFeatureAs buildUser "python" python3.interpreter) + (withFeatureAs (buildUser && enablePython) "python" python3.interpreter) ] ++ optionals buildUser [ "--with-dracutdir=$(out)/lib/dracut" "--with-udevdir=$(out)/lib/udev" |