Exemplo n.º 1
0
import os
from fief import ifc, async, bake

interfaces = {'numpy': ifc(requires=('atlas', 'py'))}

def build_a(ctx):
    pkg = ctx['pkg']
    env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
  
    to = yield async.WaitFor(ctx.outfile_a('build'))
    to = os.path.abspath(to)
    os.mkdir(to)
  
    c = bake.Cmd(ctx)
    c.cwd = src
    c.env = env
    c.lit('python', 'setup.py', 'install', '--prefix=' + to)
    yield async.WaitFor(c.exec_a())
  
    cleanup()

    delivs = {'root': to, 'pkg': pkg}
    yield async.Result(delivs)  
Exemplo n.º 2
0
import os
from glob import glob
from fief import ifc, easy, async, Cmd, EnvDelta, configure_make_make_install, \
    c_envdelta, find_libs

interfaces = {'boost': ifc(requires='cc')}

deliverable_envdelta = c_envdelta

deliverable_libs = find_libs

def build_a(ctx, pkg, src, opts):
  root = yield async.Sync(ctx.outfile_a(os.path.join('build', pkg)))
  root = os.path.abspath(root)
  os.mkdir(root)

  env = easy.gather_env(ctx, interfaces)
  cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
  
  c = Cmd(ctx, **cmdkws)
  if os.name == 'nt':
    c.lit('bootstap.bat', '--prefix=' + root)
  else:
    c.lit('./bootstrap.sh', '--prefix=' + root)
  yield async.Sync(c.exec_a())

  c = Cmd(ctx, **cmdkws)
  c.lit('./b2', 'install')
  yield async.Sync(c.exec_a())

  built = {'root': root, 'pkg': pkg}
Exemplo n.º 3
0
import os
from glob import glob
from fief import ifc, easy, async, Cmd, EnvDelta

interfaces = {'libxml2': ifc(requires='cc')}

def deliverable_envdelta(built):
  root = built['root']
  sets={
    'PATH': [os.path.join(root, 'bin')],
    'LD_LIBRARY_PATH': [os.path.join(root, 'lib')],
    'INCLUDE_PATH': [os.path.join(root, 'include')],
    }
  pypath = glob(os.path.join(root, '*',  'site-packages')) + \
           glob(os.path.join(root, '*', '*',  'site-packages'))
  if 0 < len(pypath):
    sets['PYTHONPATH'] = set(pypath)
  return EnvDelta(sets=sets)

def deliverable_libs(built):
  return set(['xml2'])


def build_a(ctx, pkg, src, opts):
  root = yield async.Sync(ctx.outfile_a(os.path.join('build', pkg)))
  root = os.path.abspath(root)
  os.mkdir(root)

  env = easy.gather_env(ctx, interfaces)
  cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
Exemplo n.º 4
0
import os
from fief import async
from fief import repository
from fief import ifc, Cmd

interfaces = {'lapack': ifc(requires=('cc', 'cmake', 'fortran'))}

def realize(delivs):
  root = delivs['root']
  return {'LD_LIBRARY_PATH': os.path.join(root, 'lib'), 
          'C_INCLUDE_PATH': os.path.join(root, 'include'),}

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())
Exemplo n.º 5
0
from fief import ifc, configure_make_make_install, c_envdelta, find_libs

interfaces = {'glibmm': ifc()}

deliverable_envdelta = c_envdelta

deliverable_libs = find_libs

build_a = configure_make_make_install(interfaces)
Exemplo n.º 6
0
import os
from glob import glob
from fief import ifc, easy, async, Cmd, EnvDelta, configure_make_make_install, c_envdelta, find_libs

interfaces = {"sqlite": ifc(requires="cc")}

deliverable_envdelta = c_envdelta

deliverable_libs = find_libs

build_a = configure_make_make_install(interfaces)
Exemplo n.º 7
0
import os
from glob import glob
from fief import ifc, async, bake

interfaces = {'sympy': ifc(requires='py'), 
              'sympy-cython': ifc(subsumes='sympy', requires='cython')}

#realize = repo.py_realize

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:
Exemplo n.º 8
0
from fief import ifc

interfaces = {'atlas': ifc(requires='cc')}

#realize = repo.c_realize

#build_a = repo.configure_make_make_install(interfaces, libs='atlas', 
#                                           configure_args='--shared')

Exemplo n.º 9
0
from fief import ifc

interfaces = {'cython': ifc(requires=('cc', 'py'))}

#realize = repo.py_realize

#build_a = repo.python_setup_install(interfaces)
Exemplo n.º 10
0
import os
from glob import glob
from fief import ifc, easy, async, Cmd, EnvDelta, configure_make_make_install, \
    c_envdelta, find_libs

interfaces = {'libxml++': ifc(requires=['libxml2', 'glibmm'])}

deliverable_envdelta = c_envdelta

deliverable_libs = find_libs

build_a = configure_make_make_install(interfaces)