From 0b4d19ccdded19dbde2a8a36251b184157d1e37c Mon Sep 17 00:00:00 2001 From: Raf Gemmail Date: Sun, 25 May 2025 13:17:20 +1200 Subject: [PATCH] matrix-brandy: add darwin support --- pkgs/by-name/ma/matrix-brandy/no-lrt.patch | 13 +++++++++++++ pkgs/by-name/ma/matrix-brandy/package.nix | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/ma/matrix-brandy/no-lrt.patch diff --git a/pkgs/by-name/ma/matrix-brandy/no-lrt.patch b/pkgs/by-name/ma/matrix-brandy/no-lrt.patch new file mode 100644 index 000000000000..7f42553852a9 --- /dev/null +++ b/pkgs/by-name/ma/matrix-brandy/no-lrt.patch @@ -0,0 +1,13 @@ +diff --git a/makefile b/makefile +index d89cee1..37c1ac5 100644 +--- a/makefile ++++ b/makefile +@@ -13,7 +13,7 @@ CFLAGS = -O3 -fPIE $(shell sdl-config --cflags) -DUSE_SDL -DDEFAULT_IGNORE -Wall + + LDFLAGS += + +-LIBS = -lm $(shell sdl-config --libs) -ldl -pthread -lrt -lX11 ++LIBS = -lm $(shell sdl-config --libs) -ldl -pthread -lX11 + + SRCDIR = src + diff --git a/pkgs/by-name/ma/matrix-brandy/package.nix b/pkgs/by-name/ma/matrix-brandy/package.nix index de9247c2fa20..2adc72a2e897 100644 --- a/pkgs/by-name/ma/matrix-brandy/package.nix +++ b/pkgs/by-name/ma/matrix-brandy/package.nix @@ -18,6 +18,13 @@ stdenv.mkDerivation rec { hash = "sha256-sMgYgV4/vV1x5xSICXRpW6K8uCdVlJrS7iEg6XzQRo8="; }; + patches = lib.optionals stdenv.isDarwin [ ./no-lrt.patch ]; + + makeFlags = lib.optionals stdenv.isDarwin [ + "CC=cc" + "LD=clang" + ]; + buildInputs = [ libX11 SDL @@ -35,7 +42,7 @@ stdenv.mkDerivation rec { description = "Matrix Brandy BASIC VI for Linux, Windows, MacOSX"; mainProgram = "brandy"; license = licenses.gpl2Plus; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ fiq ]; }; }