From f21ced0bb5cb480a90385964b0db116f77b13dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gr=C3=A4fenstein?= Date: Wed, 21 Oct 2020 01:38:54 +0200 Subject: [PATCH] pcsx2: build with LTO --- pkgs/misc/emulators/pcsx2/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/misc/emulators/pcsx2/default.nix b/pkgs/misc/emulators/pcsx2/default.nix index 1f947def7d3..a08ee4f057f 100644 --- a/pkgs/misc/emulators/pcsx2/default.nix +++ b/pkgs/misc/emulators/pcsx2/default.nix @@ -1,6 +1,6 @@ -{ alsaLib, cmake, fetchFromGitHub, gettext, glib, gtk3, harfbuzz, libaio -, libpcap, libpng, libxml2, makeWrapper, perl, pkgconfig, portaudio, SDL2 -, soundtouch, stdenv, udev, wrapGAppsHook, wxGTK, zlib +{ alsaLib, cmake, fetchFromGitHub, gcc-unwrapped, gettext, glib, gtk3, harfbuzz +, libaio, libpcap, libpng, libxml2, makeWrapper, perl, pkgconfig, portaudio +, SDL2, soundtouch, stdenv, udev, wrapGAppsHook, wxGTK, zlib }: stdenv.mkDerivation { @@ -25,12 +25,20 @@ stdenv.mkDerivation { "-DPACKAGE_MODE=TRUE" "-DPLUGIN_DIR=${placeholder "out"}/lib/pcsx2" "-DREBUILD_SHADER=TRUE" + "-DUSE_LTO=TRUE" "-DwxWidgets_CONFIG_EXECUTABLE=${wxGTK}/bin/wx-config" "-DwxWidgets_INCLUDE_DIRS=${wxGTK}/include" "-DwxWidgets_LIBRARIES=${wxGTK}/lib" "-DXDG_STD=TRUE" ]; + postPatch = '' + substituteInPlace cmake/BuildParameters.cmake \ + --replace /usr/bin/gcc-ar ${gcc-unwrapped}/bin/gcc-ar \ + --replace /usr/bin/gcc-nm ${gcc-unwrapped}/bin/gcc-nm \ + --replace /usr/bin/gcc-ranlib ${gcc-unwrapped}/bin/gcc-ranlib + ''; + postFixup = '' wrapProgram $out/bin/PCSX2 \ --set __GL_THREADED_OPTIMIZATIONS 1