Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Say goodbye to the old node-waf wscript.

  • Loading branch information...
commit 9bbf8a5495cc0973398f8f343a087239e0c43262 1 parent e14a812
@samcday samcday authored
Showing with 0 additions and 83 deletions.
  1. +0 −83 wscript
View
83 wscript
@@ -1,83 +0,0 @@
-import Options
-import os
-from subprocess import Popen
-from os.path import exists, abspath
-
-srcdir = '.'
-blddir = 'build'
-VERSION = '0.0.1'
-
-def set_options(opt):
- opt.tool_options('compiler_cxx')
-
- opt.add_option("--debug",
- action = "store_true",
- default = False,
- help = "Compile gitteh and libgit2 (if using bundled version) with debug flags.")
-
- opt.add_option("--use-bundled-libgit2",
- action = "store_true",
- default = False,
- help = "Don't use libgit2 installed on system, configure and compile an internal copy instead.")
-
-def configure_libgit2(ctx):
- o = Options.options
-
- if o.use_bundled_libgit2 or not ctx.check(lib = "git2", uselib_store = "GIT2"):
- # Checkout libgit2 submodule if it isn't already.
- if exists(".git"):
- if not exists("vendor/libgit2") or not os.listdir("vendor/libgit2"):
- print "Checking out libgit2 submodule."
- if Popen("{0} submodule update --init".format(ctx.env.GIT), shell = True).wait() != 0:
- ctx.fatal("Couldn't initialize libgit2 submodule.")
-
- print "Configuring libgit2..."
- command = "./waf configure"
-
- if(o.debug):
- command = command + " --debug"
-
- if Popen(command, shell = True, cwd = "vendor/libgit2").wait() != 0:
- ctx.fatal("Libgit2 failed to configure.")
-
- ctx.env.LIBPATH_GIT2 = abspath("vendor/libgit2/build/shared")
- ctx.env.LIB_GIT2 = "git2"
- ctx.env.RPATH_GIT2 = abspath("vendor/libgit2/build/shared")
- ctx.env.internalLibgit2 = True
-
- ctx.env.append_value("CPPPATH_GIT2", [abspath("vendor/libgit2/include")])
-
- else:
- ctx.env.internalLibgit2 = False
-
-def build_libgit2(bld):
- if Popen("./waf build", cwd = "vendor/libgit2", shell = True).wait() != 0:
- # TODO: is there some way of crashing out with an error message from build
- # context?
- #bld.fatal("Errors building libgit2.")
- pass
-
-def clean_libgit2(bld):
- Popen("./waf clean", cwd = "vendor/libgit2", shell = True).wait()
-
-def configure(ctx):
- ctx.check_tool('compiler_cxx')
- ctx.check_tool('node_addon')
-
- o = Options.options
-
- ctx.find_program("git", var="GIT", mandatory = True)
-
- configure_libgit2(ctx)
-
- if o.debug:
- ctx.env.append_value("CXXFLAGS", ["-ggdb", "-O0", "-Wall"])
-
-def build(ctx):
- if(ctx.env.internalLibgit2):
- build_libgit2(ctx)
-
- obj = ctx.new_task_gen('cxx', 'shlib', 'node_addon')
- obj.target = 'gitteh'
- obj.source = 'src/gitteh.cc src/commit.cc src/tree.cc src/repository.cc src/index.cc src/index_entry.cc src/tag.cc src/rev_walker.cc src/ref.cc src/blob.cc'
- obj.uselib = 'GIT2'
Please sign in to comment.
Something went wrong with that request. Please try again.