about summary refs log tree commit diff
path: root/pkgs/development/interpreters/hashlink
diff options
context:
space:
mode:
authorlogo <logo4poop@protonmail.com>2022-10-01 17:41:52 -0400
committerGitHub <noreply@github.com>2022-10-01 23:41:52 +0200
commit423e9cc42c5b9560a8e1240abc09bca98c2a36bc (patch)
tree2435a8931dda494e52f2a5cbecc59767fcb14646 /pkgs/development/interpreters/hashlink
parent2ee5c2fa1c7748784fa3894c953bbf2d1cbef4d3 (diff)
hashlink: add x86_64-darwin compatibility (#193580)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/development/interpreters/hashlink')
-rw-r--r--pkgs/development/interpreters/hashlink/default.nix11
-rw-r--r--pkgs/development/interpreters/hashlink/hashlink.patch40
2 files changed, 41 insertions, 10 deletions
diff --git a/pkgs/development/interpreters/hashlink/default.nix b/pkgs/development/interpreters/hashlink/default.nix
index eb69bd4103d2a..1af48cba55abb 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 5e699073d02dc..20d4eedd5a8a3 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 <OpenGLES/ES3/gl.h>

+ #	define HL_GLES

+ #elif defined(HL_MAC)

+-#	include <SDL.h>

++#	include <SDL2/SDL.h>

+ #	include <OpenGL/gl3.h>

+ #	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 <SDL.h>

+ #	include <SDL_syswm.h>

+ #elif defined(HL_MAC)

+-#	include <SDL.h>

++#	include <SDL2/SDL.h>

+ #else

+ #	include <SDL2/SDL.h>

+ #endif