From 423e9cc42c5b9560a8e1240abc09bca98c2a36bc Mon Sep 17 00:00:00 2001 From: logo Date: Sat, 1 Oct 2022 17:41:52 -0400 Subject: [PATCH] hashlink: add x86_64-darwin compatibility (#193580) Co-authored-by: Sandro --- .../interpreters/hashlink/default.nix | 11 ++++- .../interpreters/hashlink/hashlink.patch | 40 +++++++++++++++---- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/pkgs/development/interpreters/hashlink/default.nix b/pkgs/development/interpreters/hashlink/default.nix index eb69bd4103d2..1af48cba55ab 100644 --- a/pkgs/development/interpreters/hashlink/default.nix +++ b/pkgs/development/interpreters/hashlink/default.nix @@ -12,6 +12,7 @@ , pcre , SDL2 , sqlite +, getconf }: stdenv.mkDerivation rec { @@ -43,11 +44,17 @@ stdenv.mkDerivation rec { sqlite ]; + nativeBuildInputs = [ getconf ]; + + postFixup = lib.optionalString stdenv.isDarwin '' + install_name_tool -change libhl.dylib $out/lib/libhl.dylib $out/bin/hl + ''; + meta = with lib; { description = "A virtual machine for Haxe"; homepage = "https://hashlink.haxe.org/"; license = licenses.mit; - platforms = [ "x86_64-linux" ]; - maintainers = with maintainers; [ iblech locallycompact ]; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; + maintainers = with maintainers; [ iblech locallycompact logo ]; }; } diff --git a/pkgs/development/interpreters/hashlink/hashlink.patch b/pkgs/development/interpreters/hashlink/hashlink.patch index 5e699073d02d..20d4eedd5a8a 100644 --- a/pkgs/development/interpreters/hashlink/hashlink.patch +++ b/pkgs/development/interpreters/hashlink/hashlink.patch @@ -1,8 +1,32 @@ -*** a/Makefile 1970-01-01 01:00:01.000000000 +0100 ---- b/Makefile 2022-06-21 23:36:10.023460654 +0200 -*************** endif -*** 109,110 **** ---- 109,111 ---- - LIBOPENAL = -lopenal -+ LIBOPENGL = -lGL - RELEASE_NAME = linux +--- a/Makefile ++++ b/Makefile +@@ -107,6 +107,7 @@ LIBFLAGS += -L/opt/libjpeg-turbo/lib64 + endif + + LIBOPENAL = -lopenal ++LIBOPENGL = -lGL + RELEASE_NAME = linux + + endif +--- a/libs/sdl/gl.c ++++ b/libs/sdl/gl.c +@@ -7,7 +7,7 @@ + # include + # define HL_GLES + #elif defined(HL_MAC) +-# include ++# include + # include + # define glBindImageTexture(...) hl_error("Not supported on OSX") + # define glDispatchCompute(...) hl_error("Not supported on OSX") +--- a/libs/sdl/sdl.c ++++ b/libs/sdl/sdl.c +@@ -7,7 +7,7 @@ + # include + # include + #elif defined(HL_MAC) +-# include ++# include + #else + # include + #endif