Permalink
Browse files

xs: embed libgit2

  • Loading branch information...
1 parent e5fe1d5 commit a99e3db6691a25140edfe4669454ff51e38f61dd @ghedo ghedo committed Aug 21, 2012
Showing with 18 additions and 5 deletions.
  1. +3 −0 .gitmodules
  2. +14 −5 inc/MakeMaker.pm
  3. +1 −0 xs/libgit2
View
@@ -0,0 +1,3 @@
+[submodule "xs/libgit2"]
+ path = xs/libgit2
+ url = git://github.com/libgit2/libgit2.git
View
@@ -7,18 +7,27 @@ extends 'Dist::Zilla::Plugin::MakeMaker::Awesome';
override _build_MakeFile_PL_template => sub {
my ($self) = @_;
- my $template = "use Devel::CheckLib;\n";
- $template .= "check_lib_or_exit(lib => 'git2');\n";
+
+ my $template = <<'EOS';
+chdir("xs");
+system(
+ "cmake",
+ "-D", "BUILD_SHARED_LIBS:BOOL=OFF",
+ "-D", "BUILD_CLAR:BOOL=OFF",
+ "libgit2"
+);
+system("make");
+chdir("..");
+EOS
return $template.super();
};
override _build_WriteMakefile_args => sub {
return +{
%{ super() },
- LIBS => '-lgit2',
- INC => '-I.',
- OBJECT => '$(O_FILES)',
+ INC => '-I. -Ixs/libgit2/include',
+ OBJECT => '$(O_FILES) xs/libgit2.a',
}
};
Submodule libgit2 added at c35881

0 comments on commit a99e3db

Please sign in to comment.