hashlink: add x86_64-darwin compatibility (#193580)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
logo 2022-10-01 17:41:52 -04:00 committed by GitHub
parent 2ee5c2fa1c
commit 423e9cc42c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 10 deletions

View File

@ -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 ];
};
}

View File

@ -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