40 # - Inputs used for Darwin
49 stdenv.mkDerivation rec {
50 pname = "dolphin-emu-primehack";
53 src = fetchFromGitHub {
57 sha256 = "sha256-gc4+ofoLKR+cvm+SaWEnGaKrSjWMKq7pF6pEIi75Rtk=";
58 fetchSubmodules = true;
64 ] ++ lib.optional stdenv.isLinux wrapQtAppsHook;
96 ] ++ lib.optionals stdenv.isLinux [
102 ] ++ lib.optionals stdenv.isDarwin [
110 "-DUSE_SHARED_ENET=ON"
112 ] ++ lib.optionals stdenv.isDarwin [
113 "-DOSX_USE_DEFAULT_SEARCH_PATH=True"
116 qtWrapperArgs = lib.optionals stdenv.isLinux [
117 "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
118 # https://bugs.dolphin-emu.org/issues/11807
119 # The .desktop file should already set this, but Dolphin may be launched in other ways
120 "--set QT_QPA_PLATFORM xcb"
123 # - Allow Dolphin to use nix-provided libraries instead of building them
125 substituteInPlace CMakeLists.txt --replace 'DISTRIBUTOR "None"' 'DISTRIBUTOR "NixOS"'
126 '' + lib.optionalString stdenv.isDarwin ''
127 substituteInPlace CMakeLists.txt --replace 'if(NOT APPLE)' 'if(true)'
128 substituteInPlace CMakeLists.txt --replace 'if(LIBUSB_FOUND AND NOT APPLE)' 'if(LIBUSB_FOUND)'
132 mv $out/bin/dolphin-emu $out/bin/dolphin-emu-primehack
133 mv $out/bin/dolphin-emu-nogui $out/bin/dolphin-emu-primehack-nogui
134 mv $out/share/applications/dolphin-emu.desktop $out/share/applications/dolphin-emu-primehack.desktop
135 mv $out/share/icons/hicolor/256x256/apps/dolphin-emu.png $out/share/icons/hicolor/256x256/apps/dolphin-emu-primehack.png
136 substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop --replace 'dolphin-emu' 'dolphin-emu-primehack'
137 substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop --replace 'Dolphin Emulator' 'PrimeHack'
138 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
139 install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
143 homepage = "https://github.com/shiiion/dolphin";
144 description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
145 license = licenses.gpl2Plus;
146 maintainers = with maintainers; [ MP2E ashkitten Madouura ];
147 broken = stdenv.isDarwin;
148 platforms = platforms.unix;