From 234171619fd1bfe7dc7d9d99b37b0e94be89b6e0 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Wed, 14 Feb 2024 00:43:04 +0100 Subject: [PATCH] ruby: try using homebrew for SDL in local builds on macOS --- ruby/GNUmakefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ruby/GNUmakefile b/ruby/GNUmakefile index e98d956667..cc54985b2f 100644 --- a/ruby/GNUmakefile +++ b/ruby/GNUmakefile @@ -22,10 +22,18 @@ ifeq ($(ruby),) ruby += input.quartz #input.carbon ifeq ($(sdl2),true) macsdl = ../thirdparty/SDL/libSDL2-2.0.0.dylib - ares.dylibs += $(macsdl) ifeq ($(wildcard $(macsdl)),) - $(error Tried to compile ruby for macOS with SDL2 linked, but no SDL2 library was found. Compile it with thirdparty/SDL/build-sdl.sh, or disable SDL by compiling ares with sdl2=false) + ifeq ($(local),true) + sdl2prefix = $(shell brew --prefix sdl2) + ifneq ($(sdl2prefix),) + macsdl = $(sdl2prefix)/lib/libSDL2-2.0.0.dylib + endif + endif + endif + ifeq ($(wildcard $(macsdl)),) + $(error Tried to compile ruby for macOS with SDL2 linked, but no SDL2 library was found. Install it with homebrew, or compile it with thirdparty/SDL/build-sdl.sh, or disable SDL by compiling ares with sdl2=false) endif + ares.dylibs += $(macsdl) ruby += input.sdl endif else ifeq ($(platform),linux)