Skip to content

Instantly share code, notes, and snippets.

@andydude
Created February 2, 2015 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andydude/437bbc4a3752d0889b70 to your computer and use it in GitHub Desktop.
Save andydude/437bbc4a3752d0889b70 to your computer and use it in GitHub Desktop.
Inline::Python on MacOSX
diff --git a/Makefile.in b/Makefile.in
index 8172d27..dd0fc06 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,9 @@
+EXTOPTS="-arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector"
.PHONY: clean test
all: %DESTDIR%/Inline/pyhelper%SO%
clean:
rm %DESTDIR%/Inline/pyhelper%SO%
%DESTDIR%/Inline/pyhelper%SO%: pyhelper.c
- %CC% pyhelper.c -Wall -I"%INCLUDEPY%" -L"%LIBPLPY%" -l%LIBRARYPY% `perl -MExtUtils::Embed -e ccopts -e ldopts` -
+ %CC% pyhelper.c -Wall -I"%INCLUDEPY%" -L"%LIBPLPY%" -l%LIBRARYPY% $(EXTOPTS) -shared -o %DESTDIR%/Inline/pyhelpe
test: all
prove -e 'perl6 -Ilib' t
diff --git a/lib/Inline/Python.pm6 b/lib/Inline/Python.pm6
index c64f0e2..fec204f 100644
--- a/lib/Inline/Python.pm6
+++ b/lib/Inline/Python.pm6
@@ -8,7 +8,7 @@ has &!call_method;
use NativeCall;
sub native(Sub $sub) {
- my $so = 'pyhelper.so';
+ my $so = 'pyhelper.dylib';
state Str $path;
unless $path {
for @*INC {
$ prove -e 'perl6 -Ilib' t
t/call.t ................ ok
t/call_back.t ........... ok
t/callables.t ........... ok
t/eval.t ................ ok
t/eval_return_values.t .. ok
t/exceptions.t .......... 1/? WARNING:root:foo
t/exceptions.t .......... ok
t/inherit.t ............. 1/8 Too few positionals passed; expected 2 arguments but got 1
in method invoke at /Users/ajr/Workspaces/Perl6/Inline-Python/lib/Inline/Python.pm6:488
in block <unit> at t/inherit.t:63
# Looks like you planned 8 tests, but ran 4
t/inherit.t ............. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 4/8 subtests
t/invoke.t .............. ok
t/p6_to_py.t ............ ok
t/precomp.t ............. ok
t/py_to_p6.t ............ ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment