Exemple #1
0
def build_a(ctx):
  pkg = ctx['pkg']
  assert any([ctx['interface', ifc] == pkg for ifc in interfaces])
  psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
  env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

  try:
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
  
    to = yield async.WaitFor(ctx.outfile_a('build', pkg))
    to = os.path.abspath(to)
    os.mkdir(to)

    cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
    c = Cmd(ctx, **cmdkws)
    bootstrap = ('bash', 'bootstrap') if os.name == 'nt' else './bootstrap'
    c.lit(bootstrap, '--prefix=' + to)
    yield async.WaitFor(c.exec_a())

    c = Cmd(ctx, **cmdkws)
    c.lit(conf.make)
    yield async.WaitFor(c.exec_a())

    c = Cmd(ctx, **cmdkws)
    c.lit(conf.make_install)
    yield async.WaitFor(c.exec_a())
  finally:
    cleanup()

  delivs = {'root': to, 'libs': set('z'), 'pkg': pkg}
  yield async.Result(delivs)
Exemple #2
0
def build_a(ctx):
    pkg = ctx['pkg']
    cythonize = (ctx['interface', 'sympy-cython'] == pkg)
    psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
    env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

    try:
        src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
        cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
        to = yield async.WaitFor(ctx.outfile_a('build', pkg))
        to = os.path.abspath(to)
        os.mkdir(to)

        c = bake.Cmd(ctx, **cmdkws)
        c.lit('python', 'setup.py', 'install', '--prefix=' + to)
        yield async.WaitFor(c.exec_a())

        if cythonize:
            c = bake.Cmd(ctx, **cmdkws)
            c.lit('python', 'build.py', 'install', '--prefix=' + to)
            yield async.WaitFor(c.exec_a())
    finally:
        cleanup()
  
    delivs = {'root': to, 'pkg': pkg}
    yield async.Result(delivs)
Exemple #3
0
def build_a(ctx):
  pkg = ctx['pkg']
  assert any([ctx['interface', ifc] == pkg for ifc in interfaces])
  psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
  env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

  try:
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
    srcbld = os.path.join(src, 'build')
    os.mkdir(srcbld)
    cmdkws = {'cwd': srcbld, 'tag': pkg, 'env': env}
    to = yield async.WaitFor(ctx.outfile_a('build', pkg))
    to = os.path.abspath(to)
    os.mkdir(to)

    c = Cmd(ctx, **cmdkws)
    c.lit('cmake', '-DCMAKE_INSTALL_PREFIX:PATH=' + to, 
          '-DLAPACKE:BOOL=ON', '-DBUILD_SHARED_LIBS:BOOL=ON', '..')
    yield async.WaitFor(c.exec_a())

    c = Cmd(ctx, **cmdkws)
    c.lit(conf.make)
    yield async.WaitFor(c.exec_a())

    c = Cmd(ctx, **cmdkws)
    c.lit(conf.make_install)
    yield async.WaitFor(c.exec_a())
  finally:
    cleanup()

  delivs = {'root': to, 'libs': set('z'), 'pkg': pkg}
  yield async.Result(delivs)
Exemple #4
0
def build_a(ctx):
    pkg = ctx["pkg"]
    assert any([ctx["interface", ifc] == pkg for ifc in interfaces])
    cpp = ctx["interface", "hdf5-cpp"] == pkg
    parl = ctx["interface", "hdf5-parallel"] == pkg
    psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
    env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

    try:
        src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
        cmdkws = {"cwd": src, "tag": pkg, "env": env}
        to = yield async.WaitFor(ctx.outfile_a("build", pkg))
        to = os.path.abspath(to)
        os.mkdir(to)

        if os.name == "nt":
            srcbld = os.path.join(src, "build")
            os.mkdir(srcbld)
            cmdkws["cwd"] = srcbld
            c = Cmd(ctx, **cmdkws)
            c.lit(
                "cmake",
                "-C",
                "../config/cmake/cacheinit.cmake",
                "-G",
                "MSYS Makefiles",
                "-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF",
                "-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON",
                "-DCMAKE_INSTALL_PREFIX:PATH=" + to,
            )
            if parl:
                c.lit("-DHDF5_ENABLE_PARALLEL:BOOL=ON")
            c.lit("..")
            yield async.WaitFor(c.exec_a())
        else:
            c = Cmd(ctx, **cmdkws)
            c.lit("./configure", "--prefix=" + to)
            if parl:
                c.lit("--enable-parallel")
            yield async.WaitFor(c.exec_a())

        c = Cmd(ctx, **cmdkws)
        c.lit(conf.make)
        yield async.WaitFor(c.exec_a())

        c = Cmd(ctx, **cmdkws)
        c.lit(conf.make_install)
        yield async.WaitFor(c.exec_a())
    finally:
        cleanup()

    libs = set(("hdf5", "hdf5_hl"))
    if cpp:
        libs |= set(("hdf5_cpp", "hdf5_hl_cpp"))
    delivs = {"root": to, "libs": libs, "pkg": pkg}
    yield async.Result(delivs)
Exemple #5
0
def build_a(ctx):
  pkg = ctx['pkg']
  assert any([ctx['interface', ifc] == pkg for ifc in interfaces])
  psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
  env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

  try:
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
  
    to = yield async.WaitFor(ctx.outfile_a('build', pkg))
    to = os.path.abspath(to)
    os.mkdir(to)

    cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
    if os.name == 'nt':
      c = Cmd(ctx, **cmdkws)
      c.lit(conf.make, '-f', 'win32/Makefile.gcc')
      yield async.WaitFor(c.exec_a())

      # NOTE: not BINARY_PATH != 'bin' to replicate unix install behaviour
      cmdkws['env']['BINARY_PATH'] = os.path.join(to, 'lib')
      cmdkws['env']['INCLUDE_PATH'] = os.path.join(to, 'include')
      cmdkws['env']['LIBRARY_PATH'] = os.path.join(to, 'lib')
      c = Cmd(ctx, **cmdkws)
      c.lit(conf.make_install, '-f', 'win32/Makefile.gcc', 'SHARED_MODE=1')
      yield async.WaitFor(c.exec_a())
      shutil.copy(os.path.join(to, 'lib', 'zlib1.dll'), 
                  os.path.join(to, 'lib', 'libz.dll'))
    else:
      c = Cmd(ctx, **cmdkws)
      c.lit('./configure', '--prefix=' + to)
      yield async.WaitFor(c.exec_a())

      c = Cmd(ctx, **cmdkws)
      c.lit(conf.make)
      yield async.WaitFor(c.exec_a())

      c = Cmd(ctx, **cmdkws)
      c.lit(conf.make_install)
      yield async.WaitFor(c.exec_a())
  finally:
    cleanup()

  delivs = {'root': to, 'libs': set('z'), 'pkg': pkg}
  yield async.Result(delivs)