Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 97 lines (84 sloc) 2.744 kB
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
1 $include_const "iglobals.pasm";
258177b @leto Get rid of a winxed deprecation warning and ignore ctags junk
leto authored
2 $loadlib "io_ops";
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
3
4 function main[main](argv) {
5 var parrot_libgit2 = {
6 "name" : 'parrot-libgit2',
7 "abstract" : 'Parrot bindings for libgit2',
8 "description" : 'Parrot bindings for libgit2 - the linkable git library',
9 "authority" : 'http://github.com/leto',
10 "copyright_holder" : 'Jonathan "Duke" Leto',
bed9503 @leto Fix a syntax error in setup.winxed and correct the path to our source…
leto authored
11 "keywords" : ["parrot", "git", "libgit2"],
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
12 "license_type" : 'Artistic License 2.0',
13 "license_uri" : 'http://www.perlfoundation.org/artistic_license_2_0',
14 "checkout_uri" : 'git://github.com/leto/parrot-libgit2.git',
15 "browser_uri" : 'git://github.com/leto/parrot-libgit2',
16 "project_uri" : 'git://github.com/leto/parrot-libgit2',
17 "pir_winxed" : {},
18 "pbc_pir" : {},
19 "inst_lib" : [],
20 "installable_pbc" : {},
21 "include_winxed" : {},
22 "manifest_includes" : ["README.md", "setup.winxed"]
23 };
24
25 if (argv[1] == "test")
26 do_test();
27
28 setup_stable_libraries(parrot_libgit2);
29
30 load_bytecode('distutils.pir');
31 using setup;
32 using register_step_before;
33
34 register_step_before("build", check_dependencies);
35 register_step_before("clean", clean_build_dir);
36
37 argv.shift();
38 setup(argv, parrot_libgit2);
39 }
40
41 function setup_stable_libraries(var parrot_libgit2) {
42 var libs = [
c14454e @leto Give Git2.Index a proper home and list all the current subsystems in …
leto authored
43 'Cache',
a4dd73b @leto Add a test for creating a Git2.Repository object in winxed
leto authored
44 'Common',
c14454e @leto Give Git2.Index a proper home and list all the current subsystems in …
leto authored
45 'Index',
f517ed7 @leto Start Git2.Odb class and add a test for git_repository_database
leto authored
46 'Odb',
8090e6f @leto Start of a Git2.Oid class
leto authored
47 'Oid',
c14454e @leto Give Git2.Index a proper home and list all the current subsystems in …
leto authored
48 'RefCache',
a4dd73b @leto Add a test for creating a Git2.Repository object in winxed
leto authored
49 'Repository'
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
50 ];
51
bed9503 @leto Fix a syntax error in setup.winxed and correct the path to our source…
leto authored
52 string prefix = "./src/Git2/";
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
53
54 for (string source in libs) {
55 string winxed_file = prefix + source + ".winxed";
56 string pir_file = prefix + source + ".pir";
bed9503 @leto Fix a syntax error in setup.winxed and correct the path to our source…
leto authored
57 string pbc_file = prefix + source + ".pbc";
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
58 parrot_libgit2["pir_winxed"][pir_file] = winxed_file;
59 parrot_libgit2["pbc_pir"][pbc_file] = pir_file;
60 parrot_libgit2["inst_lib"].push(pbc_file);
61 }
62 }
63
64 function do_test() {
65 int result;
66 string cmd = "parrot-nqp t/harness";
67 ${ spawnw result, cmd };
68 ${ exit result };
69 }
70
71 function check_dependencies() {
72 var config = getinterp()[IGLOBALS_CONFIG_HASH];
67a641d @leto Correct our minimum parrot check to 3.5.0 instead of 3.2.0
leto authored
73 // Check if Parrot is > 3.5.0
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
74 int maj = config['MAJOR'];
75 int min = config['MINOR'];
67a641d @leto Correct our minimum parrot check to 3.5.0 instead of 3.2.0
leto authored
76 if (maj < 3 || (maj == 3 && min < 5)) {
77 die("You need at least Parrot 3.5.0 to use parrot-libgit2");
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
78 }
79 // Check if Parrot has been built/configured with libffi
80 int has_libffi = config['has_libffi'];
81 if (!has_libffi) {
82 die("You need to have Parrot configured with libffi to use parrot-libgit2");
83 }
84 }
85
86 function clean_build_dir() {
87 var config = getinterp()[IGLOBALS_CONFIG_HASH];
88 string exe = "build/git2_test" + string(config['exe']);
89 int e = 0;
90 ${ stat e, exe, 0 };
91 if (e) {
92 say("unlink " + exe);
93 unlink(exe);
94 }
6b04b2f @leto Clean up git2.pbc
leto authored
95 unlink("src/git2.pbc");
64b5dc2 @leto Initial skeleton of a Parrot library which uses winxed and rosella
leto authored
96 }
Something went wrong with that request. Please try again.