42 # - Inputs used for Darwin
51 stdenv.mkDerivation rec {
52 pname = "dolphin-emu-primehack";
55 src = fetchFromGitHub {
59 hash = "sha256-vuTSXQHnR4HxAGGiPg5tUzfiXROU3+E9kyjH+T6zVmc=";
60 fetchSubmodules = true;
66 ] ++ lib.optional stdenv.hostPlatform.isLinux wrapQtAppsHook;
101 ++ lib.optionals stdenv.hostPlatform.isLinux [
108 ++ lib.optionals stdenv.hostPlatform.isDarwin [
117 "-DUSE_SHARED_ENET=ON"
120 ++ lib.optionals stdenv.hostPlatform.isDarwin [
121 "-DOSX_USE_DEFAULT_SEARCH_PATH=True"
124 qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
125 "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
126 # https://bugs.dolphin-emu.org/issues/11807
127 # The .desktop file should already set this, but Dolphin may be launched in other ways
128 "--set QT_QPA_PLATFORM xcb"
131 # - Allow Dolphin to use nix-provided libraries instead of building them
134 substituteInPlace CMakeLists.txt --replace 'DISTRIBUTOR "None"' 'DISTRIBUTOR "NixOS"'
136 + lib.optionalString stdenv.hostPlatform.isDarwin ''
137 substituteInPlace CMakeLists.txt --replace 'if(NOT APPLE)' 'if(true)'
138 substituteInPlace CMakeLists.txt --replace 'if(LIBUSB_FOUND AND NOT APPLE)' 'if(LIBUSB_FOUND)'
143 mv $out/bin/dolphin-emu $out/bin/dolphin-emu-primehack
144 mv $out/bin/dolphin-emu-nogui $out/bin/dolphin-emu-primehack-nogui
145 mv $out/share/applications/dolphin-emu.desktop $out/share/applications/dolphin-emu-primehack.desktop
146 mv $out/share/icons/hicolor/256x256/apps/dolphin-emu.png $out/share/icons/hicolor/256x256/apps/dolphin-emu-primehack.png
147 substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop --replace 'dolphin-emu' 'dolphin-emu-primehack'
148 substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop --replace 'Dolphin Emulator' 'PrimeHack'
150 + lib.optionalString stdenv.hostPlatform.isLinux ''
151 install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
155 homepage = "https://github.com/shiiion/dolphin";
156 description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
157 license = licenses.gpl2Plus;
158 maintainers = with maintainers; [ Madouura ];
159 broken = stdenv.hostPlatform.isDarwin;
160 platforms = platforms.unix;