nixpkgs/pkgs/by-name/fe/fex/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

124 lines
2.7 KiB
Nix
Raw Permalink Normal View History

2024-10-29 15:47:21 +04:00
{
lib,
llvmPackages,
2025-04-06 20:22:01 +02:00
fetchFromGitHub,
2024-10-29 15:47:21 +04:00
cmake,
ninja,
pkg-config,
qt5,
python3,
2025-04-06 20:22:01 +02:00
nix-update-script,
xxHash,
fmt,
nasm,
2024-10-29 15:47:21 +04:00
}:
2025-04-06 20:22:01 +02:00
llvmPackages.stdenv.mkDerivation (finalAttrs: {
2024-10-29 15:47:21 +04:00
pname = "fex";
2025-07-08 14:03:38 +03:00
version = "2507.1";
2024-10-29 15:47:21 +04:00
src = fetchFromGitHub {
owner = "FEX-Emu";
repo = "FEX";
2025-04-06 20:22:01 +02:00
tag = "FEX-${finalAttrs.version}";
2025-07-08 14:03:38 +03:00
hash = "sha256-F6rMEPmw2UxWw+XWsUXrrUjvrDcIA1W+spkcq3tdUMI=";
leaveDotGit = true;
postFetch = ''
cd $out
git reset
# Only fetch required submodules
git submodule update --init --depth 1 \
External/Vulkan-Headers \
External/drm-headers \
External/jemalloc \
External/jemalloc_glibc \
External/robin-map \
External/vixl \
Source/Common/cpp-optparse \
External/Catch2
find . -name .git -print0 | xargs -0 rm -rf
# Remove some more unnecessary directories
rm -r \
External/vixl/src/aarch32 \
External/vixl/test
'';
2024-10-29 15:47:21 +04:00
};
nativeBuildInputs = [
cmake
ninja
pkg-config
qt5.wrapQtAppsHook
llvmPackages.bintools
(python3.withPackages (
pythonPackages: with pythonPackages; [
setuptools
libclang
]
))
];
nativeCheckInputs = [ nasm ];
buildInputs = [
xxHash
fmt
]
++ (with qt5; [
qtbase
qtdeclarative
qtquickcontrols
qtquickcontrols2
]);
2024-10-29 15:47:21 +04:00
cmakeFlags = [
2025-04-06 20:22:01 +02:00
(lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release")
(lib.cmakeFeature "USE_LINKER" "lld")
(lib.cmakeBool "ENABLE_LTO" true)
(lib.cmakeBool "ENABLE_ASSERTIONS" false)
(lib.cmakeFeature "OVERRIDE_VERSION" finalAttrs.version)
2024-10-29 15:47:21 +04:00
(lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
];
strictDeps = true;
# Unsupported on non-4K page size kernels (e.g. Apple Silicon)
doCheck = true;
# List not exhaustive, e.g. because they depend on an x86 compiler or some
# other difficult-to-build test binaries.
checkTarget = lib.concatStringsSep " " [
"asm_tests"
"api_tests"
"fexcore_apitests"
"emitter_tests"
];
2024-10-29 15:47:21 +04:00
# Avoid wrapping anything other than FEXConfig, since the wrapped executables
# don't seem to work when registered as binfmts.
dontWrapQtApps = true;
preFixup = ''
wrapQtApp $out/bin/FEXConfig
'';
2025-04-06 20:22:01 +02:00
passthru = {
updateScript = nix-update-script { };
};
2024-10-29 15:47:21 +04:00
meta = {
description = "Fast usermode x86 and x86-64 emulator for Arm64 Linux";
homepage = "https://fex-emu.com/";
2025-04-06 20:22:01 +02:00
changelog = "https://github.com/FEX-Emu/FEX/releases/tag/FEX-${finalAttrs.version}";
2024-10-29 15:47:21 +04:00
platforms = [ "aarch64-linux" ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ andre4ik3 ];
mainProgram = "FEXBash";
};
})