polkit: only fix mocklibc when doing tests

I got this error when setting doCheck=false:

chmod: cannot access 'subprojects/mocklibc-1.0/bin/mocklibc': No such file or directory

The chmod only happens when not building under pkgsMusl, but it doesn't
seem to be related to musl. Instead, it seems that mocklibc only gets
unpacked when -Dtests=true?

This would explain why under musl the same error would happen (since under
musl, tests are disabled).
This commit is contained in:
Ricardo M. Correia 2022-12-12 23:22:55 +00:00
parent ce7ac9ba4d
commit 897fa059a1

View File

@ -152,7 +152,7 @@ stdenv.mkDerivation rec {
--replace /bin/false ${coreutils}/bin/false
'';
postConfigure = lib.optionalString (!stdenv.hostPlatform.isMusl) ''
postConfigure = lib.optionalString doCheck ''
# Unpacked by meson
chmod +x subprojects/mocklibc-1.0/bin/mocklibc
patchShebangs subprojects/mocklibc-1.0/bin/mocklibc