File tree Expand file tree Collapse file tree 5 files changed +18
-13
lines changed Expand file tree Collapse file tree 5 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,17 @@ class Build is Panda::Builder {
10
10
}
11
11
12
12
method build ($ dir ) {
13
- mkdir " $ dir /resources" unless " $ dir /resources" . IO . e ;
14
-
15
13
my % vars = get-vars($ dir );
16
14
% vars <INCLUDEPY > = get_config_var(' INCLUDEPY' );
17
15
my $ library = get_config_var(' LIBRARY' );
18
16
$ library ~~ s /\. a$ // ;
19
17
$ library ~~ s /^ lib // ;
20
18
% vars <LIBRARYPY > = $ library ;
21
19
% vars <LIBPLPY > = get_config_var(' LIBPL' );
22
- process-makefile($ dir , % vars );
20
+ % vars <pyhelper > = $ * VM . platform-library-name(' pyhelper' . IO );
21
+ mkdir " $ dir /resources" unless " $ dir /resources" . IO . e ;
22
+ mkdir " $ dir /resources/libraries" unless " $ dir /resources/libraries" . IO . e ;
23
+ process-makefile(' .' , % vars );
23
24
24
25
my $ goback = $ * CWD ;
25
26
chdir($ dir );
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : "Inline::Python",
3
- "version" : "* ",
3
+ "version" : "0.1 ",
4
4
"author" : "github:niner",
5
5
"description" : "Use Python code and libraries in a Perl 6 program",
6
6
"depends" : [ "LibraryMake" ],
7
7
"provides" : {
8
8
"Inline::Python" : "lib/Inline/Python.pm6"
9
9
},
10
+ "resources" : [ "libraries/pyhelper" ],
10
11
"source-url" : "git://github.com/niner/Inline-Python.git"
11
12
}
Original file line number Diff line number Diff line change 1
1
.PHONY : clean test
2
- all : % DESTDIR% /resources/pyhelper% SO%
2
+
3
+ all : % DESTDIR% /resources/libraries/% pyhelper%
4
+
3
5
clean :
4
- rm %DESTDIR%/resources/pyhelper%SO%
5
- % DESTDIR% /resources/pyhelper% SO% : pyhelper.c
6
- %CC% pyhelper.c -Wall -I" %INCLUDEPY%" -L" %LIBPLPY%" -l%LIBRARYPY% -shared -o %DESTDIR%/resources/pyhelper%SO% %CCSHARED% -g
6
+ rm %DESTDIR%/resources/libraries/%pyhelper%
7
+
8
+ % DESTDIR% /resources/libraries/% pyhelper% : pyhelper.c
9
+ %CC% pyhelper.c -Wall -I" %INCLUDEPY%" -L" %LIBPLPY%" -l%LIBRARYPY% -shared -o %DESTDIR%/resources/libraries/%pyhelper% %CCSHARED% -g
10
+
7
11
test : all
8
12
prove -e ' perl6 -Ilib' t
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ $library ~~ s/\.a$//;
13
13
$ library ~~ s /^ lib // ;
14
14
% vars <LIBRARYPY > = $ library ;
15
15
% vars <LIBPLPY > = get_config_var(' LIBPL' );
16
+ % vars <pyhelper > = $ * VM . platform-library-name(' pyhelper' . IO );
16
17
mkdir ' resources' unless ' resources' . IO . e ;
18
+ mkdir ' resources/libraries' unless ' resources/libraries' . IO . e ;
17
19
process-makefile(' .' , % vars );
18
20
shell (% vars <MAKE >);
19
21
Original file line number Diff line number Diff line change @@ -8,12 +8,9 @@ has &!call_method;
8
8
use NativeCall ;
9
9
10
10
sub native (Sub $ sub ) {
11
- my $ so = $ * VM . config<dll >;
12
- $ so ~~ s !^.* \% s !pyhelper! ;
13
-
14
- my Str $ path = % ? RESOURCES {$ so }. Str ;
11
+ my Str $ path = % ? RESOURCES <libraries/pyhelper >. Str ;
15
12
unless $ path {
16
- die " unable to find $ so " ;
13
+ die " unable to find pyhelper library " ;
17
14
}
18
15
trait_mod: <is >($ sub , : native($ path ));
19
16
}
You can’t perform that action at this time.
0 commit comments