luaffi: fix darwin build

/cc ZHF #36454
This commit is contained in:
Daiderd Jordan 2018-03-21 21:13:33 +01:00
parent c2ca5c057d
commit fe37684525
No known key found for this signature in database
GPG Key ID: D02435D05B810C96
2 changed files with 20 additions and 3 deletions

View File

@ -0,0 +1,17 @@
diff --git a/Makefile b/Makefile
index b2b5f2c..b690a5d 100644
--- a/Makefile
+++ b/Makefile
@@ -18,10 +18,10 @@ test:
if [ `uname` = "Darwin" ]; then $(MAKE) test_macosx; else $(MAKE) test_posix; fi
macosx:
- $(MAKE) posix "SOCC=MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) -dynamiclib -single_module -undefined dynamic_lookup $(SOCFLAGS)"
+ $(MAKE) posix "SOCC= $(CC) -dynamiclib -single_module -undefined dynamic_lookup -Wl,-install_name,$(PREFIX)/lib/$(MODSO) $(SOCFLAGS)"
test_macosx:
- $(MAKE) test_posix "SOCC=MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) -dynamiclib -single_module -undefined dynamic_lookup $(SOCFLAGS)"
+ $(MAKE) test_posix "SOCC= $(CC) -dynamiclib -single_module -undefined dynamic_lookup -Wl,-install_name,$(PREFIX)/lib/$(MODSO) $(SOCFLAGS)"
posix: $(MODSO) test_cdecl.so

View File

@ -12,9 +12,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ lua ];
patches = [
./makefile-errors.patch
];
patches = [ ./darwin.patch ./makefile-errors.patch ];
makeFlags = [ "PREFIX=$(out)" ];
installPhase = ''
mkdir -p $out/lib