-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package Request: CEMU #188187
Comments
Note: |
I wonder how it should be named. |
Dolphin, the Wii emulator is called |
I tried to do it, but I faced several issues and my nix/cmake skills were not advanced enough. If someone has the required skills, this is what I have till now: |
What issues were you running into exactly, @leiserfg? (I'd attempt to build the package myself, but if you have logs on hand it would be easier.) |
It's failing while building Zarchive:
|
Probably there are more broken things but that is blocking me. |
@winterqt I managed to fix the issue in archive, but now I'm having to problems with wxwidgets in cmake 😢, I'm hating all the CMake black magic. |
@leiserfg Can you push the ZArchive fixes so I can take a look at it where you left off? |
I fixed more stuff, now I'm in a point where I can't do more, has a weird compilation error. |
I had to change the compiler to Clang because the code has a clang-ism (uses a function defined by clangc) |
Looking at the issue for Linux builds, it looks like things are very rocky right now and everyone is having issues. If you can't get it working, maybe it would be best to just wait. (I'd take a stab at it if I didn't have to try to rip out vcpkg -- maybe your patch isn't enough?) |
Looks like vcpkg is not required anymore: cemu-project/Cemu#75 |
I tried after the cemu upstream changes and now I can't get it to compile because it tries to find Linking @WolfangAukang as imgui maintainer, maybe he can share some light. |
@leiserfg AFAIU:
Not sure what else to provide. |
I tried overriding imgui,
It stopped whining about imgui, but now it tries to find glslang.
|
Try with this one https://github.com/microsoft/vcpkg/blob/master/ports/glslang/glslang-config.cmake |
Hey all, I managed to create a working flake for this which should work standalone: https://github.com/zaethan/CemuFlake |
@zaethan you could try using libredirect in a wrapper as workaround. |
@misuzu, @zaethan it checks for the "writability" of the path where the executable is running, which is done by calling |
I think the only way to make it work (till it's fixed upstream) is to make a wrapper that copies the executable and executes the copy. |
So the libredirect gave me a build that starts up without copying stuff around. The question then becomes where to redirect to. For testing I just used some temporary scratch storage I have, but that's not an option. postFixup = ''
wrapProgram $out/bin/Cemu_release \
--set LD_PRELOAD "${pkgs.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS ${builtins.concatStringsSep ":" [ "$out/bin=/mnt/RamDisk" ]}
''; I'll experiment a bit more with this tomorrow. But I guess I can't just put ${HOME}/... or some xdg variable there directly. One would also have to make sure the directory exists since I dont think cemu tries to create it. For that, it should be possible to wrap cemu in a script (maybe makeWrapper? Never used that before) that just calls mkdir -p if the path does not exist, but at this point I'm just guessing. |
@zaethan
|
@leiserfg I think this data needs to persist. The very first thing Cemu does on startup is ask where to save stuff/look for games.
This gives me a cemu which starts up, creates ${HOME}/.config/cemu and lets me configure it and load a game. But... apparently it forgets the configuration on every run. Every time I start it, I have to tell it again, where it shall save/load stuff. |
Just found this PR to make cemu use XDG directories: cemu-project/Cemu#130 |
This also works without hardcoding the line number --set NIX_REDIRECTS $out=
...
sed -e 's|.*NIX_REDIRECTS.*|\0$HOME/.config/cemu|' -i $out/bin/Cemu_release |
Seems to work. Sound appears non-functional? |
@0x715C maybe because of this ? |
@leiserfg yea, that fixed it. Also had to wrap the executable to add pulseaudio to the library path. |
It also looks like Vulkan is not functional either. I only have an OpenGL option. IIrc Cemu bundles it's own Vulkan headers as submodule and probably cannot find them during build time. |
Yup, works for me too. One also has to remember to select cubeb as output and set the TV output to one the devices. I thought it didn't work at first. |
@zaethan maybe the vulkan issue is because it needs to have access to vulkan-loader? like: "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib" |
DuckStation's package does this too:
|
This gives me the option to select Vulkan, but it segfaults if I do so. |
suggested in NixOS/nixpkgs#188187 (comment)
Yeah, they rely on their submodule here. |
I'm not sure that's the issue, unless the copy of vulkan-headers they have is somehow patched. If it is were cmake is not finding vulkan it will not try to load it at runtime, isn't it? |
So I tried adding the files in the dependencies/Vulkan-Headers directory and I tried applying this patch postPatch = ''
sed -i 's:include_directories(\"dependencies/Vulkan-Headers/include\"):find_package(Vulkan REQUIRED):g' CMakeLists.txt
''; inspired by this pr. |
Vulkan works now (for me atleast) :) |
Had to tweak your flake a bit to get it working on my system with dwm, sound works too! diff --git a/flake.nix b/flake.nix
index 401d2ee..915e7f4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -64,7 +64,7 @@
nativeBuildInputs = with pkgs; [ cmake ];
- buildInputs = with pkgs; [ libpulseaudio ];
+ buildInputs = with pkgs; [ libpulseaudio alsa-lib libjack2 pipewire ];
# for now
# googletest is a submodule which is broken with flakes
@@ -166,6 +166,7 @@
];
buildInputs = with pkgs; [
+ libpulseaudio alsa-lib libjack2 pipewire
SDL2
pugixml
imgui
@@ -204,12 +205,11 @@
postInstall = ''
mkdir -p $out/bin
cp ../bin/Cemu_release $out/bin/
- '';
-
- postFixup = ''
wrapProgram $out/bin/Cemu_release \
- --prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath [ pkgs.libpulseaudio pkgs.vulkan-loader ]}
+ --prefix LD_LIBRARY_PATH : ${with pkgs; lib.makeLibraryPath [ libpulseaudio alsa-lib libjack2 pipewire vulkan-loader ]}
'';
+
+ meta.mainProgram = "Cemu_release";
};
defaultPackage = self.packages.${system}.cemu; |
@misuzu I don't think you need all the audio backends, alsa and pulse (both) work with a pipewire server or a pulse server, so you just need pulse or alsa, in the case of alsa you will probably need also |
I guess ideally (if/when this gets integrated into nixpkgs), the audio backends would depend on what backends are enabled in the config or be configurable through options. |
@zaethan the other emulators already packaged use only one audio backend, in any case using alsa is enough as it will work with raw alsa, pulseaudio or pipewire. |
Guys, seems like the latest release of cemu includes the xdg path fix. |
Hi all, I totally missed this issue and started my own attempt at packaging Cemu this afternoon. I even asked on Matrix and searched on Discourse, but somehow still missed this one in my search. My apologies. I opened #198590 which seems to work well for me. None of the invasive patches are required, and apart from |
This can be closed now. |
Project description
A WiiU emulator for Windows and now Linux
Metadata
The text was updated successfully, but these errors were encountered: