-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[20.09] libretro.mame2016: fix build with gnumake-4.3 #102078
[20.09] libretro.mame2016: fix build with gnumake-4.3 #102078
Conversation
Result of 1 package marked as broken and skipped:
|
Stale cache somehow? I explicitly unmarked it as broken. I'm running nixpkgs-review on x86_64-linux, but it's taking its time. |
Result of 1 package built:
|
Stil the same: Result of 1 package marked as broken and skipped:
|
Looks like MAME works on macOS, so we need someone who can run it to correct the dependencies. Our current MAME derivation might be of some help. |
I used With this patch it starts to compile on darwin 🎉 : diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix
index 4a8ca8713e3..6e970098a4b 100644
--- a/pkgs/misc/emulators/retroarch/cores.nix
+++ b/pkgs/misc/emulators/retroarch/cores.nix
@@ -549,7 +549,9 @@ in with stdenv.lib.licenses;
description = "Port of MAME to libretro";
license = gpl2Plus;
- extraBuildInputs = [ alsaLib libGLU libGL portaudio python27 xorg.libX11 ];
+ extraBuildInputs = [ libGLU libGL portaudio python27 xorg.libX11 ]
+ ++ stdenv.lib.optional stdenv.isLinux alsaLib;
+
postPatch = ''
# Prevent the failure during the parallel building of:
# make -C 3rdparty/genie/build/gmake.linux -f genie.make obj/Release/src/host/lua-5.3.0/src/lgc.o
@@ -618,7 +620,7 @@ in with stdenv.lib.licenses;
description = "Port of MAME ~2015 to libretro";
license = gpl2Plus;
extraNativeBuildInputs = [ python27 ];
- extraBuildInputs = [ alsaLib ];
+ extraBuildInputs = stdenv.lib.optional stdenv.isLinux alsaLib;
makefile = "Makefile";
};
@@ -639,7 +641,7 @@ in with stdenv.lib.licenses;
description = "Port of MAME ~2016 to libretro";
license = gpl2Plus;
extraNativeBuildInputs = [ python27 ];
- extraBuildInputs = [ alsaLib ];
+ extraBuildInputs = stdenv.lib.optional stdenv.isLinux alsaLib;
postPatch = ''
# Prevent the failure during the parallel building of:
# make -C 3rdparty/genie/build/gmake.linux -f genie.make obj/Release/src/host/lua-5.3.0/src/lgc.o
diff --git a/pkgs/misc/emulators/retroarch/default.nix b/pkgs/misc/emulators/retroarch/default.nix
index bfc2c338769..9b2a1db9462 100644
--- a/pkgs/misc/emulators/retroarch/default.nix
+++ b/pkgs/misc/emulators/retroarch/default.nix
@@ -32,7 +32,8 @@ stdenv.mkDerivation rec {
rev = "v${version}";
};
- nativeBuildInputs = [ pkgconfig wayland ]
+ nativeBuildInputs = [ pkgconfig ]
+ ++ optional stdenv.isLinux wayland
++ optional withVulkan makeWrapper;
buildInputs = [ ffmpeg_3 freetype libxml2 libGLU libGL python3 SDL2 which ] I moved all alsaLibs to Linux only but did not test if this is required. But then it fails to compile because it can't find gcc
|
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 (mamedev/mame#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: bkaradzic/GENie#493 - MAME: mamedev/mame#6262 - libretro: libretro/mame2016-libretro#47 The fetched patch comes from the last of these. (cherry picked from commit 8880179)
2fdf99f
to
22873ba
Compare
I've rebased onto #102145 and marked it as broken on Darwin only. I can reproduce the error on Linux using |
@AluisioASG pinge me if you need help testing on darwin |
It was found out in the course of NixOS#102078 that the libretro.mame* packages did not build on macOS, both because of an unconditional dependency on alsa-lib (which is exclusive to Linux) and references to GCC scattered across makefiles. This commit makes alsa-lib a dependency only on Linux, and tries to force usage of the generic `cc`/`c++` commands. Ideally we'd refer to the `$CC` and `$CXX` environment variables, but that seems to introduce recursive expansion problems for make. Thanks to @SuperSandro2000 for suggestions and actual testing.
Thanks for the backport as well 👍 |
Motivation for this change
Backport #101949 to unbreak libretro cores.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)