Пример #1
0
def build(m, bld_bat):
    env = dict(os.environ)
    env.update(environ.get_dict(m))
    env = environ.prepend_bin_path(env, config.build_prefix, True)

    for name in 'BIN', 'INC', 'LIB':
        path = env['LIBRARY_' + name]
        if not isdir(path):
            os.makedirs(path)

    src_dir = source.get_dir()
    if exists(bld_bat):
        with open(bld_bat) as fi:
            data = fi.read()
        with open(join(src_dir, 'bld.bat'), 'w') as fo:
            fo.write(
                msvc_env_cmd(
                    override=m.get_value('build/msvc_compiler', None)))
            fo.write('\n')
            # more debuggable with echo on
            fo.write('@echo on\n')
            fo.write("set INCLUDE={};%INCLUDE%\n".format(env["LIBRARY_INC"]))
            fo.write("set LIB={};%LIB%\n".format(env["LIBRARY_LIB"]))
            fo.write("REM ===== end generated header =====\n")
            fo.write(data)

        cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']
        _check_call(cmd,
                    cwd=src_dir,
                    env={str(k): str(v)
                         for k, v in env.items()})
        kill_processes()
        fix_staged_scripts()
Пример #2
0
def build(m, bld_bat, dirty=False):
    env = dict(os.environ)
    env.update(environ.get_dict(m, dirty=dirty))
    env = environ.prepend_bin_path(env, config.build_prefix, True)

    for name in 'BIN', 'INC', 'LIB':
        path = env['LIBRARY_' + name]
        if not isdir(path):
            os.makedirs(path)

    src_dir = source.get_dir()
    if os.path.isfile(bld_bat):
        with open(bld_bat) as fi:
            data = fi.read()
        with open(join(src_dir, 'bld.bat'), 'w') as fo:
            # more debuggable with echo on
            fo.write('@echo on\n')
            for key, value in env.items():
                fo.write('set "{key}={value}"\n'.format(key=key, value=value))
            fo.write("set INCLUDE={};%INCLUDE%\n".format(env["LIBRARY_INC"]))
            fo.write("set LIB={};%LIB%\n".format(env["LIBRARY_LIB"]))
            fo.write(msvc_env_cmd(bits=cc.bits, override=m.get_value('build/msvc_compiler', None)))
            fo.write('\n')
            fo.write("REM ===== end generated header =====\n")
            fo.write(data)

        cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']
        _check_call(cmd, cwd=src_dir)
        kill_processes()
        fix_staged_scripts()
Пример #3
0
def build(m):
    env = dict(os.environ)
    env.update(environ.get_dict(m))
    env = environ.prepend_bin_path(env, config.build_prefix, True)

    for name in 'BIN', 'INC', 'LIB':
        path = env['LIBRARY_' + name]
        if not isdir(path):
            os.makedirs(path)

    src_dir = source.get_dir()
    bld_bat = join(m.path, 'bld.bat')
    if exists(bld_bat):
        with open(bld_bat) as fi:
            data = fi.read()
        with open(join(src_dir, 'bld.bat'), 'w') as fo:
            fo.write(msvc_env_cmd(override=m.get_value('build/msvc_compiler', None)))
            fo.write('\n')
            # more debuggable with echo on
            fo.write('@echo on\n')
            fo.write("set INCLUDE={};%INCLUDE%\n".format(env["LIBRARY_INC"]))
            fo.write("set LIB={};%LIB%\n".format(env["LIBRARY_LIB"]))
            fo.write("REM ===== end generated header =====\n")
            fo.write(data)

        cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']
        _check_call(cmd, cwd=src_dir, env={str(k): str(v) for k, v in env.items()})
        kill_processes()
        fix_staged_scripts()
def build(m, bld_bat):
    env = dict(os.environ)
    env.update(environ.get_dict(m))
    env = environ.prepend_bin_path(env, config.build_prefix, True)

    for name in "BIN", "INC", "LIB":
        path = env["LIBRARY_" + name]
        if not isdir(path):
            os.makedirs(path)

    src_dir = source.get_dir()
    if os.path.isfile(bld_bat):
        with open(bld_bat) as fi:
            data = fi.read()
        with open(join(src_dir, "bld.bat"), "w") as fo:
            # more debuggable with echo on
            fo.write("@echo on\n")
            for key, value in env.items():
                fo.write('set "{key}={value}"\n'.format(key=key, value=value))
            fo.write("set INCLUDE={};%INCLUDE%\n".format(env["LIBRARY_INC"]))
            fo.write("set LIB={};%LIB%\n".format(env["LIBRARY_LIB"]))
            fo.write(msvc_env_cmd(bits=cc.bits, override=m.get_value("build/msvc_compiler", None)))
            fo.write("\n")
            fo.write("REM ===== end generated header =====\n")
            fo.write(data)

        cmd = [os.environ["COMSPEC"], "/c", "call", "bld.bat"]
        _check_call(cmd, cwd=src_dir)
        kill_processes()
        fix_staged_scripts()
Пример #5
0
def windows_build(m):
    from conda_build.windows import msvc_env_cmd, kill_processes

    env = dict(os.environ)
    env.update(environ.get_dict(m))
    env = environ.prepend_bin_path(env, config.build_prefix, True)

    for name in 'BIN', 'INC', 'LIB':
        path = env['LIBRARY_' + name]
        if not isdir(path):
            os.makedirs(path)

    src_dir = source.get_dir()
    bld_bat = join(m.path, 'bld_wheel.bat')
    if exists(bld_bat):
        with open(bld_bat) as fi:
            data = fi.read()
    else:
        print("Using plain 'python setup.py bdist_wheel'  as build script")
        data = "\n:: Autogenerated build command:\npython setup.py bdist_wheel\n"

    with open(join(src_dir, 'bld.bat'), 'w') as fo:
        fo.write('@echo on\n')
        fo.write(
            msvc_env_cmd(override=m.get_value('build/msvc_compiler', None)))
        fo.write('\n')
        # more debuggable with echo on
        fo.write('set\n')
        fo.write('where python\n')
        fo.write('@echo on\n')
        fo.write("set INCLUDE={};%INCLUDE%\n".format(env["LIBRARY_INC"]))
        fo.write("set LIB={};%LIB%\n".format(env["LIBRARY_LIB"]))
        fo.write("REM ===== end generated header =====\n")
        fo.write(data)

    cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']
    print("build cmd: %s" % cmd)
    _check_call(cmd, cwd=src_dir, env={str(k): str(v) for k, v in env.items()})
    kill_processes()
Пример #6
0
def windows_build(m):
    from conda_build.windows import msvc_env_cmd, kill_processes

    env = dict(os.environ)
    env.update(environ.get_dict(m))
    env = environ.prepend_bin_path(env, config.build_prefix, True)

    for name in 'BIN', 'INC', 'LIB':
        path = env['LIBRARY_' + name]
        if not isdir(path):
            os.makedirs(path)

    src_dir = source.get_dir()
    bld_bat = join(m.path, 'bld_wheel.bat')
    if exists(bld_bat):
        with open(bld_bat) as fi:
            data = fi.read()
    else:
        print("Using plain 'python setup.py bdist_wheel'  as build script")
        data = "\n:: Autogenerated build command:\npython setup.py bdist_wheel\n"

    with open(join(src_dir, 'bld.bat'), 'w') as fo:
        fo.write('@echo on\n')
        fo.write(msvc_env_cmd(override=m.get_value('build/msvc_compiler', None)))
        fo.write('\n')
        # more debuggable with echo on
        fo.write('set\n')
        fo.write('where python\n')
        fo.write('@echo on\n')
        fo.write("set INCLUDE={};%INCLUDE%\n".format(env["LIBRARY_INC"]))
        fo.write("set LIB={};%LIB%\n".format(env["LIBRARY_LIB"]))
        fo.write("REM ===== end generated header =====\n")
        fo.write(data)

    cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']
    print("build cmd: %s" % cmd)
    _check_call(cmd, cwd=src_dir, env={str(k): str(v) for k, v in env.items()})
    kill_processes()