diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index dad3eda0cc6e..22c2f199c903 100644 --- a/pkgs/by-name/fe/fex/package.nix +++ b/pkgs/by-name/fe/fex/package.nix @@ -192,7 +192,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeFeature "USE_LINKER" "lld") (lib.cmakeFeature "OVERRIDE_VERSION" finalAttrs.version) - (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) (lib.cmakeBool "BUILD_THUNKS" true) (lib.cmakeBool "BUILD_FEXCONFIG" withQt) (lib.cmakeFeature "X86_32_TOOLCHAIN_FILE" "${toolchain32}") @@ -202,8 +201,21 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { strictDeps = true; - # Unsupported on non-4K page size kernels (e.g. Apple Silicon) + # Running the tests isn't supported on non-4K pagesize systems, but the build + # itself doesn't require 4K pagesize. So, to avoid breaking the build, enable + # checkPhase by default (so that the check inputs are included) and then + # manually disable it if we're running on a non-4K pagesize system. doCheck = true; + preConfigure = '' + if [ "$(getconf PAGESIZE)" != "4096" ]; then + echo "Disabling checkPhase due to non-4K pagesize environment" + unset doCheck + cmakeFlagsArray+=("-DBUILD_TESTING:BOOL=FALSE") + else + echo "Keeping checkPhase as-is" + cmakeFlagsArray+=("${lib.cmakeBool "BUILD_TESTING" finalAttrs.doCheck}") + fi + ''; nativeCheckInputs = [ nasm ]; checkInputs = [ catch2_3 ];