systemd: make libidn2 optional

Expose a new `withLibidn2` flag (defauts to true for backwards compatibility) to be able to conditionally enable and disable integration with `libidn2`, which is used by the `systemd-network` and `systemd-resolved` to support internationalized domain names.
This commit is contained in:
Garry Filakhtov 2023-02-19 13:23:36 +11:00
parent a9f42c3e95
commit fe201024e9
No known key found for this signature in database

View file

@ -97,6 +97,7 @@
, withLibBPF ? lib.versionAtLeast buildPackages.llvmPackages.clang.version "10.0" , withLibBPF ? lib.versionAtLeast buildPackages.llvmPackages.clang.version "10.0"
&& stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6" # assumes hard floats && stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6" # assumes hard floats
&& !stdenv.hostPlatform.isMips64 # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211 && !stdenv.hostPlatform.isMips64 # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211
, withLibidn2 ? true
, withLocaled ? true , withLocaled ? true
, withLogind ? true , withLogind ? true
, withMachined ? true , withMachined ? true
@ -278,7 +279,7 @@ stdenv.mkDerivation (finalAttrs: {
# Systemd does this decision during configure time and uses ifdef's to # Systemd does this decision during configure time and uses ifdef's to
# enable specific branches. We can safely ignore (nuke) the libidn "v1" # enable specific branches. We can safely ignore (nuke) the libidn "v1"
# libraries. # libraries.
{ name = "libidn2.so.0"; pkg = libidn2; } { name = "libidn2.so.0"; pkg = opt withLibidn2 libidn2; }
{ name = "libidn.so.12"; pkg = null; } { name = "libidn.so.12"; pkg = null; }
{ name = "libidn.so.11"; pkg = null; } { name = "libidn.so.11"; pkg = null; }
@ -381,7 +382,6 @@ stdenv.mkDerivation (finalAttrs: {
kmod kmod
libxcrypt libxcrypt
libcap libcap
libidn2
libuuid libuuid
linuxHeaders linuxHeaders
pam pam
@ -397,6 +397,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev)
++ lib.optional withEfi gnu-efi ++ lib.optional withEfi gnu-efi
++ lib.optional withKexectools kexec-tools ++ lib.optional withKexectools kexec-tools
++ lib.optional withLibidn2 libidn2
++ lib.optional withLibseccomp libseccomp ++ lib.optional withLibseccomp libseccomp
++ lib.optional withNetworkd iptables ++ lib.optional withNetworkd iptables
++ lib.optional withPCRE2 pcre2 ++ lib.optional withPCRE2 pcre2
@ -461,7 +462,7 @@ stdenv.mkDerivation (finalAttrs: {
"-Dsplit-usr=false" "-Dsplit-usr=false"
"-Dlibcurl=${lib.boolToString wantCurl}" "-Dlibcurl=${lib.boolToString wantCurl}"
"-Dlibidn=false" "-Dlibidn=false"
"-Dlibidn2=true" "-Dlibidn2=${lib.boolToString withLibidn2}"
"-Dquotacheck=false" "-Dquotacheck=false"
"-Dldconfig=false" "-Dldconfig=false"
"-Dsmack=true" "-Dsmack=true"