Skip to content

Commit 07c0af9

Browse files
committed
Merge pull request #3 from retupmoca/master
Use LibraryMake; find shared object at runtime
2 parents 859b274 + 10676b6 commit 07c0af9

File tree

6 files changed

+304
-199
lines changed

6 files changed

+304
-199
lines changed

Build.pm

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
use Panda::Common;
22
use Panda::Builder;
3-
4-
%*ENV{'LD_LIBRARY_PATH'} = join("/", $*CWD, "blib/lib");
5-
6-
my $o = $*VM<config><o>;
7-
my $so = $*VM<config><load_ext>;
8-
my $name = "Imlib2";
9-
my $libs = "-Wl,--no-as-needed -lImlib2";
3+
use LibraryMake;
104

115
class Build is Panda::Builder {
12-
method build(Pies::Project $p) {
13-
my $workdir = $.resources.workdir($p);
14-
15-
my $c_line = "$*VM<config><cc> -c $*VM<config><cc_shared> $*VM<config><cc_o_out>src/$name$o "
16-
~ "$*VM<config><ccflags> src/$name.c";
17-
my $l_line = "$*VM<config><ld> $*VM<config><ld_load_flags> $*VM<config><ldflags> "
18-
~ "$*VM<config><libs>$libs $*VM<config><ld_out>src/$name$so src/$name$o";
19-
shell($c_line);
20-
shell($l_line);
21-
shell("rm src/$name$o");
22-
shell("mkdir -p blib/lib");
23-
shell("cp src/$name$so blib/lib");
6+
method build($workdir) {
7+
shell("mkdir -p $workdir/blib/lib");
8+
make("$workdir/src", "$workdir/blib/lib");
249
}
2510
}
26-

META.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version" : "0.0.1",
44
"description" : "Perl 6 interface to the Imlib2 image library.",
55
"author" : "Henrique Dias",
6-
"depends" : [ "NativeCall" ],
6+
"depends" : [ "NativeCall", "LibraryMake" ],
77
"source-type" : "git",
88
"source-url" : "git://github.com/mrhdias/perl6-Imlib2.git"
99
}

0 commit comments

Comments
 (0)