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; +} diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index 726502a66264..9683735feafd 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 @@ -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 '';