Skip to content

Commit

Permalink
increment to 0.1.5, and move internal libzip configure and build into…
Browse files Browse the repository at this point in the history
… node-waf so that ndistro will work
  • Loading branch information
Dane Springmeyer committed Feb 4, 2011
1 parent 1a93187 commit c343650
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Makefile
@@ -1,15 +1,12 @@
all: zipfile.node

install:
cd deps/libzip-0.9.3; make; cd ../../
node-waf -v build install

zipfile.node:
cd deps/libzip-0.9.3; make; cd ../../
node-waf -v build

clean:
cd deps/libzip-0.9.3; make clean distclean; cd ../../
node-waf -v clean distclean

uninstall:
Expand Down
8 changes: 0 additions & 8 deletions configure
@@ -1,11 +1,3 @@
#!/bin/sh

cd deps/
# internal libzip
if ! test -e libzip-0.9.3; then
tar xvf libzip-0.9.3.tar.bz2
fi
cd libzip-0.9.3
CFLAGS='-fPIC' ./configure --disable-dependency-tracking --enable-static --disable-shared
cd ../../
node-waf configure $@
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name" : "zipfile",
"version" : "0.1.4",
"version" : "0.1.5",
"main" : "./lib/index.js",
"description" : "C++ library for handling zipfiles in node",
"keywords" : ["zipfile", "uncompress", "unzip", "zlib"],
Expand Down
2 changes: 1 addition & 1 deletion src/_zipfile.cc
Expand Up @@ -19,7 +19,7 @@ extern "C" {
ZipFile::Initialize(target);

// node-zipfile version
target->Set(String::NewSymbol("version"), String::New("0.1.4"));
target->Set(String::NewSymbol("version"), String::New("0.1.5"));

// versions of deps
Local<Object> versions = Object::New();
Expand Down
25 changes: 25 additions & 0 deletions wscript
Expand Up @@ -34,9 +34,20 @@ def set_options(opt):
, dest='shared_libzip'
)

def configure_libzip():
if not Options.options.shared_libzip:
Utils.pprint('GREEN','configuring internal libzip dep')
os.chdir('deps')
if not os.path.exists('libzip-0.9.3'):
os.system('tar xvf libzip-0.9.3.tar.bz2')
os.chdir('libzip-0.9.3')
os.system("CFLAGS='-fPIC' ./configure --disable-dependency-tracking --enable-static --disable-shared")
os.chdir('../../')

def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
configure_libzip()

libzip_includes = []
libzip_libpath = []
Expand Down Expand Up @@ -119,8 +130,15 @@ def configure(conf):
#ldflags = []
#conf.env.append_value("LDFLAGS", ldflags)

def build_libzip():
if not Options.options.shared_libzip:
os.chdir('deps/libzip-0.9.3')
os.system('make')
os.chdir('../../')

def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon", install_path=None)
build_libzip()
obj.cxxflags = ["-DNDEBUG", "-O3", "-g", "-Wall", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"]
obj.target = TARGET
obj.source = "src/_zipfile.cc"
Expand All @@ -133,9 +151,16 @@ def build(bld):
bin_dir = bld.path.find_dir('./bin')
bld.install_files('${PREFIX}/bin', bin_dir.ant_glob('*'), cwd=bin_dir, relative_trick=True, chmod=0755)

def clean_libzip():
if not Options.options.shared_libzip:
os.chdir('deps/libzip-0.9.3')
os.system('make clean distclean')
os.chdir('../../')

def shutdown():
if Options.commands['clean']:
if exists(TARGET): unlink(TARGET)
clean_libzip()
if Options.commands['clean']:
if exists(dest):
unlink(dest)
Expand Down

0 comments on commit c343650

Please sign in to comment.