Skip to content

Instantly share code, notes, and snippets.

@neonfuz
Created December 16, 2017 04:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neonfuz/09d49513929577d78b8129346900b7e9 to your computer and use it in GitHub Desktop.
Save neonfuz/09d49513929577d78b8129346900b7e9 to your computer and use it in GitHub Desktop.
{ stdenv, pkgconfig, cmake, bluez, ffmpeg, libao, gtk2, glib, mesa
, gettext, libpthreadstubs, libXrandr, libXext, readline, openal
, libXdmcp, portaudio, fetchzip, fetchFromGitHub, libusb, libevdev
, wxGTK30, soundtouch, miniupnpc, mbedtls, curl, lzo, sfml
, libpulseaudio ? null }:
stdenv.mkDerivation rec {
name = "dolphin-emu-faster-melee-beta-${version}";
version = "5.8.7";
src = fetchFromGitHub {
owner = "FasterMelee";
repo = "Ishiiruka";
rev = "6ababb9222fb8bb9723ae137e1263a27196fcd47";
sha256 = "15wwkv5cn9dxdmqmzmpncq7myg6q5v53ql5hrplpglpp3gkhs9di";
};
fmConfig = fetchzip {
url = "https://github.com/FasterMelee/FasterMelee-installer/raw/master/config/${version}-fmconfig.tar.gz";
sha256 = "1ws1kafm23373cgy70xj57kyx4vngvkkc23m42g4fa89ayaivdgp";
stripRoot = false;
};
# Make some fixes to the source
postPatch = ''
sed -i "s|#define wxUSE_XLOCALE 1|#define wxUSE_XLOCALE 0|g" Externals/wxWidgets3/wx/wxcocoa.h
sed -i "s|#define wxUSE_XLOCALE 1|#define wxUSE_XLOCALE 0|g" Externals/wxWidgets3/wx/wxgtk.h
sed -i "s|#define wxUSE_DETECT_SM 1|#define wxUSE_DETECT_SM 0|g" Externals/wxWidgets3/wx/wxgtk.h
sed -i "s|$\\\{CMAKE_SOURCE_DIR\\\}/include|$\{CMAKE_CURRENT_SOURCE_DIR\}/include|g" Externals/cubeb/CMakeLists.txt
sed -i "s|\$\\\{GIT_EXECUTABLE\\\} rev-parse HEAD|echo ${src.rev}|g" CMakeLists.txt # --set scm_rev_str everywhere to actual commit hash when downloaded
sed -i "s|\$\\\{GIT_EXECUTABLE\\\} describe --always --long --dirty|echo FM v${version} BETA|g" CMakeLists.txt # ensures compatibility w/ netplay
sed -i "s|\$\\\{GIT_EXECUTABLE\\\} rev-parse --abbrev-ref HEAD|echo HEAD|g" CMakeLists.txt
'';
# Unpack the faster melee config before doing our own config
preConfigure = ''
mkdir -p build
cp -r ${fmConfig}/Binaries build/
chmod 755 build/Binaries
cp Data/dolphin-emu.png build/Binaries/
chmod -R 755 build/
'';
cmakeFlags = ''
-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include
-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include
-DGTK2_INCLUDE_DIRS=${gtk2.dev}/include/gtk-2.0
-DENABLE_LTO=True
'';
enableParallelBuilding = true;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cmake bluez ffmpeg libao mesa gtk2 glib
gettext libpthreadstubs libXrandr libXext readline openal
libevdev libXdmcp portaudio libusb libpulseaudio
libevdev libXdmcp portaudio libusb libpulseaudio
wxGTK30 soundtouch miniupnpc mbedtls curl lzo sfml ];
meta = {
homepage = http://dolphin-emu.org/;
description = "Dolphin Emulator - Faster Melee";
license = stdenv.lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [ MP2E ];
# x86_32 is an unsupported platform.
# Enable generic build if you really want a JIT-less binary.
platforms = [ "x86_64-linux" ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment