Skip to content

Commit

Permalink
luaffi: fix darwin build
Browse files Browse the repository at this point in the history
/cc ZHF #36454
  • Loading branch information
LnL7 committed Mar 21, 2018
1 parent c2ca5c0 commit fe37684
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions pkgs/development/libraries/luaffi/darwin.patch
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions pkgs/development/libraries/luaffi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe37684

Please sign in to comment.