From 8880179b653648abce4208654695d9276e9fd036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Augusto=20Silva=20Gon=C3=A7alves?= Date: Wed, 28 Oct 2020 13:03:22 -0300 Subject: [PATCH] libretro.mame2016: fix build with gnumake-4.3 Builds currently fail with `ar` trying to operate on what are clearly two paths concatenated together. It stems from a backward-incompatible change in Make: > Previously appending using '+=' to an empty variable would result in > a value starting with a space. Now the initial space is only added > if the variable already contains some value. Similarly, appending an > empty string does not add a trailing space. This issue was first reported on the MAME repository proper (https://github.com/mamedev/mame/issues/6248), and affects libretro's 2016 snapshot as well. A fix that is reported to work with previous versions of Make was upstreamed to: - GENie, the build system: https://github.com/bkaradzic/GENie/pull/493 - MAME: https://github.com/mamedev/mame/pull/6262 - libretro: https://github.com/libretro/mame2016-libretro/pull/47 The fetched patch comes from the last of these. --- pkgs/misc/emulators/retroarch/cores.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix index 17b1679ed5bab..2b9cb5e6d27e5 100644 --- a/pkgs/misc/emulators/retroarch/cores.nix +++ b/pkgs/misc/emulators/retroarch/cores.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, fetchFromGitHub, fetchFromGitLab, cmake, pkgconfig, makeWrapper, python27, python37, retroarch +{ stdenv, fetchgit, fetchFromGitHub, fetchFromGitLab, fetchpatch, cmake, pkgconfig, makeWrapper, python27, python37, retroarch , alsaLib, fluidsynth, curl, hidapi, libGLU, gettext, glib, gtk2, portaudio, SDL, SDL_net, SDL2, SDL2_image, libGL , ffmpeg_3, pcre, libevdev, libpng, libjpeg, libzip, udev, libvorbis, snappy, which, hexdump , miniupnpc, sfml, xorg, zlib, nasm, libpcap, boost, icu, openssl @@ -630,6 +630,13 @@ in with stdenv.lib.licenses; rev = "02987af9b81a9c3294af8fb9d5a34f9826a2cf4d"; sha256 = "0gl7irmn5d8lk7kf484vgw6kb325fq4ghwsni3il4nm5n2a8yglh"; }; + patches = [ + (fetchpatch { + name = "fix_mame_build_on_make-4.3.patch"; + url = "https://github.com/libretro/mame2016-libretro/commit/5874fae3d124f5e7c8a91634f5473a8eac902e47.patch"; + sha256 = "061f1lcm72glksf475ikl8w10pnbgqa7049ylw06nikis2qdjlfn"; + }) + ]; description = "Port of MAME ~2016 to libretro"; license = gpl2Plus; extraNativeBuildInputs = [ python27 ];