From 3ac4604a52323b960708d12e9937d478f60d9fd4 Mon Sep 17 00:00:00 2001 From: squalus Date: Sun, 11 Apr 2021 00:25:38 -0700 Subject: [PATCH] scummvm: support darwin --- pkgs/games/scummvm/default.nix | 13 ++++++++++--- pkgs/top-level/all-packages.nix | 5 ++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/games/scummvm/default.nix b/pkgs/games/scummvm/default.nix index 20d781db23d9..68ccb894d992 100644 --- a/pkgs/games/scummvm/default.nix +++ b/pkgs/games/scummvm/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchurl, nasm , alsaLib, curl, flac, fluidsynth, freetype, libjpeg, libmad, libmpeg2, libogg, libvorbis, libGLU, libGL, SDL2, zlib +, Cocoa, AudioToolbox, Carbon, CoreMIDI, AudioUnit, cctools }: stdenv.mkDerivation rec { @@ -13,8 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ nasm ]; - buildInputs = [ - alsaLib curl freetype flac fluidsynth libjpeg libmad libmpeg2 libogg libvorbis libGLU libGL SDL2 zlib + buildInputs = lib.optionals stdenv.isLinux [ + alsaLib + ] ++ lib.optionals stdenv.isDarwin [ + Cocoa AudioToolbox Carbon CoreMIDI AudioUnit + ] ++ [ + curl freetype flac fluidsynth libjpeg libmad libmpeg2 libogg libvorbis libGLU libGL SDL2 zlib ]; dontDisableStatic = true; @@ -30,6 +35,8 @@ stdenv.mkDerivation rec { # They use 'install -s', that calls the native strip instead of the cross postConfigure = '' sed -i "s/-c -s/-c -s --strip-program=''${STRIP@Q}/" ports.mk + '' + lib.optionalString stdenv.isDarwin '' + substituteInPlace config.mk --replace x86_64-apple-darwin-ranlib ${cctools}/bin/ranlib ''; meta = with lib; { @@ -37,6 +44,6 @@ stdenv.mkDerivation rec { homepage = "https://www.scummvm.org/"; license = licenses.gpl2; maintainers = [ maintainers.peterhoeg ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 32c6eb4ee80b..6cd48a4748fb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27890,7 +27890,10 @@ in tk = tk-8_6; }; - scummvm = callPackage ../games/scummvm { }; + scummvm = callPackage ../games/scummvm { + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) Cocoa AudioToolbox Carbon CoreMIDI AudioUnit; + }; inherit (callPackage ../games/scummvm/games.nix { }) beneath-a-steel-sky