2024-06-17 21:29:02 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
SDL2,
|
2023-12-18 19:34:35 +01:00
|
|
|
addDriverRunpath,
|
2024-06-17 21:29:02 +02:00
|
|
|
boost,
|
|
|
|
cmake,
|
|
|
|
cubeb,
|
|
|
|
curl,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fmt_9,
|
|
|
|
gamemode,
|
|
|
|
glm,
|
|
|
|
glslang,
|
|
|
|
gtk3,
|
|
|
|
hidapi,
|
|
|
|
imgui,
|
|
|
|
libXrender,
|
|
|
|
libpng,
|
|
|
|
libusb1,
|
|
|
|
libzip,
|
|
|
|
nasm,
|
|
|
|
ninja,
|
|
|
|
nix-update-script,
|
|
|
|
pkg-config,
|
|
|
|
pugixml,
|
|
|
|
rapidjson,
|
|
|
|
stdenv,
|
2024-06-17 21:59:40 +02:00
|
|
|
testers,
|
2024-06-17 21:29:02 +02:00
|
|
|
vulkan-headers,
|
|
|
|
vulkan-loader,
|
|
|
|
wayland,
|
2024-08-31 11:14:44 +02:00
|
|
|
wayland-scanner,
|
2024-06-17 21:29:02 +02:00
|
|
|
wrapGAppsHook3,
|
|
|
|
wxGTK32,
|
|
|
|
zarchive,
|
2022-10-31 21:01:48 +01:00
|
|
|
}:
|
|
|
|
|
2024-03-02 00:43:21 +01:00
|
|
|
let
|
|
|
|
# cemu doesn't build with imgui 1.90.2 or newer:
|
|
|
|
# error: 'struct ImGuiIO' has no member named 'ImeWindowHandle'
|
|
|
|
imgui' = imgui.overrideAttrs rec {
|
|
|
|
version = "1.90.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocornut";
|
|
|
|
repo = "imgui";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-gf47uLeNiXQic43buB5ZnMqiotlUfIyAsP+3H7yJuFg=";
|
|
|
|
};
|
|
|
|
};
|
2024-06-17 21:29:02 +02:00
|
|
|
in stdenv.mkDerivation (finalAttrs: {
|
2022-10-31 21:01:48 +01:00
|
|
|
pname = "cemu";
|
2024-08-10 06:24:15 +02:00
|
|
|
version = "2.0-92";
|
2022-10-31 21:01:48 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cemu-project";
|
|
|
|
repo = "Cemu";
|
2024-06-17 21:29:02 +02:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-08-10 06:24:15 +02:00
|
|
|
hash = "sha256-bjt+2RzmG8iKcdyka4HsHM5NEzCwGah4s9eiywSHXbw=";
|
2022-10-31 21:01:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# glslangTargets want SPIRV-Tools-opt to be defined:
|
|
|
|
# > The following imported targets are referenced, but are missing:
|
|
|
|
# > SPIRV-Tools-opt
|
2024-06-17 21:29:02 +02:00
|
|
|
./0000-spirv-tools-opt-cmakelists.patch
|
2022-10-31 21:01:48 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-06-17 21:29:02 +02:00
|
|
|
SDL2
|
2023-12-18 19:34:35 +01:00
|
|
|
addDriverRunpath
|
2024-04-26 22:24:03 +02:00
|
|
|
wrapGAppsHook3
|
2022-10-31 21:01:48 +01:00
|
|
|
cmake
|
|
|
|
nasm
|
2024-06-17 21:29:02 +02:00
|
|
|
ninja
|
2022-10-31 21:01:48 +01:00
|
|
|
pkg-config
|
2024-07-25 09:21:21 +02:00
|
|
|
wxGTK32
|
2024-08-31 11:14:44 +02:00
|
|
|
wayland-scanner
|
2022-10-31 21:01:48 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
boost
|
|
|
|
cubeb
|
|
|
|
curl
|
|
|
|
fmt_9
|
|
|
|
glm
|
2024-08-16 05:21:07 +02:00
|
|
|
glslang
|
2022-10-31 21:01:48 +01:00
|
|
|
gtk3
|
2023-08-27 08:28:35 +02:00
|
|
|
hidapi
|
2024-03-02 00:43:21 +01:00
|
|
|
imgui'
|
2022-10-31 21:01:48 +01:00
|
|
|
libpng
|
2023-11-05 23:34:28 +01:00
|
|
|
libusb1
|
2022-10-31 21:01:48 +01:00
|
|
|
libzip
|
|
|
|
libXrender
|
|
|
|
pugixml
|
|
|
|
rapidjson
|
|
|
|
vulkan-headers
|
2022-12-16 09:29:33 +01:00
|
|
|
wayland
|
2022-10-31 21:01:48 +01:00
|
|
|
wxGTK32
|
|
|
|
zarchive
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-06-17 21:29:02 +02:00
|
|
|
(lib.cmakeFeature "CMAKE_C_FLAGS_RELEASE" "-DNDEBUG")
|
|
|
|
(lib.cmakeFeature "CMAKE_CXX_FLAGS_RELEASE" "-DNDEBUG")
|
|
|
|
(lib.cmakeBool "ENABLE_VCPKG" false)
|
|
|
|
(lib.cmakeBool "ENABLE_FERAL_GAMEMODE" true)
|
|
|
|
|
|
|
|
# PORTABLE: "All data created and maintained by Cemu will be in
|
|
|
|
# the directory where the executable file is located"
|
|
|
|
(lib.cmakeBool "PORTABLE" false)
|
2022-10-31 21:01:48 +01:00
|
|
|
];
|
|
|
|
|
2024-06-17 21:29:02 +02:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
preConfigure = let
|
|
|
|
tag = lib.last (lib.splitString "-" finalAttrs.version);
|
2023-04-16 05:46:02 +02:00
|
|
|
in ''
|
2022-10-31 21:01:48 +01:00
|
|
|
rm -rf dependencies/imgui
|
2024-06-03 20:46:10 +02:00
|
|
|
# cemu expects imgui source code, not just header files
|
|
|
|
ln -s ${imgui'.src} dependencies/imgui
|
2024-06-17 21:29:02 +02:00
|
|
|
substituteInPlace src/Common/version.h --replace-fail " (experimental)" "-${tag} (experimental)"
|
|
|
|
substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace-fail "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
|
2022-10-31 21:01:48 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 ../bin/Cemu_release $out/bin/Cemu
|
|
|
|
ln -s $out/bin/Cemu $out/bin/cemu
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
substitute ../dist/linux/info.cemu.Cemu.desktop $out/share/applications/info.cemu.Cemu.desktop \
|
|
|
|
--replace "Exec=Cemu" "Exec=$out/bin/Cemu"
|
|
|
|
|
|
|
|
install -Dm644 ../dist/linux/info.cemu.Cemu.metainfo.xml -t $out/share/metainfo
|
|
|
|
install -Dm644 ../src/resource/logo_icon.png $out/share/icons/hicolor/128x128/apps/info.cemu.Cemu.png
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = let
|
|
|
|
libs = [ vulkan-loader ] ++ cubeb.passthru.backendLibs;
|
|
|
|
in ''
|
2022-11-22 14:30:09 +01:00
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}"
|
|
|
|
)
|
2022-10-31 21:01:48 +01:00
|
|
|
'';
|
|
|
|
|
2024-06-17 21:29:02 +02:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
2024-06-17 21:59:40 +02:00
|
|
|
tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
2024-06-17 21:29:02 +02:00
|
|
|
};
|
2022-12-16 22:54:08 +01:00
|
|
|
|
2024-06-17 21:29:02 +02:00
|
|
|
meta = {
|
|
|
|
description = "Software to emulate Wii U games and applications on PC";
|
2022-10-31 21:01:48 +01:00
|
|
|
homepage = "https://cemu.info";
|
2024-06-17 21:29:02 +02:00
|
|
|
license = lib.licenses.mpl20;
|
2023-08-04 20:23:13 +02:00
|
|
|
mainProgram = "cemu";
|
2024-06-17 21:29:02 +02:00
|
|
|
maintainers = with lib.maintainers; [ zhaofengli baduhai AndersonTorres ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-10-31 21:01:48 +01:00
|
|
|
};
|
2024-06-17 21:29:02 +02:00
|
|
|
})
|