2023-02-16 17:41:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
2023-02-16 17:41:37 +00:00
|
|
|
, pkg-config
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, bluez
|
2023-02-16 17:41:37 +00:00
|
|
|
, bzip2
|
|
|
|
, cubeb
|
|
|
|
, curl
|
|
|
|
, enet
|
2021-02-13 14:23:35 +00:00
|
|
|
, ffmpeg
|
2024-01-25 14:12:00 +00:00
|
|
|
, fmt_10
|
2023-10-09 19:29:22 +00:00
|
|
|
, gtest
|
2023-02-16 17:41:37 +00:00
|
|
|
, hidapi
|
|
|
|
, libevdev
|
2020-04-24 23:36:52 +00:00
|
|
|
, libGL
|
2023-02-16 17:41:37 +00:00
|
|
|
, libiconv
|
|
|
|
, libpulseaudio
|
|
|
|
, libspng
|
2020-04-24 23:36:52 +00:00
|
|
|
, libusb1
|
2023-02-16 17:41:37 +00:00
|
|
|
, libXdmcp
|
|
|
|
, libXext
|
|
|
|
, libXrandr
|
2024-01-25 14:12:00 +00:00
|
|
|
, lz4
|
2023-10-09 19:29:22 +00:00
|
|
|
, lzo
|
2022-12-17 10:02:37 +00:00
|
|
|
, mbedtls_2
|
2023-02-16 17:41:37 +00:00
|
|
|
, miniupnpc
|
|
|
|
, minizip-ng
|
|
|
|
, openal
|
|
|
|
, pugixml
|
|
|
|
, qtbase
|
2023-10-09 19:29:22 +00:00
|
|
|
, qtsvg
|
2024-02-29 20:09:43 +00:00
|
|
|
, SDL2
|
2020-04-24 23:36:52 +00:00
|
|
|
, sfml
|
2023-02-16 17:41:37 +00:00
|
|
|
, udev
|
|
|
|
, vulkan-loader
|
|
|
|
, xxHash
|
|
|
|
, xz
|
|
|
|
|
|
|
|
# Used in passthru
|
|
|
|
, testers
|
|
|
|
|
|
|
|
# Darwin-only dependencies
|
|
|
|
, CoreBluetooth
|
|
|
|
, ForceFeedback
|
2023-04-29 16:46:19 +00:00
|
|
|
, IOBluetooth
|
2023-02-16 17:41:37 +00:00
|
|
|
, IOKit
|
|
|
|
, moltenvk
|
|
|
|
, OpenGL
|
|
|
|
, VideoToolbox
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "dolphin-emu";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "2407";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dolphin-emu";
|
|
|
|
repo = "dolphin";
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = "refs/tags/${finalAttrs.version}";
|
|
|
|
hash = "sha256-8W4KyIj+rhDkWnQogjpzlEJVo3HJenfpWKimSyMGN7c=";
|
2023-02-16 17:41:37 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-02-16 17:41:37 +00:00
|
|
|
pkg-config
|
|
|
|
wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
buildInputs = [
|
2023-02-16 17:41:37 +00:00
|
|
|
bzip2
|
|
|
|
cubeb
|
|
|
|
curl
|
|
|
|
enet
|
2021-02-13 14:23:35 +00:00
|
|
|
ffmpeg
|
2024-01-25 14:12:00 +00:00
|
|
|
fmt_10
|
2023-10-09 19:29:22 +00:00
|
|
|
gtest
|
2023-02-16 17:41:37 +00:00
|
|
|
hidapi
|
|
|
|
libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
libpulseaudio
|
2023-02-16 17:41:37 +00:00
|
|
|
libspng
|
2020-04-24 23:36:52 +00:00
|
|
|
libusb1
|
2023-02-16 17:41:37 +00:00
|
|
|
libXdmcp
|
2024-01-25 14:12:00 +00:00
|
|
|
lz4
|
2023-10-09 19:29:22 +00:00
|
|
|
lzo
|
2022-12-17 10:02:37 +00:00
|
|
|
mbedtls_2
|
2023-02-16 17:41:37 +00:00
|
|
|
miniupnpc
|
|
|
|
minizip-ng
|
|
|
|
openal
|
|
|
|
pugixml
|
|
|
|
qtbase
|
2023-10-09 19:29:22 +00:00
|
|
|
qtsvg
|
2024-02-29 20:09:43 +00:00
|
|
|
SDL2
|
2020-04-24 23:36:52 +00:00
|
|
|
sfml
|
2023-02-16 17:41:37 +00:00
|
|
|
xxHash
|
2024-06-20 14:57:18 +00:00
|
|
|
xz
|
|
|
|
# Causes linker errors with minizip-ng, prefer vendored. Possible reason why: https://github.com/dolphin-emu/dolphin/pull/12070#issuecomment-1677311838
|
|
|
|
#zlib-ng
|
2023-02-16 17:41:37 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
bluez
|
|
|
|
libevdev
|
2023-07-15 17:15:38 +00:00
|
|
|
libGL
|
2023-02-16 17:41:37 +00:00
|
|
|
libXext
|
|
|
|
libXrandr
|
2023-10-09 19:29:22 +00:00
|
|
|
# FIXME: Vendored version is newer than mgba's stable release, remove the comment on next mgba's version
|
2023-07-15 17:15:38 +00:00
|
|
|
#mgba # Derivation doesn't support Darwin
|
2023-02-16 17:41:37 +00:00
|
|
|
udev
|
|
|
|
vulkan-loader
|
2024-06-20 14:57:18 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreBluetooth
|
|
|
|
ForceFeedback
|
|
|
|
IOBluetooth
|
|
|
|
IOKit
|
|
|
|
moltenvk
|
|
|
|
OpenGL
|
|
|
|
VideoToolbox
|
2023-02-16 17:41:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DDISTRIBUTOR=NixOS"
|
2024-07-27 06:49:29 +00:00
|
|
|
"-DDOLPHIN_WC_REVISION=${finalAttrs.src.rev}"
|
|
|
|
"-DDOLPHIN_WC_DESCRIBE=${finalAttrs.version}"
|
2023-02-16 17:41:37 +00:00
|
|
|
"-DDOLPHIN_WC_BRANCH=master"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DOSX_USE_DEFAULT_SEARCH_PATH=True"
|
|
|
|
"-DUSE_BUNDLED_MOLTENVK=OFF"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-DMACOS_CODE_SIGNING=OFF"
|
2023-02-16 17:41:37 +00:00
|
|
|
# Bundles the application folder into a standalone executable, so we cannot devendor libraries
|
|
|
|
"-DSKIP_POSTPROCESS_BUNDLE=ON"
|
|
|
|
# Needs xcode so compilation fails with it enabled. We would want the version to be fixed anyways.
|
2023-07-15 17:15:38 +00:00
|
|
|
# Note: The updater isn't available on linux, so we don't need to disable it there.
|
2023-02-16 17:41:37 +00:00
|
|
|
"-DENABLE_AUTOUPDATE=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
qtWrapperArgs = lib.optionals stdenv.isLinux [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}"
|
|
|
|
# https://bugs.dolphin-emu.org/issues/11807
|
|
|
|
# The .desktop file should already set this, but Dolphin may be launched in other ways
|
|
|
|
"--set QT_QPA_PLATFORM xcb"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
|
|
install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
|
2023-02-16 17:41:37 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
# Only gets installed automatically if the standalone executable is used
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r ./Binaries/Dolphin.app $out/Applications
|
|
|
|
ln -s $out/Applications/Dolphin.app/Contents/MacOS/Dolphin $out/bin
|
2020-12-07 07:45:13 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
2024-07-27 06:49:29 +00:00
|
|
|
package = finalAttrs.finalPackage;
|
2023-02-16 17:41:37 +00:00
|
|
|
command = "dolphin-emu-nogui --version";
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit (finalAttrs) version;
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2023-02-16 17:41:37 +00:00
|
|
|
homepage = "https://dolphin-emu.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
|
2023-02-16 17:41:37 +00:00
|
|
|
mainProgram = if stdenv.hostPlatform.isDarwin then "Dolphin" else "dolphin-emu";
|
|
|
|
branch = "master";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2023-02-16 17:41:37 +00:00
|
|
|
platforms = platforms.unix;
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [ pbsds ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-07-27 06:49:29 +00:00
|
|
|
})
|