2018-06-19 07:14:04 +01:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, makeDesktopItem, pkgconfig, cmake, qt5
|
2018-06-28 00:33:13 +01:00
|
|
|
, bluez, ffmpeg, libao, libGLU_combined, pcre, gettext, libXrandr, libusb, lzo
|
|
|
|
, libpthreadstubs, libXext, libXxf86vm, libXinerama, libSM, libXdmcp, readline
|
2018-07-17 21:11:16 +01:00
|
|
|
, openal, udev, libevdev, portaudio, curl, alsaLib, miniupnpc, enet, mbedtls
|
2018-06-28 00:33:13 +01:00
|
|
|
, soundtouch, sfml, vulkan-loader ? null, libpulseaudio ? null
|
2018-06-19 04:18:48 +01:00
|
|
|
|
2017-07-21 01:15:04 +01:00
|
|
|
# - Inputs used for Darwin
|
2018-06-28 00:33:13 +01:00
|
|
|
, CoreBluetooth, cf-private, ForceFeedback, IOKit, OpenGL, libpng, hidapi }:
|
2014-09-02 09:19:44 +01:00
|
|
|
|
2018-06-19 07:14:04 +01:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "dolphin-emu-master";
|
2018-06-28 00:33:13 +01:00
|
|
|
exec = "dolphin-emu-master";
|
2018-06-19 07:14:04 +01:00
|
|
|
icon = "dolphin-emu";
|
|
|
|
comment = "A Wii/GameCube Emulator";
|
|
|
|
desktopName = "Dolphin Emulator (master)";
|
|
|
|
genericName = "Wii/GameCube Emulator";
|
|
|
|
categories = "Game;Emulator;";
|
|
|
|
startupNotify = "false";
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2018-06-23 00:09:19 +01:00
|
|
|
name = "dolphin-emu-${version}";
|
2019-04-15 23:11:15 +01:00
|
|
|
version = "5.0-9976";
|
2018-06-23 00:09:19 +01:00
|
|
|
|
2017-07-08 22:22:38 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dolphin-emu";
|
|
|
|
repo = "dolphin";
|
2019-04-15 23:11:15 +01:00
|
|
|
rev = "63f30cc44da248b0226e1c8724b3e53ecf4c768f";
|
|
|
|
sha256 = "0lkf571kzmw26fybl1lqpvhc81jkbh4hcvi3766bb7mvvzapkybd";
|
2014-09-02 09:19:44 +01:00
|
|
|
};
|
|
|
|
|
2018-06-19 04:18:48 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ]
|
2018-06-28 00:33:13 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ makeWrapper ];
|
2018-06-19 04:18:48 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
2018-06-28 00:33:13 +01:00
|
|
|
curl ffmpeg libao libGLU_combined pcre gettext libpthreadstubs libpulseaudio
|
|
|
|
libXrandr libXext libXxf86vm libXinerama libSM readline openal libXdmcp lzo
|
2018-07-17 21:11:16 +01:00
|
|
|
portaudio libusb libpng hidapi miniupnpc enet mbedtls soundtouch sfml
|
2018-06-28 00:33:13 +01:00
|
|
|
qt5.qtbase
|
|
|
|
] ++ stdenv.lib.optionals stdenv.isLinux [
|
2018-07-17 21:11:16 +01:00
|
|
|
bluez udev libevdev alsaLib vulkan-loader
|
2018-06-28 00:33:13 +01:00
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
|
|
|
CoreBluetooth cf-private OpenGL ForceFeedback IOKit
|
|
|
|
];
|
2018-06-19 04:18:48 +01:00
|
|
|
|
2017-07-21 01:24:20 +01:00
|
|
|
cmakeFlags = [
|
2018-06-28 00:33:13 +01:00
|
|
|
"-DUSE_SHARED_ENET=ON"
|
|
|
|
"-DENABLE_LTO=ON"
|
2019-04-15 23:11:15 +01:00
|
|
|
"-DDOLPHIN_WC_REVISION=${src.rev}"
|
|
|
|
"-DDOLPHIN_WC_DESCRIBE=${version}"
|
|
|
|
"-DDOLPHIN_WC_BRANCH=master"
|
2018-06-28 00:33:13 +01:00
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
|
|
|
"-DOSX_USE_DEFAULT_SEARCH_PATH=True"
|
|
|
|
];
|
2014-09-02 09:19:44 +01:00
|
|
|
|
2017-07-21 04:57:57 +01:00
|
|
|
# - Allow Dolphin to use nix-provided libraries instead of building them
|
2018-06-28 00:33:13 +01:00
|
|
|
preConfigure = ''
|
|
|
|
sed -i -e 's,DISTRIBUTOR "None",DISTRIBUTOR "NixOS",g' CMakeLists.txt
|
|
|
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i -e 's,if(NOT APPLE),if(true),g' CMakeLists.txt
|
2018-06-19 07:14:04 +01:00
|
|
|
sed -i -e 's,if(LIBUSB_FOUND AND NOT APPLE),if(LIBUSB_FOUND),g' \
|
|
|
|
CMakeLists.txt
|
2017-07-21 04:57:31 +01:00
|
|
|
'';
|
2014-09-02 09:19:44 +01:00
|
|
|
|
2018-06-19 07:14:04 +01:00
|
|
|
postInstall = ''
|
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
2018-06-28 00:33:13 +01:00
|
|
|
ln -sf $out/bin/dolphin-emu $out/bin/dolphin-emu-master
|
2018-06-19 07:14:04 +01:00
|
|
|
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
2018-06-23 00:09:19 +01:00
|
|
|
wrapProgram $out/bin/dolphin-emu-nogui \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
|
|
|
|
wrapProgram $out/bin/dolphin-emu \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
|
2018-06-09 17:32:22 +01:00
|
|
|
'';
|
|
|
|
|
2018-06-19 04:18:48 +01:00
|
|
|
meta = with stdenv.lib; {
|
2018-10-15 02:26:46 +01:00
|
|
|
homepage = "https://dolphin-emu.org";
|
|
|
|
description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
|
|
|
|
license = licenses.gpl2Plus;
|
2018-06-19 04:18:48 +01:00
|
|
|
maintainers = with maintainers; [ MP2E ];
|
2017-11-11 19:46:20 +00:00
|
|
|
branch = "master";
|
2014-12-10 14:43:15 +00:00
|
|
|
# x86_32 is an unsupported platform.
|
|
|
|
# Enable generic build if you really want a JIT-less binary.
|
2018-09-20 21:14:30 +01:00
|
|
|
broken = stdenv.isDarwin;
|
2017-07-21 01:29:23 +01:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2014-09-02 09:19:44 +01:00
|
|
|
};
|
|
|
|
}
|