示例#1
0
def run_sip_install(for_webengine=False):
    qt_bin = f'{PREFIX}/qt/bin'
    qmake = 'qmake' + ('.exe' if iswindows else '')
    args = ('--no-docstrings --no-make'
            f' --qmake={qt_bin}/{qmake} --concatenate=5 --verbose').split()
    if iswindows:
        args.append('--link-full-dll')
    if for_webengine:
        args.extend('--disable QtWebEngineQuick'.split())
    else:
        args.extend('--qt-shared --confirm-license --no-designer-plugin'
                    ' --no-qml-plugin'.split())
    run(f'{PREFIX}/bin/sip-build', *args, library_path=True)
    if iswindows:
        # disable distinfo as installing it fails when using INSTALL_ROOT
        replace_in_file('build/Makefile', 'install_distinfo ', ' ')
        run(NMAKE, cwd='build')
        run(NMAKE,
            'install',
            cwd='build',
            env={'INSTALL_ROOT': build_dir()[2:]})
    else:
        run('make ' + MAKEOPTS, cwd='build')
        run(f'make INSTALL_ROOT="{build_dir()}" install',
            cwd='build',
            library_path=True)
    python_install()
示例#2
0
def main(args):
    python_build()
    for f in walk(build_dir()):
        if os.path.basename(f) == 'c_ppmd.py':
            q = os.path.join(os.path.dirname(f), '__init__.py')
            if not os.path.exists(q):
                open(q, 'w').close()
            break
    python_install()
示例#3
0
def main(args):
    env = {}
    p = PREFIX.replace(os.sep, '/')
    env = dict(
        UNRAR_INCLUDE='{}/include'.format(p),
        UNRAR_LIBDIRS='{0}/lib'.format(p),
    )
    with ModifiedEnv(**env):
        python_build()
    python_install()
示例#4
0
def main(args):
    env = {}
    p = PREFIX.replace(os.sep, '/')
    env = dict(
        LIBXML_INCLUDE_DIRS='{0}/include{1}{0}/include/libxml2'.format(p, os.pathsep),
        LIBXML_LIB_DIRS='{0}/lib'.format(p),
        LIBXML_LIBS='libxml2' if iswindows else 'xml2',
    )
    with ModifiedEnv(**env):
        python_build()
    python_install()
示例#5
0
def main(args):
    env = {}
    p = PREFIX.replace(os.sep, '/')
    env = dict(
        UNRAR_INCLUDE='{}/include'.format(p),
        UNRAR_LIBDIRS='{0}/lib'.format(p),
    )
    if iswindows:
        replace_in_file('src/unrardll/wrapper.cpp', ' ssize_t written',
                        ' Py_ssize_t written')
    with ModifiedEnv(**env):
        python_build()
    python_install()
示例#6
0
 def main(args):
     p = PREFIX.replace('\\', '/')
     shutil.copy(os.path.join(PREFIX, 'src', 'chm_lib.c'), 'chm')
     shutil.copy(os.path.join(PREFIX, 'src', 'lzx.c'), 'chm')
     shutil.copy(os.path.join(PREFIX, 'src', 'lzx.h'), 'chm')
     shutil.copy(os.path.join(PREFIX, 'include', 'chm_lib.h'), 'chm')
     replace_in_file('setup.py', 'search.c"',
                     'search.c", "chm/chm_lib.c", "chm/lzx.c"')
     replace_in_file(
         'setup.py', 'libraries=["chm"]', f'include_dirs=["{p}/include"],'
         'define_macros=[("strcasecmp", "_stricmp"),'
         '("strncasecmp", "_strnicmp"), ("WIN32", "1")],')
     python_build()
     python_install()
示例#7
0
文件: apsw.py 项目: sudodave/bypy
def main(args):
    if iswindows:
        run(PYTHON, 'setup.py', 'fetch', '--all', '--missing-checksum-ok',
            'build', '--enable-all-extensions', 'install', '--root',
            build_dir())
    else:
        run(PYTHON,
            'setup.py',
            'build',
            'install',
            '--root',
            build_dir(),
            library_path=True)
    python_install()
示例#8
0
文件: lxml.py 项目: sudodave/bypy
def main(args):
    if iswindows:
        # libxml2 does not depend on iconv in our windows build
        replace_in_file('setupinfo.py', ", 'iconv'", '')
        run(
            PYTHON,
            *('setup.py build_ext -I {0}/include;{0}/include/libxml2 -L {0}/lib'
              .format(PREFIX.replace(os.sep, '/')).split()))
    else:
        run(PYTHON,
            *('setup.py build_ext -I {0}/include/libxml2 -L {0}/lib'.format(
                PREFIX).split()),
            library_path=True)
    python_build()
    python_install()
示例#9
0
    def main(args):
        root = (
            os.path.join(PREFIX, 'lib').replace('\\', '/'),
            os.path.join(PREFIX, 'include').replace('\\', '/')
        )
        replace_in_file(
            'setup.py',
            re.compile(r'^(JPEG|ZLIB|FREETYPE)_ROOT = None', re.M),
            fr'\1_ROOT = {root}')
        # dont link against static zlib
        replace_in_file(
            'setup.py', 'feature.zlib = "zlib"', 'feature.zlib = "zdll"')

        python_build()
        python_install()
示例#10
0
 def main(args):
     replace_in_file('setup.py', '2019', '2020')
     run(PYTHON, 'setup.py', 'fetch', '--all', '--missing-checksum-ok',
         'build', 'install', '--root', build_dir())
     python_install()
示例#11
0
文件: sip.py 项目: sudodave/bypy
def main(args):
    python_build()
    python_install(add_scripts=True)