示例#1
0
文件: poppler.py 项目: sudodave/bypy
def main(args):
    cmake_args = dict(ENABLE_CPP='0',
                      ENABLE_GLIB='OFF',
                      ENABLE_GOBJECT_INTROSPECTION='OFF',
                      ENABLE_CMS='none',
                      ENABLE_QT5='OFF',
                      ENABLE_LIBCURL='OFF',
                      BUILD_GTK_TESTS='OFF',
                      BUILD_QT5_TESTS='OFF',
                      BUILD_CPP_TESTS='OFF')
    # poppler unconditionally searches for cairo which we dont want
    replace_in_file('CMakeLists.txt',
                    'macro_optional_find_package(Cairo ${CAIRO_VERSION})',
                    'set(CAIRO_FOUND false)')
    if ismacos:
        replace_in_file('CMakeLists.txt', 'macro_optional_find_package(NSS3)',
                        'set(NSS3_FOUND false)')
    if iswindows:
        opjinc = f'{PREFIX}/include/openjpeg'.replace('\\', '/')
        opjlib = f'{PREFIX}/lib/openjp2.lib'.replace('\\', '/')
        replace_in_file(
            'CMakeLists.txt', 'find_package(OpenJPEG)',
            'set(OpenJPEG_FOUND true)\n'
            'set(OPENJPEG_MAJOR_VERSION 2)\n'
            f'set(OPENJPEG_INCLUDE_DIRS {opjinc})\n')
        replace_in_file('CMakeLists.txt',
                        'set(poppler_LIBS ${poppler_LIBS} openjp2)',
                        'set(poppler_LIBS ${poppler_LIBS} %s)' % opjlib)
        windows_cmake_build(**cmake_args)
        install_binaries('build/utils/*.exe', 'bin')
    else:
        cmake_build(**cmake_args)
示例#2
0
def main(args):
    if iswindows:
        for f in ('./devel/ftoption.h ./include/freetype/config/ftoption.h'.
                  split()):
            replace_in_file(
                f,
                'FT_BEGIN_HEADER',
                'FT_BEGIN_HEADER\n#define FT_EXPORT(x) __declspec(dllexport) x\n#define FT_EXPORT_DEF(x) __declspec(dllexport) x\n'  # noqa
            )

        def build(static=False):
            conf = 'Release'
            if static:
                conf += ' Static'
            msbuild('builds/windows/vc2010/freetype.sln', configuration=conf)

        # Build the static library
        # build(static=True)
        # install_binaries('objs/freetype.lib')
        # Build the dynamic library
        build()
        install_binaries('objs/freetype.dll', 'bin')
        install_binaries('objs/*/Release/*.lib')
        for f in glob.glob('objs/vc2010/*/freetype*MT.lib'):
            shutil.copy2(f, os.path.join(build_dir(), 'lib', 'freetype.lib'))
        shutil.copytree('include',
                        os.path.join(build_dir(), 'include', 'freetype2'))
        shutil.rmtree(
            os.path.join(build_dir(), 'include', 'freetype2', 'freetype',
                         'internal'))
    else:
        simple_build('--disable-dependency-tracking --disable-static')
示例#3
0
def main(args):
    apply_patch('chmlib-empty-file-not-dir.patch',
                level=1)  # needed for aarch64
    if iswindows:
        os.chdir('src')
        for f in 'chm_lib.c lzx.c'.split():
            copy_headers(f, 'src')
            run(f'"{CL}" /c /nologo /MD /W3 /DWIN32 -c ' + f)
        run(f'"{LIB}" -nologo chm_lib.obj lzx.obj -OUT:chmlib.lib')
        install_binaries('chmlib.lib')
        copy_headers('chm_lib.h')
        copy_headers('lzx.h', 'src')
    else:
        # test for malloc breaks on macos universal.
        # All system we care about have malloc anyway
        replace_in_file('configure',
                        'if test $ac_cv_func_malloc_0_nonnull = yes; then',
                        'if test 1; then')
        replace_in_file('src/chm_lib.c', 'pread64', 'pread')
        apply_patch('chmlib-integer-types.patch',
                    level=1)  # needed for aarch64
        # updated config.guess is needed for aarch64
        with open('config.guess',
                  'wb') as dest, open(os.path.join(PATCHES, 'config.guess'),
                                      'rb') as src:
            dest.write(src.read())
        if ismacos and is_arm_half_of_lipo_build():
            with open('config.sub', 'w') as dest:
                dest.write('echo arm-apple-darwin')
        conf = '--disable-dependency-tracking'
        if ismacos:
            conf += ' --disable-pread --disable-io64'
        simple_build(conf)
示例#4
0
def main(args):
    if iswindows:
        run(*('cscript.exe configure.js include={0}/include'
              ' include={0}/include/libxml2 lib={0}/lib prefix={0}'
              ' zlib=yes iconv=no'.format(PREFIX.replace(os.sep,
                                                         '/')).split()),
            cwd='win32')
        for f in walk('.'):
            bname = os.path.basename(f)
            if bname.startswith('Makefile'):
                replace_in_file(f, '/OPT:NOWIN98', '', missing_ok=True)
            elif bname == 'xsltconfig.h':
                replace_in_file(f, '@WITH_PROFILER@', '1')
        run(f'"{NMAKE}" /f Makefile.msvc', cwd='win32')
        install_tree('libxslt', 'include')
        install_tree('libexslt', 'include')
        for f in walk('.'):
            if f.endswith('.dll'):
                install_binaries(f, 'bin')
            elif f.endswith('.lib'):
                install_binaries(f)
    else:
        env = {}
        if ismacos:
            env['PATH'] = BIN + os.pathsep + os.environ['PATH']
        with ModifiedEnv(**env):
            simple_build('--disable-dependency-tracking --disable-static'
                         ' --enable-shared --without-python --without-debug')
示例#5
0
def main(args):
    # various cherry picks from HEAD that fix regression in the latest release
    apply_patches('libxml2' + os.sep)
    if iswindows:
        run(*('cscript.exe configure.js include={0}/include'
              ' lib={0}/lib prefix={0} zlib=yes iconv=yes'.format(
                  PREFIX.replace(os.sep, '/')).split()),
            cwd='win32')
        replace_in_file('win32/Makefile.msvc', 'iconv.lib', 'libiconv.lib')
        run(f'"{NMAKE}" /f Makefile.msvc', cwd='win32')
        install_tree('include/libxml', 'include/libxml2')
        for f in walk('.'):
            if f.endswith('.dll'):
                install_binaries(f, 'bin')
            elif f.endswith('.lib'):
                install_binaries(f)
    else:
        # https://gitlab.gnome.org/GNOME/libxml2/-/issues/204
        replace_in_file('encoding.c', re.compile(r'\bTRUE\b'), '1')
        # ICU is needed to use libxml2 in qt-webengine
        simple_build(
            '--disable-dependency-tracking --disable-static --enable-shared'
            ' --without-python --without-debug --with-iconv={0}'
            ' --with-zlib={0} --with-icu'.format(PREFIX))
        for path in walk(build_dir()):
            if path.endswith('/xml2-config'):
                replace_in_file(path, re.compile(b'(?m)^prefix=.+'),
                                f'prefix={PREFIX}')
示例#6
0
def main(args):
    if iswindows:
        windows_cmake_build()
        install_binaries('build/jpegtran-static.exe',
                         'bin',
                         fname_map=lambda x: 'jpegtran-calibre.exe')
        install_binaries('build/cjpeg-static.exe',
                         'bin',
                         fname_map=lambda x: 'cjpeg-calibre.exe')
    else:
        env = {}
        if ismacos:
            env['PATH'] = BIN + os.pathsep + os.environ['PATH']
            env['LIBTOOLIZE'] = 'glibtoolize'
            env['LIBTOOL'] = 'glibtool'
        with ModifiedEnv(**env):
            run('autoreconf -fiv')
        conf = ('--disable-dependency-tracking --disable-shared --with-jpeg8'
                ' --without-turbojpeg')
        env = {}
        if ismacos:
            conf += f' --host x86_64-apple-darwin NASM={BIN}/nasm'
            replace_in_file(
                'configure',
                re.compile(br'^PKG_CHECK_MODULES.libpng.+?\bfi\b',
                           re.M | re.DOTALL),
                'HAVE_LIBPNG=1\nHAVE_LIBPNG_TRUE="#"\n')
        simple_build(conf,
                     override_prefix=os.path.join(build_dir(), 'private',
                                                  'mozjpeg'))
示例#7
0
文件: hunspell.py 项目: sudodave/bypy
def main(args):
    if iswindows:
        with current_dir('msvc'):
            msbuild('Hunspell.sln', configuration='Release_dll')
            dll = lib = False
            for f in walk('.'):
                if os.path.basename(f) == 'libhunspell.dll':
                    install_binaries(f, 'bin')
                    dll = True
                elif os.path.basename(f) == 'libhunspell.lib':
                    install_binaries(f, 'lib')
                    lib = True
            if not dll or not lib:
                raise Exception('Failed to find the hunspell dlls')
        # from bypy.utils import run_shell
        # run_shell()
        copy_headers('src/hunspell/*.hxx', destdir='include/hunspell')
        copy_headers('src/hunspell/*.h', destdir='include/hunspell')
        copy_headers('msvc/*.h', destdir='include/hunspell')
    else:
        env = {}
        if ismacos:
            env['PATH'] = BIN + os.pathsep + os.environ['PATH']
            env['LIBTOOLIZE'] = 'glibtoolize'
            env['LIBTOOL'] = 'glibtool'
        with ModifiedEnv(**env):
            run('autoreconf -fiv')
        conf = '--disable-dependency-tracking'
        env = {}
        if ismacos:
            conf += ' --host x86_64-apple-darwin'
        simple_build(conf)
示例#8
0
文件: python.py 项目: sudodave/bypy
def windows_python(args):
    with open('PCbuild/msbuild.rsp', 'w') as f:
        print(f'/p:PlatformToolset={get_platform_toolset()}', file=f)
        print(f'/p:WindowsTargetPlatformVersion={get_windows_sdk()}', file=f)

    # dont need python 3 to get externals, use git instead
    replace_in_file('PCbuild\\get_externals.bat',
                    re.compile(br'^call.+find_python.bat.+$', re.MULTILINE),
                    '')
    env = {}
    if is64bit:
        env['PROCESSOR_ARCHITECTURE'] = env['PROCESSOR_ARCHITEW6432'] = 'AMD64'
    try:
        run(
            'PCbuild\\build.bat', '-e', '--no-tkinter', '-c',
            'Release', '-m', '-p', ('x64' if is64bit else 'Win32'), '-v',
            '-t', 'Build',
            '--pgo',
            env=env
        )
        # Run the tests
        # run('PCbuild\\amd64\\python.exe', 'Lib/test/regrtest.py', '-u',
        #     'network,cpu,subprocess,urlfetch')

        # Do not read mimetypes from the registry
        replace_in_file(
            'Lib\\mimetypes.py',
            re.compile(br'try:.*?import\s+winreg.*?None', re.DOTALL),
            r'_winreg = None')

        bindir = 'PCbuild\\amd64' if is64bit else 'PCbuild\\win32'
        install_binaries(bindir + os.sep + '*.exe', 'private\\python')
        install_binaries(bindir + os.sep + 'python*.dll', 'private\\python')
        install_binaries(bindir + os.sep + '*.pyd', 'private\\python\\DLLs')
        install_binaries(bindir + os.sep + '*.dll', 'private\\python\\DLLs')
        for x in glob.glob(
                os.path.join(build_dir(),
                             'private\\python\\DLLs\\python*.dll')):
            os.remove(x)
        install_binaries(bindir + os.sep + '*.lib', 'private\\python\\libs')
        copy_headers('PC\\pyconfig.h', 'private\\python\\include')
        copy_headers('Include\\*.h', 'private\\python\\include')
        copy_headers('Include\\cpython', 'private\\python\\include')
        with open('Lib/sitecustomize.py', 'w') as f:
            f.write('''
import os
for path in ('{p}/bin', '{p}/qt/bin'):
    if os.path.exists(path):
        os.add_dll_directory(path)
'''.format(p=PREFIX.replace('\\', '/')))

        shutil.copytree('Lib', os.path.join(build_dir(),
                                            'private\\python\\Lib'))
    finally:
        # bloody git creates files with no write permission
        import stat
        for path in walk('externals'):
            os.chmod(path, stat.S_IWRITE)
            os.remove(path)
示例#9
0
def main(args):
    if iswindows:
        run(f'"{NMAKE}" -f build\\visualc.mk')
        install_binaries('src\\optipng\\optipng.exe',
                         'bin',
                         fname_map=lambda x: 'optipng-calibre.exe')
    else:
        simple_build('-with-system-libs', use_envvars_for_lipo=True)
示例#10
0
文件: openjpeg.py 项目: sudodave/bypy
def main(args):
    cmake_args = dict(BUILD_CODEC='OFF')
    if iswindows:
        windows_cmake_build(**cmake_args)
        install_binaries('build/bin/*.dll', 'bin')
        install_binaries('build/bin/*.lib', 'lib')
        copy_headers('src/lib/openjp2/opj_*.h', 'include/openjpeg')
        copy_headers('build/src/lib/openjp2/opj_*.h', 'include/openjpeg')
        copy_headers('src/lib/openjp2/openjpeg.h', 'include/openjpeg')
    else:
        cmake_build(**cmake_args)
示例#11
0
def main(args):
    if iswindows:
        run(f'"{NMAKE}" /f Makefile.vc CFG=release-dynamic'
            ' RTLIBCFG=dynamic OBJDIR=output')
        install_binaries('output/release-dynamic/*/bin/*.dll', 'bin')
        install_binaries('output/release-dynamic/*/lib/*.lib', 'lib')
        copy_headers('src/webp')
    else:
        # mux/demux are needed for webengine
        simple_build('--disable-dependency-tracking --disable-static'
                     ' --enable-libwebpmux --enable-libwebpdemux')
示例#12
0
def main(args):
    if iswindows:
        for f in 'hnjalloc.c hyphen.c'.split():
            run(f'"{CL}" /c /nologo /MD /W3 /DWIN32 -c ' + f)
        run(f'"{LIB}" -nologo hnjalloc.obj hyphen.obj -OUT:hyphen.lib')
        install_binaries('hyphen.lib')
        copy_headers('hyphen.h')
        return
    run('./configure', f'--prefix={build_dir()}', '--disable-static')
    run('make', 'install-libLTLIBRARIES')
    run('make', 'install-includeHEADERS')
示例#13
0
def windows_python2(args):
    replace_in_file(
        'PCbuild\\build.bat', re.compile(r'^\s*%1\s+%2', re.MULTILINE),
        f'"/p:PlatformToolset={get_platform_toolset()}" '
        f'"/p:WindowsTargetPlatformVersion={get_windows_sdk()}"')

    # We create externals/nasm-2.11.06 below so that the
    # python build script does not try to download its own nasm instead
    # using the one we built instead (the python build script fails to
    # mark its nasm as executable, and therefore errors out)
    os.makedirs('externals/nasm-2.11.06')
    # os.makedirs('externals/openssl-1.0.2h')
    # os.makedirs('externals/sqlite-3.8.11.0')
    # os.makedirs('externals/bzip2-1.0.6')

    # dont need python 3 to get externals, use git instead
    replace_in_file('PCbuild\\get_externals.bat',
                    re.compile(br'^call.+find_python.bat.+$', re.MULTILINE),
                    '')
    try:
        run('PCbuild\\build.bat', '-e', '--no-tkinter', '--no-bsddb', '-c',
            'Release', '-m', '-p', ('x64' if is64bit else 'Win32'), '-v', '-t',
            'Build')
        # Run the tests
        # run('PCbuild\\amd64\\python.exe', 'Lib/test/regrtest.py', '-u',
        #     'network,cpu,subprocess,urlfetch')

        # Do not read mimetypes from the registry
        replace_in_file(
            'Lib\\mimetypes.py',
            re.compile(br'try:.*?import\s+_winreg.*?None', re.DOTALL),
            r'_winreg = None')

        bindir = 'PCbuild\\amd64' if is64bit else 'PCbuild'
        install_binaries(bindir + os.sep + '*.exe', 'private\\python')
        install_binaries(bindir + os.sep + 'python*.dll', 'private\\python')
        install_binaries(bindir + os.sep + '*.pyd', 'private\\python\\DLLs')
        install_binaries(bindir + os.sep + '*.dll', 'private\\python\\DLLs')
        for x in glob.glob(
                os.path.join(build_dir(),
                             'private\\python\\DLLs\\python*.dll')):
            os.remove(x)
        install_binaries(bindir + os.sep + '*.lib', 'private\\python\\libs')
        copy_headers('PC\\pyconfig.h', 'private\\python\\include')
        copy_headers('Include\\*.h', 'private\\python\\include')
        shutil.copytree('Lib', os.path.join(build_dir(),
                                            'private\\python\\Lib'))
    finally:
        # bloody git creates files with no write permission
        import stat
        for path in walk('externals'):
            os.chmod(path, stat.S_IWRITE)
            os.remove(path)
示例#14
0
def main(args):
    if iswindows:
        shutil.rmtree('lib'), shutil.rmtree('lib64')
        os.mkdir('lib'), os.mkdir('lib64')
        msbuild('libiconv.vcxproj')
        copy_headers('include/iconv.h')
        install_binaries('./lib*/libiconv.dll', 'bin')
        install_binaries('./lib*/libiconv.lib', 'lib')
        # from bypy.utils import run_shell
        # run_shell()
    else:
        simple_build(
            '--disable-dependency-tracking --disable-static --enable-shared')
示例#15
0
def main(args):
    if iswindows:
        for f in 'hnjalloc.c hyphen.c'.split():
            run(f'"{CL}" /c /nologo /MD /W3 /DWIN32 -c ' + f)
        run(f'"{LIB}" -nologo hnjalloc.obj hyphen.obj -OUT:hyphen.lib')
        install_binaries('hyphen.lib')
        copy_headers('hyphen.h')
        return
    simple_build(
        ('--disable-static', ),
        make_args=('install-libLTLIBRARIES', 'install-includeHEADERS'),
        do_install=False,
    )
示例#16
0
def main(args):
    if iswindows:
        sln = r'jxrencoderdecoder\JXRDecApp_vc14.vcxproj'
        msbuild(sln)

        def fname_map(x):
            return os.path.basename(x).rpartition('.')[0] + '-calibre.exe'

        for f in walk():
            if f.endswith('.exe'):
                install_binaries(f, 'bin', fname_map=fname_map)
    else:
        run('make', os.path.join(os.getcwd(), 'build/JxrDecApp'))
        install_binaries('build/JxrDecApp', 'bin')
示例#17
0
文件: icu.py 项目: sudodave/bypy
def solution_build():
    os.chdir('..')
    try:
        msbuild(r'source\allinone\allinone.sln', '/p:SkipUWP=true',
                PYTHONPATH=os.path.abspath(os.path.join('source', 'data')))
    except Exception:
        # the build fails while building the data/tools, which we dont need
        pass
    suffix = '64' if is64bit else ''
    dll_pat = f'bin{suffix}/icu*.dll'
    dlls = install_binaries(dll_pat, 'bin')
    if len(dlls) < 5:
        raise SystemExit(f'Failed to build ICU dlls in {dll_pat}')
    install_binaries(f'lib{suffix}/*.lib')
    shutil.copytree('include', os.path.join(build_dir(), 'include'))
示例#18
0
文件: chmlib.py 项目: sudodave/bypy
def main(args):
    if iswindows:
        os.chdir('src')
        for f in 'chm_lib.c lzx.c'.split():
            copy_headers(f, 'src')
            run(f'"{CL}" /c /nologo /MD /W3 /DWIN32 -c ' + f)
        run(f'"{LIB}" -nologo chm_lib.obj lzx.obj -OUT:chmlib.lib')
        install_binaries('chmlib.lib')
        copy_headers('chm_lib.h')
        copy_headers('lzx.h', 'src')
    else:
        conf = '--disable-dependency-tracking'
        if ismacos:
            conf += ' --disable-pread --disable-io64'
        simple_build(conf)
示例#19
0
    def main(args):
        # the Makefile has a circular dependency that breaks building under VS
        # 2019, see
        # https://webcache.googleusercontent.com/search?q=cache:s-p9ts472EoJ:https://forum.nasm.us/index.php%3Ftopic%3D2746.0+&cd=6&hl=en&ct=clnk&gl=in
        replace_in_file(
            'Mkfiles/msvc.mak',
            re.compile(rb'\s+\$\(MAKE\) asm\\warnings.time.+?WARNFILES\)',
                       re.DOTALL), '')
        open('asm/warnings.time', 'w').close()

        run(NMAKE,
            '/f',
            'Mkfiles/msvc.mak',
            append_to_path=os.path.dirname(PERL))
        install_binaries('./nasm.exe', 'bin')
示例#20
0
def main(args):
    if iswindows:
        windows_cmake_build(ENABLE_SHARED='FALSE')
        install_binaries('build/jpegtran-static.exe',
                         'bin',
                         fname_map=lambda x: 'jpegtran-calibre.exe')
        install_binaries('build/cjpeg-static.exe',
                         'bin',
                         fname_map=lambda x: 'cjpeg-calibre.exe')
    else:
        kw = {}
        if ismacos:
            kw['PNG_SUPPORTED'] = 'FALSE'
        cmake_build(ENABLE_SHARED='FALSE',
                    override_prefix=os.path.join(build_dir(), 'private',
                                                 'mozjpeg'),
                    **kw)
示例#21
0
文件: jxrlib.py 项目: kovidgoyal/bypy
def main(args):
    if iswindows:
        sln = r'jxrencoderdecoder\JXRDecApp_vc14.vcxproj'
        msbuild(sln)

        def fname_map(x):
            return os.path.basename(x).rpartition('.')[0] + '-calibre.exe'

        for f in walk():
            if f.endswith('.exe'):
                install_binaries(f, 'bin', fname_map=fname_map)
    else:
        if ismacos:
            flags = ''
            if current_build_arch():
                flags += f'-arch {current_build_arch()} '
            replace_in_file('Makefile', 'CFLAGS=', f'CFLAGS={flags}')
            replace_in_file('Makefile', 'CXXFLAGS=', f'CXXFLAGS={flags}')
        run('make', os.path.join(os.getcwd(), 'build/JxrDecApp'))
        install_binaries('build/JxrDecApp', 'bin')
示例#22
0
def main(args):
    if iswindows:
        # cmake cannot find openssl
        replace_in_file('CMakeLists.txt', 'FIND_PACKAGE(LIBCRYPTO)',
                        ('SET(LIBCRYPTO_FOUND "1")\n'
                         'SET(LIBCRYPTO_INCLUDE_DIR "{0}/include")\n'
                         'SET(LIBCRYPTO_LIBRARIES "{0}/lib/libcrypto.lib")\n'
                         'SET(PODOFO_HAVE_OPENSSL_1_1 "1")\n').format(
                             PREFIX.replace(os.sep, '/')))
        windows_cmake_build(WANT_LIB64='FALSE',
                            PODOFO_BUILD_SHARED='TRUE',
                            PODOFO_BUILD_STATIC='False',
                            FREETYPE_INCLUDE_DIR=f"{PREFIX}/include/freetype2",
                            nmake_target='podofo_shared')
        copy_headers('build/podofo_config.h', 'include/podofo')
        copy_headers('src/podofo/*', 'include/podofo')
        for f in walk():
            if f.endswith('.dll'):
                install_binaries(f, 'bin')
            elif f.endswith('.lib'):
                install_binaries(f, 'lib')
    else:
        if ismacos:
            replace_in_file(
                'CMakeLists.txt', 'FIND_PACKAGE(FREETYPE REQUIRED)',
                ('SET(FREETYPE_FOUND "1")\n'
                 'SET(FREETYPE_INCLUDE_DIR "{0}/include/freetype2")\n'
                 'SET(FREETYPE_LIBRARIES "{0}/lib/libfreetype.dylib")'
                 ).format(PREFIX))
            replace_in_file('src/podofo/base/PdfDate.cpp', 'struct tm _tm{}',
                            'struct tm _tm = {0}')

        cmake_build(
            make_args='podofo_shared',
            PODOFO_BUILD_LIB_ONLY='TRUE',
            PODOFO_BUILD_SHARED='TRUE',
            PODOFO_BUILD_STATIC='FALSE',
        )
示例#23
0
def main(args):
    if iswindows:
        run(*('cscript.exe configure.js include={0}/include'
              ' lib={0}/lib prefix={0} zlib=yes iconv=no'.format(
                  PREFIX.replace(os.sep, '/')).split()),
            cwd='win32')
        run(f'"{NMAKE}" /f Makefile.msvc', cwd='win32')
        install_tree('include/libxml', 'include/libxml2')
        for f in walk('.'):
            if f.endswith('.dll'):
                install_binaries(f, 'bin')
            elif f.endswith('.lib'):
                install_binaries(f)
    else:
        # ICU is needed to use libxml2 in qt-webengine
        simple_build(
            '--disable-dependency-tracking --disable-static --enable-shared'
            ' --without-python --without-debug --with-iconv={0}'
            ' --with-zlib={0} --with-icu'.format(PREFIX))
        for path in walk(build_dir()):
            if path.endswith('/xml2-config'):
                replace_in_file(path, re.compile(b'(?m)^prefix=.+'),
                                f'prefix={PREFIX}')
示例#24
0
def main(args):
    add_dll_exports()
    objects = []
    cc = CL if iswindows else ('clang' if ismacos else 'gcc')
    cppflags = shlex.split(CPPFLAGS)
    cflags = shlex.split(CFLAGS)
    ldflags = shlex.split(LDFLAGS)
    if is_arm_half_of_lipo_build():
        cflags += ['-arch', current_build_arch()]
    for c in read_sources():
        obj = c.replace('.c', '.obj' if iswindows else '.o')
        objects.append(obj)
        if not iswindows:
            args = [cc] + cppflags + cflags + [
                '-O2', '-Iinclude', '-fPIC', '-fvisibility=hidden',
                '-c', c, '-o', obj]
            run(*args)
    if iswindows:
        dll = 'libstemmer.dll'
        args = ['/LD'] + list(read_sources()) + ['/Fe:' + dll]
        run(cc, *args)
        install_binaries(dll, 'bin')
        install_binaries('libstemmer.lib')
    else:
        ext = 'dylib' if ismacos else 'so'
        dll = f'libstemmer.0.{ext}' if ismacos else f'libstemmer.{ext}.0'
        args = ldflags
        if not ismacos:
            args += ['-Wl,-soname,libstemmer.so.0']
        if is_arm_half_of_lipo_build():
            args += ['-arch', current_build_arch()]
        run(
            cc, '-shared', '-o', dll, *args, *objects
        )
        os.symlink(dll, f'libstemmer.{ext}')
        install_binaries(dll)
        install_binaries(f'libstemmer.{ext}')
    copy_headers('include/libstemmer.h')
    if iswindows:
        os.chdir('/')
示例#25
0
def main(args):
    replace_in_file('dll.cpp', 'WideToChar', 'WideToUtf')
    if iswindows:
        # see https://github.com/microsoft/vcpkg/pull/8053
        replace_in_file(
            'UnRARDll.vcxproj',
            '<StructMemberAlignment>4Bytes</StructMemberAlignment>', '')
        msbuild('UnRARDll.vcxproj')
        install_binaries('./build/*/Release/unrar.dll', 'bin')
        install_binaries('./build/*/Release/UnRAR.lib', 'lib')
        # from bypy.utils import run_shell
        # run_shell()
    else:
        if ismacos:
            replace_in_file('makefile', 'libunrar.so', 'libunrar.dylib')
        run('make -j4 lib CXXFLAGS=-fPIC')
        install_binaries('libunrar.' + ('dylib' if ismacos else 'so'), 'lib')
    copy_headers('*.hpp', destdir='include/unrar')
示例#26
0
文件: nasm.py 项目: sudodave/bypy
 def main(args):
     run(NMAKE,
         '/f',
         'Mkfiles/msvc.mak',
         append_to_path=os.path.dirname(PERL))
     install_binaries('./nasm.exe', 'bin')
示例#27
0
文件: bzip2.py 项目: sudodave/bypy
def main(args):
    run('make -f Makefile-libbz2_so')
    install_binaries('libbz2*.so*', do_symlinks=True)
    copy_headers('bzlib.h')
示例#28
0
 def main(args):
     run(f'"{NMAKE}" -f win32/Makefile.msc')
     run(f'"{NMAKE}" -f win32/Makefile.msc test')
     install_binaries('zlib1.dll*', 'bin')
     install_binaries('zlib.lib'), install_binaries('zdll.*')
     copy_headers('zconf.h'), copy_headers('zlib.h')