hyperv-daemons: use python3 for kernels that support it

Support for python3 was added in https://github.com/torvalds/linux/commit/8a99c920092f444cf9f1d737ae76527102886d8e
it is therefore supported in every kernel including and after 4.19

ajs124 698bf970 e223f84c

+3 -6
+3 -6
pkgs/os-specific/linux/hyperv-daemons/default.nix
··· 1 - { stdenv, lib, python, kernel, makeWrapper, writeText 2 , gawk, iproute2 }: 3 4 let ··· 9 inherit (kernel) src version; 10 11 nativeBuildInputs = [ makeWrapper ]; 12 13 # as of 4.9 compilation will fail due to -Werror=format-security 14 hardeningDisable = [ "format" ]; ··· 32 install -Dm755 lsvmbus $out/bin/lsvmbus 33 install -Dm755 hv_get_dhcp_info.sh $out/${libexec}/hv_get_dhcp_info 34 install -Dm755 hv_get_dns_info.sh $out/${libexec}/hv_get_dns_info 35 - 36 - # I don't know why this isn't being handled automatically by fixupPhase 37 - substituteInPlace $out/bin/lsvmbus \ 38 - --replace '/usr/bin/env python' ${python.interpreter} 39 40 runHook postInstall 41 ''; ··· 86 Wants=hv-fcopy.service hv-kvp.service hv-vss.service 87 EOF 88 89 - for f in $lib/lib/systemd/system/* ; do 90 substituteInPlace $f --replace @out@ ${daemons}/bin 91 done 92
··· 1 + { stdenv, lib, python2, python3, kernel, makeWrapper, writeText 2 , gawk, iproute2 }: 3 4 let ··· 9 inherit (kernel) src version; 10 11 nativeBuildInputs = [ makeWrapper ]; 12 + buildInputs = [ (if lib.versionOlder version "4.19" then python2 else python3) ]; 13 14 # as of 4.9 compilation will fail due to -Werror=format-security 15 hardeningDisable = [ "format" ]; ··· 33 install -Dm755 lsvmbus $out/bin/lsvmbus 34 install -Dm755 hv_get_dhcp_info.sh $out/${libexec}/hv_get_dhcp_info 35 install -Dm755 hv_get_dns_info.sh $out/${libexec}/hv_get_dns_info 36 37 runHook postInstall 38 ''; ··· 83 Wants=hv-fcopy.service hv-kvp.service hv-vss.service 84 EOF 85 86 + for f in $lib/lib/systemd/system/*.service ; do 87 substituteInPlace $f --replace @out@ ${daemons}/bin 88 done 89