@@ -1,5 +1,6 @@
11{ lib, stdenv, fetchurl, nasm
22, alsaLib, curl, flac, fluidsynth, freetype, libjpeg, libmad, libmpeg2, libogg, libvorbis, libGLU, libGL, SDL2, zlib
3+, Cocoa, AudioToolbox, Carbon, CoreMIDI, AudioUnit, cctools
34}:
45
56stdenv.mkDerivation rec {
@@ -13,8 +14,12 @@ stdenv.mkDerivation rec {
1314
1415 nativeBuildInputs = [ nasm ];
1516
16− buildInputs = [
17− alsaLib curl freetype flac fluidsynth libjpeg libmad libmpeg2 libogg libvorbis libGLU libGL SDL2 zlib
17+ buildInputs = lib.optionals stdenv.isLinux [
18+ alsaLib
19+ ] ++ lib.optionals stdenv.isDarwin [
20+ Cocoa AudioToolbox Carbon CoreMIDI AudioUnit
21+ ] ++ [
22+ curl freetype flac fluidsynth libjpeg libmad libmpeg2 libogg libvorbis libGLU libGL SDL2 zlib
1823 ];
1924
2025 dontDisableStatic = true;
@@ -30,6 +35,8 @@ stdenv.mkDerivation rec {
3035 # They use 'install -s', that calls the native strip instead of the cross
3136 postConfigure = ''
3237 sed -i "s/-c -s/-c -s --strip-program=''${STRIP@Q}/" ports.mk
38+ '' + lib.optionalString stdenv.isDarwin ''
39+ substituteInPlace config.mk --replace x86_64-apple-darwin-ranlib ${cctools}/bin/ranlib
3340 '';
3441
3542 meta = with lib; {
@@ -37,6 +44,6 @@ stdenv.mkDerivation rec {
3744 homepage = "https://www.scummvm.org/";
3845 license = licenses.gpl2;
3946 maintainers = [ maintainers.peterhoeg ];
40− platforms = platforms.linux;
47+ platforms = platforms.unix;
4148 };
4249}