From c160394049bfd8a147ee6fcc17f2269374cc5128 Mon Sep 17 00:00:00 2001 From: andre4ik3 Date: Sun, 10 Aug 2025 06:30:28 +0000 Subject: [PATCH 1/3] fex: update to qt6, make qt optional Closes #376837 --- pkgs/by-name/fe/fex/package.nix | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index 726502a66264..440e7fc8ade9 100644 --- a/pkgs/by-name/fe/fex/package.nix +++ b/pkgs/by-name/fe/fex/package.nix @@ -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 @@ -160,7 +164,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { cmake ninja pkg-config - qt5.wrapQtAppsHook llvmPackages.bintools (python3.withPackages ( @@ -169,13 +172,16 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { libclang ] )) - ]; + ] + ++ lib.optional withQt qt6.wrapQtAppsHook; nativeCheckInputs = [ nasm ]; buildInputs = [ xxHash fmt + libxml2 + openssl range-v3 pkgsCross64.buildPackages.clang pkgsCross32.buildPackages.clang @@ -183,12 +189,10 @@ 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") @@ -197,6 +201,7 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { (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}") @@ -219,7 +224,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 ''; From 01227a902cb5625623728c92a35e211fdd9678b1 Mon Sep 17 00:00:00 2001 From: andre4ik3 Date: Sun, 10 Aug 2025 06:31:19 +0000 Subject: [PATCH 2/3] fex: unvendor catch2, remove unneeded flags --- pkgs/by-name/fe/fex/package.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index 440e7fc8ade9..9683735feafd 100644 --- a/pkgs/by-name/fe/fex/package.nix +++ b/pkgs/by-name/fe/fex/package.nix @@ -101,7 +101,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { owner = "FEX-Emu"; repo = "FEX"; tag = "FEX-${finalAttrs.version}"; - hash = "sha256-Dq87cx7tv+HJvpy57L8dcApE+3E8VEyyTYKhDyoUfVU="; leaveDotGit = true; @@ -117,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 @@ -165,7 +163,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { ninja pkg-config llvmPackages.bintools - (python3.withPackages ( pythonPackages: with pythonPackages; [ setuptools @@ -175,8 +172,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional withQt qt6.wrapQtAppsHook; - nativeCheckInputs = [ nasm ]; - buildInputs = [ xxHash fmt @@ -196,8 +191,6 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { 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) @@ -212,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 " " [ From f800055e411adc0b139d8d5ee26552f08ca367f0 Mon Sep 17 00:00:00 2001 From: andre4ik3 Date: Wed, 10 Sep 2025 21:27:35 +0000 Subject: [PATCH 3/3] fex-headless: init package --- pkgs/by-name/fe/fex-headless/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 pkgs/by-name/fe/fex-headless/package.nix diff --git a/pkgs/by-name/fe/fex-headless/package.nix b/pkgs/by-name/fe/fex-headless/package.nix new file mode 100644 index 000000000000..b9d5eb3ebfe3 --- /dev/null +++ b/pkgs/by-name/fe/fex-headless/package.nix @@ -0,0 +1,7 @@ +{ + fex, +}: + +fex.override { + withQt = false; +}