Skip to content

Commit

Permalink
Register wrapper installation step
Browse files Browse the repository at this point in the history
Register steps for installation and uninstallation of wrapper library.
This needs to be improved with pkg-config etc.
  • Loading branch information
sa1 committed Sep 8, 2013
1 parent f7ca9ac commit f9d851d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions setup.winxed
Expand Up @@ -37,6 +37,8 @@ function main[main](argv) {
register_step_before("build", build_nci);
register_step_before("build", build_lib);
register_step_before("clean", clean_build_dir);
register_step_before("install", install_clib);
register_step_before("uninstall", uninstall_clib);

argv.shift();
setup(argv, parrot_libgit2);
Expand Down Expand Up @@ -93,6 +95,35 @@ function build_test() {
${ spawnw result, cmd};
}

function install_clib(){
//TODO use pkg-config
var env = new 'Env';
string parrotgitdir;
if (env['LIBPARROTGIT_INSTALL_DIR'] == ''){
parrotgitdir = "/usr/local/lib/";
}
else{
parrotgitdir = env['LIBPARROTGIT_INSTALL_DIR'];
}
string cmd = "cp libparrotgit.so " + parrotgitdir;
int result;
${spawnw result, cmd};
}

function uninstall_clib(){
var env = new 'Env';
string parrotgitdir;
if (env['LIBPARROTGIT_INSTALL_DIR'] == ''){
parrotgitdir = "/usr/local/lib/";
}
else{
parrotgitdir = env['LIBPARROTGIT_INSTALL_DIR'];
}
string filename = parrotgitdir + "libparrotgit.so";
int result;
unlink(filename);
}

function build_nci() {
var env = new 'Env';
string libgit_dir;
Expand Down

0 comments on commit f9d851d

Please sign in to comment.