2021-11-10 17:45:53 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, cmake
|
2021-02-11 06:55:41 +01:00
|
|
|
, wrapQtAppsHook, qtbase, bluez, ffmpeg, libao, libGLU, libGL, pcre, gettext
|
2020-04-04 09:07:07 +02:00
|
|
|
, libXrandr, libusb1, lzo, libpthreadstubs, libXext, libXxf86vm, libXinerama
|
2021-06-10 04:57:09 +02:00
|
|
|
, libSM, libXdmcp, readline, openal, udev, libevdev, portaudio, curl, alsa-lib
|
2019-08-22 08:33:04 +02:00
|
|
|
, miniupnpc, enet, mbedtls, soundtouch, sfml
|
|
|
|
, vulkan-loader ? null, libpulseaudio ? null
|
2018-06-19 05:18:48 +02:00
|
|
|
|
2017-07-21 02:15:04 +02:00
|
|
|
# - Inputs used for Darwin
|
2019-06-19 19:50:52 +02:00
|
|
|
, CoreBluetooth, ForceFeedback, IOKit, OpenGL, libpng, hidapi }:
|
2014-09-02 10:19:44 +02:00
|
|
|
|
2021-11-10 17:45:53 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "dolphin-emu";
|
2021-10-08 09:31:05 +02:00
|
|
|
version = "5.0-15260";
|
2018-06-23 01:09:19 +02:00
|
|
|
|
2017-07-08 23:22:38 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dolphin-emu";
|
|
|
|
repo = "dolphin";
|
2021-10-08 09:31:05 +02:00
|
|
|
rev = "207c931a04c8e2629a735bc2b3f36b5c89365ca7";
|
|
|
|
sha256 = "15r9syk7f62h16klcznw7css6sng8nqkkz4d1qr8d988rdfaiypx";
|
|
|
|
fetchSubmodules = true;
|
2014-09-02 10:19:44 +02:00
|
|
|
};
|
|
|
|
|
2021-01-17 03:30:45 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ]
|
2019-08-22 08:33:04 +02:00
|
|
|
++ lib.optional stdenv.isLinux wrapQtAppsHook;
|
2018-06-19 05:18:48 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-02-11 06:55:41 +01:00
|
|
|
curl ffmpeg libao libGLU libGL pcre gettext libpthreadstubs libpulseaudio
|
2018-06-28 01:33:13 +02:00
|
|
|
libXrandr libXext libXxf86vm libXinerama libSM readline openal libXdmcp lzo
|
2020-04-04 09:07:07 +02:00
|
|
|
portaudio libusb1 libpng hidapi miniupnpc enet mbedtls soundtouch sfml
|
2019-08-22 08:33:04 +02:00
|
|
|
qtbase
|
2019-08-22 08:22:31 +02:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2021-06-10 04:57:09 +02:00
|
|
|
bluez udev libevdev alsa-lib vulkan-loader
|
2019-08-22 08:22:31 +02:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2019-06-19 19:50:52 +02:00
|
|
|
CoreBluetooth OpenGL ForceFeedback IOKit
|
2018-06-28 01:33:13 +02:00
|
|
|
];
|
2018-06-19 05:18:48 +02:00
|
|
|
|
2017-07-21 02:24:20 +02:00
|
|
|
cmakeFlags = [
|
2018-06-28 01:33:13 +02:00
|
|
|
"-DUSE_SHARED_ENET=ON"
|
|
|
|
"-DENABLE_LTO=ON"
|
2019-04-16 00:11:15 +02:00
|
|
|
"-DDOLPHIN_WC_REVISION=${src.rev}"
|
|
|
|
"-DDOLPHIN_WC_DESCRIBE=${version}"
|
|
|
|
"-DDOLPHIN_WC_BRANCH=master"
|
2019-08-22 08:22:31 +02:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2018-06-28 01:33:13 +02:00
|
|
|
"-DOSX_USE_DEFAULT_SEARCH_PATH=True"
|
|
|
|
];
|
2014-09-02 10:19:44 +02:00
|
|
|
|
2019-08-22 08:33:04 +02:00
|
|
|
qtWrapperArgs = lib.optionals stdenv.isLinux [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
|
2021-11-10 17:45:53 +01:00
|
|
|
# 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"
|
2019-08-22 08:33:04 +02:00
|
|
|
];
|
|
|
|
|
2017-07-21 05:57:57 +02:00
|
|
|
# - Allow Dolphin to use nix-provided libraries instead of building them
|
2019-08-22 08:33:04 +02:00
|
|
|
postPatch = ''
|
2018-06-28 01:33:13 +02:00
|
|
|
sed -i -e 's,DISTRIBUTOR "None",DISTRIBUTOR "NixOS",g' CMakeLists.txt
|
2019-08-22 08:22:31 +02:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2018-06-28 01:33:13 +02:00
|
|
|
sed -i -e 's,if(NOT APPLE),if(true),g' CMakeLists.txt
|
2018-06-19 08:14:04 +02:00
|
|
|
sed -i -e 's,if(LIBUSB_FOUND AND NOT APPLE),if(LIBUSB_FOUND),g' \
|
|
|
|
CMakeLists.txt
|
2017-07-21 05:57:31 +02:00
|
|
|
'';
|
2014-09-02 10:19:44 +02:00
|
|
|
|
2021-11-10 17:45:53 +01:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
2020-12-03 10:26:21 +01:00
|
|
|
install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
|
2018-06-09 18:32:22 +02:00
|
|
|
'';
|
|
|
|
|
2019-08-22 08:22:31 +02:00
|
|
|
meta = with lib; {
|
2018-10-15 03:26:46 +02:00
|
|
|
homepage = "https://dolphin-emu.org";
|
|
|
|
description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
|
|
|
|
license = licenses.gpl2Plus;
|
2019-08-22 08:48:21 +02:00
|
|
|
maintainers = with maintainers; [ MP2E ashkitten ];
|
2017-11-11 20:46:20 +01:00
|
|
|
branch = "master";
|
2014-12-10 15:43:15 +01:00
|
|
|
# x86_32 is an unsupported platform.
|
|
|
|
# Enable generic build if you really want a JIT-less binary.
|
2018-09-20 22:14:30 +02:00
|
|
|
broken = stdenv.isDarwin;
|
2017-07-21 02:29:23 +02:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2014-09-02 10:19:44 +02:00
|
|
|
};
|
|
|
|
}
|