fex: update to qt6, make qt optional (#432411)

This commit is contained in:
Sandro
2025-09-12 15:28:47 +00:00
committed by GitHub
2 changed files with 26 additions and 18 deletions
+7
View File
@@ -0,0 +1,7 @@
{
fex,
}:
fex.override {
withQt = false;
}
+19 -18
View File
@@ -5,12 +5,14 @@
cmake,
ninja,
pkg-config,
qt5,
python3,
nix-update-script,
xxHash,
fmt,
libxml2,
openssl,
range-v3,
catch2,
nasm,
buildEnv,
writeText,
@@ -22,6 +24,8 @@
libGL,
wayland,
xorg,
withQt ? true,
qt6,
}:
let
@@ -97,7 +101,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
owner = "FEX-Emu";
repo = "FEX";
tag = "FEX-${finalAttrs.version}";
hash = "sha256-Dq87cx7tv+HJvpy57L8dcApE+3E8VEyyTYKhDyoUfVU=";
leaveDotGit = true;
@@ -113,8 +116,7 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
External/jemalloc_glibc \
External/robin-map \
External/vixl \
Source/Common/cpp-optparse \
External/Catch2
Source/Common/cpp-optparse
find . -name .git -print0 | xargs -0 rm -rf
@@ -160,22 +162,21 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
cmake
ninja
pkg-config
qt5.wrapQtAppsHook
llvmPackages.bintools
(python3.withPackages (
pythonPackages: with pythonPackages; [
setuptools
libclang
]
))
];
nativeCheckInputs = [ nasm ];
]
++ lib.optional withQt qt6.wrapQtAppsHook;
buildInputs = [
xxHash
fmt
libxml2
openssl
range-v3
pkgsCross64.buildPackages.clang
pkgsCross32.buildPackages.clang
@@ -183,20 +184,17 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
libllvm
]
++ libForwardingInputs
++ (with qt5; [
qtbase
qtdeclarative
qtquickcontrols
qtquickcontrols2
]);
++ lib.optionals withQt [
qt6.qtbase
qt6.qtdeclarative
];
cmakeFlags = [
(lib.cmakeFeature "USE_LINKER" "lld")
(lib.cmakeBool "ENABLE_LTO" true)
(lib.cmakeBool "ENABLE_ASSERTIONS" false)
(lib.cmakeFeature "OVERRIDE_VERSION" finalAttrs.version)
(lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "BUILD_THUNKS" true)
(lib.cmakeBool "BUILD_FEXCONFIG" withQt)
(lib.cmakeFeature "X86_32_TOOLCHAIN_FILE" "${toolchain32}")
(lib.cmakeFeature "X86_64_TOOLCHAIN_FILE" "${toolchain}")
(lib.cmakeFeature "X86_DEV_ROOTFS" "${devRootFS}")
@@ -207,6 +205,9 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
# Unsupported on non-4K page size kernels (e.g. Apple Silicon)
doCheck = true;
nativeCheckInputs = [ nasm ];
checkInputs = [ catch2 ];
# List not exhaustive, e.g. because they depend on an x86 compiler or some
# other difficult-to-build test binaries.
checkTarget = lib.concatStringsSep " " [
@@ -219,7 +220,7 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
# Avoid wrapping anything other than FEXConfig, since the wrapped executables
# don't seem to work when registered as binfmts.
dontWrapQtApps = true;
preFixup = ''
preFixup = lib.optionalString withQt ''
wrapQtApp $out/bin/FEXConfig
'';