Exemplo n.º 1
0
    def build(self):
        if self.settings.os == "Linux" or self.settings.os == "Macos":

            autotools = AutoToolsBuildEnvironment(self)
            env_vars = autotools.vars.copy()

            # required to correctly find static libssl on Linux
            if self.options.with_openssl and self.settings.os == "Linux":
                env_vars['OPENSSL_LIBADD'] = '-ldl'

            # disable rpath build
            tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), r"-install_name \$rpath/", "-install_name ")

            # compose configure options
            configure_args = []
            if not self.options.shared:
                configure_args.append("--disable-shared")
            configure_args.append("--enable-openssl" if self.options.with_openssl else "--disable-openssl")
            if self.options.disable_threads:
                configure_args.append("--disable-thread-support")

            with tools.environment_append(env_vars):

                with tools.chdir(self._source_subfolder):
                    # set LD_LIBRARY_PATH
                    with tools.environment_append(RunEnvironment(self).vars):
                        autotools.configure(args=configure_args)
                        autotools.make()

        elif self.settings.os == "Windows":
            vcvars = tools.vcvars_command(self.settings)
            suffix = ''
            if self.options.with_openssl:
                suffix = "OPENSSL_DIR=" + self.deps_cpp_info['OpenSSL'].rootpath
            # add runtime directives to runtime-unaware nmakefile
            tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.nmake"),
                                  'LIBFLAGS=/nologo',
                                  'LIBFLAGS=/nologo\n'
                                  'CFLAGS=$(CFLAGS) /%s' % str(self.settings.compiler.runtime))
            # do not build tests. static_libs is the only target, no shared libs at all
            make_command = "nmake %s -f Makefile.nmake static_libs" % suffix
            with tools.chdir(self._source_subfolder):
                self.run("%s && %s" % (vcvars, make_command))
Exemplo n.º 2
0
    def build(self):
        if self.settings.os != "Windows":
            with tools.chdir(self._source_subfolder):
                env_build = AutoToolsBuildEnvironment(self)
                if self.settings.arch == "x86" or self.settings.arch == "x86_64":
                    env_build.flags.append("-mstackrealign")

                if self.settings.os == "Macos":
                    old_str = "-install_name $libdir/$SHAREDLIBM"
                    new_str = "-install_name $SHAREDLIBM"
                    tools.replace_in_file("./configure", old_str, new_str)

                # Zlib configure doesnt allow this parameters (in 1.2.8)
                env_build.configure("./", build=False, host=False, target=False)
                env_build.make()

        else:
            cmake = CMake(self)
            cmake.configure(build_dir=self._build_subfolder)
            cmake.build()
Exemplo n.º 3
0
    def build_configure(self):
        def chmod_plus_x(filename):
            if os.name == 'posix':
                os.chmod(filename, os.stat(filename).st_mode | 0o111)

        with tools.chdir(self.source_subfolder):
            if self.settings.os == "Macos":
                tools.replace_in_file("configure", r"-install_name \$rpath/",
                                      "-install_name ")
            chmod_plus_x('configure')
            if self.options.shared:
                args = ['--disable-static', '--enable-shared']
            else:
                args = ['--disable-shared', '--enable-static']
            args.append('--enable-fixed-point' if self.
                        fixed_point else '--disable-fixed-point')
            env_build = AutoToolsBuildEnvironment(self)
            env_build.configure(args=args)
            env_build.make()
            env_build.install()
Exemplo n.º 4
0
    def build_with_configure(self):

        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = self.options.fPIC
        with tools.environment_append(env_build.vars):
            with tools.chdir(self.source_subfolder):
                # fix rpath
                if self.settings.os == "Macos":
                    tools.replace_in_file("configure",
                                          r"-install_name \$rpath/",
                                          "-install_name ")
                configure_args = ['--with-python=no', '--without-lzma']
                if self.options.shared:
                    configure_args.extend(
                        ['--enable-shared', '--disable-static'])
                else:
                    configure_args.extend(
                        ['--enable-static', '--disable-shared'])
                env_build.configure(args=configure_args)
                env_build.make()
Exemplo n.º 5
0
 def _build_configure(self):
     with tools.chdir(self._source_subfolder):
         env_build = AutoToolsBuildEnvironment(self, win_bash=self._is_mingw_windows)
         args = ['--disable-xz',
                 '--disable-xzdec',
                 '--disable-lzmadec',
                 '--disable-lzmainfo',
                 '--disable-scripts',
                 '--disable-doc']
         if self.settings.os != "Windows" and self.options.fPIC:
             args.append('--with-pic')
         if self.options.shared:
             args.extend(['--disable-static', '--enable-shared'])
         else:
             args.extend(['--enable-static', '--disable-shared'])
         if self.settings.build_type == 'Debug':
             args.append('--enable-debug')
         env_build.configure(args=args, build=False)
         env_build.make()
         env_build.install()
Exemplo n.º 6
0
    def build(self):
        for src in self.exports_sources:
            shutil.copy(os.path.join(self.source_folder, src),
                        self.build_folder)
        self.run("{} --install --verbose -Wall".format(
            os.environ["AUTORECONF"]),
                 win_bash=tools.os_info.is_windows)

        tools.mkdir(self._package_folder)
        conf_args = [
            "--prefix={}".format(tools.unix_path(self._package_folder)),
            "--enable-shared",
            "--enable-static",
        ]
        with self._build_context():
            autotools = AutoToolsBuildEnvironment(
                self, win_bash=tools.os_info.is_windows)
            autotools.configure(args=conf_args)
            autotools.make(args=["V=1", "-j1"])
            autotools.install()
Exemplo n.º 7
0
    def build(self):
        if self.settings.os == 'Windows' or self.settings.os == 'Macos':
            cmake = self._configure_cmake()
            cmake.build()
        else:
            autotools = AutoToolsBuildEnvironment(self)
            autotools.fpic = self.options.fPIC
            config_args = ['--with-fft=smallft']
            if self.options.shared:
                config_args += [
                    '--enable-shared=true', '--enable-static=false'
                ]
            else:
                config_args += [
                    '--enable-shared=false', '--enable-static=true'
                ]

            autotools.configure(configure_dir='speexdsp-%s' % self.version,
                                args=config_args)
            autotools.make()
Exemplo n.º 8
0
    def _build_configure(self):
        autotools = AutoToolsBuildEnvironment(self)
        autotools.fpic = self.options.get_safe("fPIC", False)
        with tools.chdir(self._source_subfolder):
            args = []
            if self.options.with_ssl == "openssl":
                args.append("WITH_OPENSSL=1")
            elif self.options.with_ssl == "wolfssl":
                args.append("WITH_WOLFSSL=1")

            if self.options.eventloop == "libuv":
                args.append("WITH_LIBUV=1")
            elif self.options.eventloop == "gcd":
                args.append("WITH_GCD=1")
            elif self.options.eventloop == "boost":
                args.append("WITH_ASIO=1")

            args.extend("{}={}".format(key, value)
                        for key, value in autotools.vars.items())
            autotools.make(target="default", args=args)
Exemplo n.º 9
0
 def build(self):
     self._patch_sources()
     with tools.chdir(self._source_subfolder):
         autotools = AutoToolsBuildEnvironment(self)
         make_args = [
             "REAL_DAEMON_DIR={}".format(
                 tools.unix_path(os.path.join(self.package_folder, "bin"))),
             "-j1",
             "SHEXT={}".format(self._shext),
         ]
         if self.options.shared:
             make_args.append("shared=1")
         env_vars = autotools.vars
         if self.options.get_safe("fPIC", True):
             env_vars["CFLAGS"] += " -fPIC"
         env_vars["ENV_CFLAGS"] = env_vars["CFLAGS"]
         # env_vars["SHEXT"] = self._shext
         print(env_vars)
         with tools.environment_append(env_vars):
             autotools.make(target="linux", args=make_args)
Exemplo n.º 10
0
 def _build_configure(self):
     tools.replace_in_file(os.path.join(self._source_subfolder, "build.mak.in"),
                           "export TARGET_NAME := @target@",
                           "export TARGET_NAME := ")
     with tools.chdir(self._source_subfolder):
         args = ["--with-ssl=%s" % self.deps_cpp_info["openssl"].rootpath]
         if self.options.shared:
             args.extend(["--disable-static", "--enable-shared"])
         else:
             args.extend(["--disable-shared", "--enable-static"])
         # disable autodetect
         args.extend(["--disable-darwin-ssl",
                      "--enable-openssl",
                      "--disable-opencore-amr",
                      "--disable-silk",
                      "--disable-opus"])
         env_build = AutoToolsBuildEnvironment(self)
         env_build.configure(args=args)
         env_build.make()
         env_build.install()
Exemplo n.º 11
0
    def _build_make(self):
        prefix = self.package_folder
        prefix = tools.unix_path(prefix) if self.settings.os == "Windows" else prefix
        with tools.chdir(self._source_subfolder):
            env_build = AutoToolsBuildEnvironment(self)
            if self.options.shared:
                args = ["BUILD_SHARED=yes", "BUILD_STATIC=no"]
            else:
                args = ["BUILD_SHARED=no", "BUILD_STATIC=yes"]
            env_build.make(args=args)
            args.extend(["PREFIX=%s" % prefix, "install"])
            env_build.make(args=args)

            if self.settings.os == 'Macos' and self.options.shared:
                lib_dir = os.path.join(prefix, 'lib')
                old = '/usr/local/lib/liblz4.1.dylib'
                new = 'liblz4.1.dylib'
                for lib in os.listdir(lib_dir):
                    if lib.endswith('.dylib'):
                        self.run('install_name_tool -change %s %s %s' % (old, new, os.path.join(lib_dir, lib)))
Exemplo n.º 12
0
 def _build_configure(self):
     if self.settings.os == "Android" and tools.os_info.is_windows:
         # remove escape for quotation marks, to make ndk on windows happy
         tools.replace_in_file(
             os.path.join(self._source_subfolder, 'configure'),
             "s/[	 `~#$^&*(){}\\\\|;'\\\''\"<>?]/\\\\&/g",
             "s/[	 `~#$^&*(){}\\\\|;<>?]/\\\\&/g")
     env_build = AutoToolsBuildEnvironment(
         self, win_bash=tools.os_info.is_windows)
     with tools.chdir(self._source_subfolder):
         args = ['prefix=%s' % self.package_folder]
         if self.options.shared:
             args.extend(['--disable-static', '--enable-shared'])
         else:
             args.extend(['--disable-shared', '--enable-static'])
         args.append('--without-tiff')
         args.append('--without-jpeg')
         env_build.configure(args=args)
         env_build.make()
         env_build.make(args=['install'])
Exemplo n.º 13
0
    def _build_unix(self, args):
        if self.settings.os == "Linux":
            args.append("-no-use-gold-linker")  # QTBUG-65071
            if self.options.GUI:
                args.append("-qt-xcb")
            if self.settings.arch == "x86":
                args += ["-xplatform linux-g++-32"]
            elif self.settings.arch == "armv6":
                args += ["-xplatform linux-arm-gnueabi-g++"]
            elif self.settings.arch == "armv7":
                args += ["-xplatform linux-arm-gnueabi-g++"]
        else:
            args += ["-no-framework"]
            if self.settings.arch == "x86":
                args += ["-xplatform macx-clang-32"]

        env_build = AutoToolsBuildEnvironment(self)
        self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)))
        env_build.make()
        env_build.install()
Exemplo n.º 14
0
    def build(self):
        autotools = AutoToolsBuildEnvironment(self)

        if self.options.lto:
            autotools.flags.append("-flto")
            autotools.link_flags.append("-flto")
            autotools.link_flags.append("-fuse-ld=gold")
            autotools.link_flags.append("-fuse-linker-plugin")

        autotools.configure(
            configure_dir = f"{self.source_folder}/musl"
            , args = [
                "--disable-static" if self.options.shared else "--enable-static"
                , "--enable-shared" if self.options.shared else "--disable-shared"
                , "--disable-debug"
                , "--disable-warnings"
            ]
        )
        autotools.make()
        autotools.install()
Exemplo n.º 15
0
 def build(self):
     self._patch_sources()
     if self.settings.compiler == "Visual Studio":
         with tools.chdir(
                 os.path.join(self._source_subfolder, "build",
                              self._msvc_build_dirname)):
             msbuild = MSBuild(self)
             msbuild.build("Premake5.sln",
                           platforms={
                               "x86": "Win32",
                               "x86_64": "x64"
                           })
     else:
         with tools.chdir(
                 os.path.join(self._source_subfolder, "build",
                              self._gmake_build_dirname)):
             env_build = AutoToolsBuildEnvironment(self)
             env_build.make(
                 target="Premake5",
                 args=["verbose=1", "config={}".format(self._gmake_config)])
Exemplo n.º 16
0
 def linux_build(self):
     env_build = AutoToolsBuildEnvironment(self)
     with tools.chdir(self._source_subfolder):
         #host = "mips-linux-gnu"
         #tools.get_gnu_triplet(self.settings.os, self.settings.arch)
         env_build.configure(
             host=host,
             args=[
                 "--with-sys-contact=@@no.where",
                 "--with-sys-location=Unknown",
                 "--with-logfile=/var/log/snmpd.log",
                 "--with-persistent-directory=/var/net-snmp",
                 "--disable-manuals",
                 "--disable-embedded-perl",
                 "--disable-perl-cc-checks",
                 "--with-openssl=%s" %
                 [self.deps_cpp_info["openssl"].rootpath],
             ])
         env_build.make()
         env_build.install()
Exemplo n.º 17
0
    def build(self):

        if self.settings.os == "Android" and self.settings.compiler == "clang":
            del self.settings.compiler.libcxx

        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = self.options.fPIC

        configure_args = []
        if not self.options.shared:
            configure_args.extend([
                '--enable-static', '--disable-shared', '--enable-static-boost'
            ])

        if self.options.fPIC:
            configure_args.extend(['--with-pic'])

        env_build.configure(configure_dir=self.source_path(),
                            args=configure_args)
        env_build.make()
Exemplo n.º 18
0
    def _build_with_autotools(self):
        if self.options.with_app:
            os.rename('c-ares.pc', 'libcares.pc')

        prefix = os.path.abspath(self.package_folder)
        with tools.chdir(self._source_subfolder):
            env_build = AutoToolsBuildEnvironment(self)
            if self.settings.os == 'Windows':
                prefix = tools.unix_path(prefix)
            args = []
            if self.options.shared:
                args.extend(['--disable-static', '--enable-shared'])
            else:
                args.extend(['--disable-shared', '--enable-static'])
            if self.options.with_hpack:
                args.append('--enable-hpack-tools')
            else:
                args.append('--disable-hpack-tools')

            if self.options.with_app:
                args.append('--enable-app')
            else:
                args.append('--disable-app')

            args.append('--disable-examples')
            args.append('--disable-python-bindings')
            # disable unneeded auto-picked dependencies
            args.append('--without-jemalloc')
            args.append('--without-systemd')
            args.append('--without-libxml2')

            if self.options.with_asio:
                args.append('--enable-asio-lib')
                args.append('--with-boost=' +
                            self.deps_cpp_info['boost'].rootpath)
            else:
                args.append('--without-boost')

            env_build.configure(args=args)
            env_build.make()
            env_build.make(args=['install'])
Exemplo n.º 19
0
    def _build_configure(self):
        args = ["HELP2MAN=/bin/true"]
        build = None
        host = None
        if self._is_msvc:
            for filename in ["compile", "ar-lib"]:
                shutil.copy(os.path.join(self.deps_cpp_info["automake_build_aux"].rootpath, filename),
                            os.path.join(self._source_subfolder, "build-aux", filename))
            build = False
            if self.settings.arch == "x86":
                host = "i686-w64-mingw32"
            elif self.settings.arch == "x86_64":
                host = "x86_64-w64-mingw32"
            args.extend(['CC=$PWD/build-aux/compile cl -nologo',
                         'CFLAGS=-%s' % self.settings.compiler.runtime,
                         'LD=link',
                         'NM=dumpbin -symbols',
                         'STRIP=:',
                         'AR=$PWD/build-aux/ar-lib lib',
                         'RANLIB=:',
                         "gl_cv_func_printf_directive_n=no"])

        env_build = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
        with tools.chdir(self._source_subfolder):
            tools.replace_in_file("Makefile.in",
                                  "dist_man_MANS = $(top_srcdir)/doc/bison.1",
                                  "dist_man_MANS =")
            tools.replace_in_file(os.path.join("src", "yacc.in"),
                                  "@prefix@",
                                  "${}_ROOT".format(self.name.upper()))
            tools.replace_in_file(os.path.join("src", "yacc.in"),
                                  "@bindir@",
                                  "${}_ROOT/bin".format(self.name.upper()))

            env_build.configure(args=args, build=build, host=host)
            env_build.make()
            env_build.install()

        if self._is_msvc:
            shutil.move(os.path.join(self.package_folder, "lib", "liby.a"),
                        os.path.join(self.package_folder, "lib", "y.lib"))
Exemplo n.º 20
0
    def _build_with_configure(self):
        in_win = self.settings.os == "Windows"
        env_build = AutoToolsBuildEnvironment(self, win_bash=in_win)
        if not in_win:
            env_build.fpic = self.options.fPIC
        full_install_subfolder = tools.unix_path(
            self.package_folder) if in_win else self.package_folder
        # fix rpath
        if self.settings.os == "Macos":
            tools.replace_in_file(
                os.path.join(self._full_source_subfolder, "configure"),
                r"-install_name \$rpath/", "-install_name ")
        configure_args = [
            '--with-python=no',
            '--prefix=%s' % full_install_subfolder
        ]
        if env_build.fpic:
            configure_args.extend(['--with-pic'])
        if self.options.shared:
            configure_args.extend(['--enable-shared', '--disable-static'])
        else:
            configure_args.extend(['--enable-static', '--disable-shared'])
        configure_args.extend(
            ['--with-zlib' if self.options.zlib else '--without-zlib'])
        configure_args.extend(
            ['--with-lzma' if self.options.lzma else '--without-lzma'])
        configure_args.extend(
            ['--with-iconv' if self.options.iconv else '--without-iconv'])
        configure_args.extend(
            ['--with-icu' if self.options.icu else '--without-icu'])

        # Disable --build when building for iPhoneSimulator. The configure script halts on
        # not knowing if it should cross-compile.
        build = None
        if self.settings.os == "iOS" and self.settings.arch == "x86_64":
            build = False

        env_build.configure(args=configure_args,
                            build=build,
                            configure_dir=self._full_source_subfolder)
        env_build.make(args=["install"])
Exemplo n.º 21
0
    def _build_with_configure(self):
        in_win = self.settings.os == "Windows"
        env_build = AutoToolsBuildEnvironment(self, win_bash=in_win)
        if not in_win:
            env_build.fpic = self.options.fPIC
        full_install_subfolder = tools.unix_path(
            self.package_folder) if in_win else self.package_folder
        # fix rpath
        if self.settings.os == "Macos":
            tools.replace_in_file(
                os.path.join(self._full_source_subfolder, "configure"),
                r"-install_name \$rpath/", "-install_name ")
        configure_args = [
            '--with-python=no',
            '--prefix=%s' % full_install_subfolder
        ]
        if env_build.fpic:
            configure_args.extend(['--with-pic'])
        if self.options.shared:
            configure_args.extend(['--enable-shared', '--disable-static'])
        else:
            configure_args.extend(['--enable-static', '--disable-shared'])

        xml_config = tools.unix_path(
            self.deps_cpp_info["libxml2"].rootpath) + "/bin/xml2-config"

        configure_args.extend([
            '--without-crypto', '--without-debugger', '--without-plugins',
            'XML_CONFIG=%s' % xml_config
        ])

        # Disable --build when building for iPhoneSimulator. The configure script halts on
        # not knowing if it should cross-compile.
        build = None
        if self.settings.os == "iOS" and self.settings.arch == "x86_64":
            build = False

        env_build.configure(args=configure_args,
                            build=build,
                            configure_dir=self._full_source_subfolder)
        env_build.make(args=["install", "V=1"])
Exemplo n.º 22
0
 def build(self):
     env_build = AutoToolsBuildEnvironment(self)
     if self.options.stdcxx == "14":
         if self.settings.compiler.libcxx == 'libstdc++11':
             env_build.cxx_flags = "-std=gnu++14 -D_GLIBCXX_USE_CXX11_ABI=1"
         else:
             env_build.cxx_flags = "-std=gnu++14 -D_GLIBCXX_USE_CXX11_ABI=0"
     elif self.options.stdcxx == "11":
         if self.settings.compiler.libcxx == 'libstdc++11':
             env_build.cxx_flags = "-std=gnu++11 -D_GLIBCXX_USE_CXX11_ABI=1"
         else:
             env_build.cxx_flags = "-std=gnu++11 -D_GLIBCXX_USE_CXX11_ABI=0"
     elif self.options.stdcxx == "98":
         env_build.cxx_flags = "-std=gnu++98"
     env_build.fpic = True
     tools.mkdir("build")
     # make sure timestamps are correct to avoid invocation of autoconf tools
     tools.touch("%s/aclocal.m4" %
                 os.path.join(self.source_folder, self.source_subfolder))
     tools.touch("%s/Makefile.in" %
                 os.path.join(self.source_folder, self.source_subfolder))
     tools.touch("%s/configure" %
                 os.path.join(self.source_folder, self.source_subfolder))
     env_build.libs.remove('systemc')
     with tools.chdir("build"):
         env_build.configure(
             configure_dir=os.path.join(self.source_folder,
                                        self.source_subfolder),
             args=[
                 '--prefix=%s' %
                 os.path.join(self.source_folder, 'install'),
                 '--with-systemc=%s' %
                 self.deps_cpp_info["SystemC"].rootpath,
                 '--enable-static=no --enable-shared=yes'
                 if self.options.shared else
                 '--enable-static=yes --enable-shared=no'
                 #'--disable-debug',
                 #'--disable-opt'
             ])
         env_build.make()
         env_build.make(args=["install"])
Exemplo n.º 23
0
    def build(self):
        with tools.chdir(os.path.join(self.source_folder, self.ZIP_FOLDER_NAME)):
            for filename in ['zconf.h', 'zconf.h.cmakein', 'zconf.h.in']:
                tools.replace_in_file(filename,
                                      '#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */',
                                      '#if defined(HAVE_UNISTD_H) && (1-HAVE_UNISTD_H-1 != 0)')
                tools.replace_in_file(filename,
                                      '#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */',
                                      '#if defined(HAVE_STDARG_H) && (1-HAVE_STDARG_H-1 != 0)')
            files.mkdir("_build")
            with tools.chdir("_build"):
                if not tools.os_info.is_windows:
                    env_build = AutoToolsBuildEnvironment(self)
                    if self.settings.arch in ["x86", "x86_64"] and self.settings.compiler in ["apple-clang", "clang", "gcc"]:
                        env_build.flags.append('-mstackrealign')

                    env_build.fpic = True

                    if self.settings.os == "Macos":
                        old_str = '-install_name $libdir/$SHAREDLIBM'
                        new_str = '-install_name $SHAREDLIBM'
                        tools.replace_in_file("../configure", old_str, new_str)

                    if self.settings.os == "Windows":  # Cross building to Linux
                        tools.replace_in_file("../configure", 'LDSHAREDLIBC="${LDSHAREDLIBC--lc}"', 'LDSHAREDLIBC=""')
                    # Zlib configure doesnt allow this parameters
                    if self.settings.os == "Windows" and tools.os_info.is_linux:
                        # Let our profile to declare what is needed.
                        tools.replace_in_file("../win32/Makefile.gcc", 'LDFLAGS = $(LOC)', '')
                        tools.replace_in_file("../win32/Makefile.gcc", 'AS = $(CC)', '')
                        tools.replace_in_file("../win32/Makefile.gcc", 'AR = $(PREFIX)ar', '')
                        tools.replace_in_file("../win32/Makefile.gcc", 'CC = $(PREFIX)gcc', '')
                        tools.replace_in_file("../win32/Makefile.gcc", 'RC = $(PREFIX)windres', '')
                        self.run("cd .. && make -f win32/Makefile.gcc")
                    else:
                        env_build.configure("../", build=False, host=False, target=False)
                        env_build.make()
                else:
                    cmake = CMake(self)
                    cmake.configure(build_dir=".")
                    cmake.build(build_dir=".")
Exemplo n.º 24
0
    def build(self):
        absolute_source_subfolder = os.path.abspath(self.source_subfolder)
        with tools.chdir(self.build_subfolder):

            if self.settings.os == 'Macos':
                arch = 'i386' if self.settings.arch == 'x86' else self.settings.arch
                self.run((
                    "xcodebuild -project {source_folder}/src/client/mac/Breakpad.xcodeproj -sdk macosx"
                    +
                    " -target Breakpad ARCHS={archs} ONLY_ACTIVE_ARCH=YES -configuration {config}"
                ).format(source_folder=absolute_source_subfolder,
                         archs=arch,
                         config=self.settings.build_type))
            elif self.settings.os == 'Windows':
                tools.patch(patch_file="patch/common.gypi.patch",
                            base_path=self.source_subfolder)
                self.run(
                    "gyp --no-circular-check -D win_release_RuntimeLibrary=2 -D win_debug_RuntimeLibrary=3 "
                    + "{source_folder}/src/client/windows/breakpad_client.gyp".
                    format(source_folder=absolute_source_subfolder))

                msbuild = MSBuild(self)
                sln_filepath = os.path.join(absolute_source_subfolder,
                                            "src/client/windows/")

                msbuild.build(sln_filepath + "common.vcxproj")
                msbuild.build(sln_filepath +
                              "handler/exception_handler.vcxproj")
                msbuild.build(
                    sln_filepath +
                    "crash_generation/crash_generation_client.vcxproj")
                msbuild.build(
                    sln_filepath +
                    "crash_generation/crash_generation_server.vcxproj")
                msbuild.build(sln_filepath +
                              "sender/crash_report_sender.vcxproj")

            elif self.settings.os == 'Linux':
                env_build = AutoToolsBuildEnvironment(self)
                env_build.configure(absolute_source_subfolder)
                env_build.make()
Exemplo n.º 25
0
    def _build_static_lib_in_shared(self):
        """ Build shared library using libtool (while linking to a static library) """

        # Copy static-in-shared directory to build folder
        autotools_folder = os.path.join(self.build_folder, "static-in-shared")
        shutil.copytree(os.path.join(self.source_folder, "static-in-shared"),
                        autotools_folder)

        install_prefix = os.path.join(autotools_folder, "prefix")

        # Build static library using CMake
        cmake = CMake(self)
        cmake.definitions["CMAKE_INSTALL_PREFIX"] = install_prefix
        cmake.configure(source_folder=autotools_folder,
                        build_folder=os.path.join(autotools_folder,
                                                  "cmake_build"))
        cmake.build()
        cmake.install()

        # Copy autotools directory to build folder
        with tools.chdir(autotools_folder):
            self.run("{} -ifv -Wall".format(os.environ["AUTORECONF"]),
                     win_bash=tools.os_info.is_windows)

        with tools.chdir(autotools_folder):
            conf_args = [
                "--enable-shared",
                "--disable-static",
                "--prefix={}".format(
                    tools.unix_path(os.path.join(install_prefix))),
            ]
            with self._build_context():
                autotools = AutoToolsBuildEnvironment(
                    self, win_bash=tools.os_info.is_windows)
                autotools.libs = []
                autotools.link_flags.append("-L{}".format(
                    tools.unix_path(os.path.join(install_prefix, "lib"))))
                autotools.configure(args=conf_args,
                                    configure_dir=autotools_folder)
                autotools.make(args=["V=1"])
                autotools.install()
Exemplo n.º 26
0
    def _build_zlib_autotools(self):
        env_build = AutoToolsBuildEnvironment(self)

        # configure passes CFLAGS to linker, should be LDFLAGS
        tools.replace_in_file("../configure", "$LDSHARED $SFLAGS", "$LDSHARED $LDFLAGS")
        # same thing in Makefile.in, when building tests/example executables
        tools.replace_in_file("../Makefile.in", "$(CC) $(CFLAGS) -o", "$(CC) $(LDFLAGS) -o")

        # we need to build only libraries without test example and minigzip
        if self.options.shared:
            make_target = "libz.%s.dylib" % self.version \
                if tools.is_apple_os(self.settings.os) else "libz.so.%s" % self.version
        else:
            make_target = "libz.a"

        env = {}
        if "clang" in str(self.settings.compiler) and tools.get_env("CC") is None and tools.get_env("CXX") is None:
            env = {"CC": "clang", "CXX": "clang++"}
        with tools.environment_append(env):
            env_build.configure("../", build=False, host=False, target=False)
            env_build.make(target=make_target)
Exemplo n.º 27
0
    def build(self):
        if self._isVisualStudioBuild():
            cmake = CMake(self)
            cmake.configure(source_dir=self._pkg_name)
            cmake.build()
        else:
            is_windows_build = platform.system() == "Windows"
            config_args = []
            if self.options.fPIC:
                config_args.append("--with-pic")

            if self.options.shared:
                config_args.append("--disable-static")
            else:
                config_args.append("--disable-shared")

            autotools = AutoToolsBuildEnvironment(self,
                                                  win_bash=is_windows_build)
            autotools.configure(configure_dir=self._pkg_name, args=config_args)
            autotools.make()
            autotools.install()
Exemplo n.º 28
0
 def build(self):
     _sepol_subfolder, _selinux_subfolder = self._get_subfolders()
     pcre_inc = os.path.join(self.deps_cpp_info["pcre2"].rootpath,
                             self.deps_cpp_info["pcre2"].includedirs[0])
     pcre_libs = ' '.join(
         ["-l%s" % lib for lib in self.deps_cpp_info["pcre2"].libs])
     sepol_inc = os.path.join(self.source_folder, _sepol_subfolder,
                              "include")
     with tools.chdir(os.path.join(_sepol_subfolder, "src")):
         args = ["libsepol.so.1" if self.options.shared else "libsepol.a"]
         env_build = AutoToolsBuildEnvironment(self)
         env_build.make(args=args)
     with tools.chdir(os.path.join(_selinux_subfolder, "src")):
         args = [
             "libselinux.so.1" if self.options.shared else "libselinux.a",
             'PCRE_CFLAGS=-DPCRE2_CODE_UNIT_WIDTH=8 -DUSE_PCRE2=1 -I%s -I%s'
             % (pcre_inc, sepol_inc),
             'PCRE_LDLIBS=%s' % pcre_libs
         ]
         env_build = AutoToolsBuildEnvironment(self)
         env_build.make(args=args)
Exemplo n.º 29
0
    def build(self):
        with tools.chdir(self.source_subfolder):
            os.makedirs('pkgconfig')
            self.copy_pkg_config('xcb-proto')
            pkg_config_path = os.path.abspath('pkgconfig')
            # sed "s/pthread-stubs//" -i configure: This sed removes a
            # dependency on the libpthread-stubs package which is useless on Linux.
            # Source: http://www.linuxfromscratch.org/blfs/view/svn/x/libxcb.html
            self.run('sed -i "s/pthread-stubs//" configure')
            configure_args = ['--without-doxygen']
            if self.options.shared:
                configure_args.extend(['--disable-static', '--enable-shared'])
            else:
                configure_args.extend(['--enable-static', '--disable-shared'])

            env_build = AutoToolsBuildEnvironment(self)
            env_build.pic = self.options.fPIC
            env_build.configure(args=configure_args,
                                pkg_config_paths=[pkg_config_path])
            env_build.make()
            env_build.install()
Exemplo n.º 30
0
    def _build_autotools(self):
        """ Test autotools integration """
        # Copy autotools directory to build folder
        shutil.copytree(os.path.join(self.source_folder, "autotools"), os.path.join(self.build_folder, "autotools"))
        with tools.chdir("autotools"):
            self.run("{} --install --verbose -Wall".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows)

        tools.mkdir(self._package_folder)
        conf_args = [
            "--prefix={}".format(tools.unix_path(self._package_folder)),
            "--enable-shared", "--enable-static",
        ]

        os.mkdir("bin_autotools")
        with tools.chdir("bin_autotools"):
            with self._build_context():
                autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
                autotools.libs = []
                autotools.configure(args=conf_args, configure_dir=os.path.join(self.build_folder, "autotools"))
                autotools.make(args=["V=1"])
                autotools.install()
Exemplo n.º 31
0
 def build_freestanding(self):
     tools.mkdir(self.gcc_fullname)
     with tools.chdir(self.gcc_fullname):
         with tools.environment_append(
             {"PATH": [os.path.join(self.package_folder, "bin")]}):
             autotools = AutoToolsBuildEnvironment(self)
             autotools.configure(args=[
                 "--disable-nls", "--enable-languages=c,c++",
                 "--disable-libssp", "--disable-libada", "--with-dwarf2",
                 "--disable-shared", "--enable-static",
                 "--enable-mingw-wildcard", "--enable-plugin",
                 "--with-gnu-as", "--with-newlib", "--disable-__cxa_atexit",
                 "--disable-threads", "--disable-sjlj-exceptions",
                 "--enable-libstdcxx", "--enable-lto",
                 "--disable-hosted-libstdcxx"
             ],
                                 configure_dir=os.path.join(
                                     self.source_folder, self.gcc_fullname),
                                 target="avr")
             autotools.make()
             autotools.install()
Exemplo n.º 32
0
 def build(self):
     env_build = AutoToolsBuildEnvironment(self)
     env_build.make()
Exemplo n.º 33
0
    def build(self):

        self.output.info("cwd=%s" % (os.getcwd()))

        # put conan inclusion into CMakeLists.txt file or fail (strict=True)
        self.output.info('Patching CMakeLists.txt')
        tools.replace_in_file(os.sep.join([self.folder_name, "CMakeLists.txt"]), "project(RdKafka)",
        '''project(RdKafka)
           include(${CMAKE_BINARY_DIR}/../../conanbuildinfo.cmake)
           conan_basic_setup()''')

        # Some situations like using a bad passphrase causes rk to never be initialized
        # so calling this function would cause a segfault.  Input validation would be helpful.
        tools.replace_in_file(os.sep.join([self.folder_name, "src", "rdkafka.c"]),
        '''static void rd_kafka_destroy_app (rd_kafka_t *rk, int blocking) {
        thrd_t thrd;
#ifndef _MSC_VER
	int term_sig = rk->rk_conf.term_sig;
#endif''',
'''static void rd_kafka_destroy_app (rd_kafka_t *rk, int blocking) {
        if (rk == NULL)
        {
            return;
        }
        thrd_t thrd;
#ifndef _MSC_VER
	int term_sig = rk->rk_conf.term_sig;
#endif''')

        if tools.os_info.is_windows:

            # rdkafka C++ library does not export the special partition and offset constants/values
            # variables from the DLL, and looks like the library is switching to a preprocessor define
            # instead.  This change includes the C-header file just to get the macro values, and then
            # changes the constants from being used as imported values to read from the macros.
            tools.replace_in_file(os.sep.join([self.folder_name, "examples", "rdkafka_example.cpp"]), '#include "rdkafkacpp.h"',
    '''#include "rdkafkacpp.h"
    #include "rdkafka.h"''')
            tools.replace_in_file(os.sep.join([self.folder_name, "examples", "rdkafka_example.cpp"]), 'RdKafka::Topic::PARTITION_UA', 'RD_KAFKA_PARTITION_UA')
            tools.replace_in_file(os.sep.join([self.folder_name, "examples", "rdkafka_example.cpp"]), 'RdKafka::Topic::OFFSET_BEGINNING', 'RD_KAFKA_OFFSET_BEGINNING')
            tools.replace_in_file(os.sep.join([self.folder_name, "examples", "rdkafka_example.cpp"]), 'RdKafka::Topic::OFFSET_END', 'RD_KAFKA_OFFSET_END')
            tools.replace_in_file(os.sep.join([self.folder_name, "examples", "rdkafka_example.cpp"]), 'RdKafka::Topic::OFFSET_STORED', 'RD_KAFKA_OFFSET_STORED')


            # src/rd.h includes win32_config.h which is not generated by CMake/Conan
            # so it builds librdkafka with fixed settings (!!!).
            # This change removes that choice, and  both platforms use the generated config.h file
            self.output.info('Patching src/rd.h file')
            tools.replace_in_file(os.sep.join([self.folder_name, 'src', 'rd.h']),
'''
#ifdef _MSC_VER
/* Visual Studio */
#include "win32_config.h"
#else
/* POSIX / UNIX based systems */
#include "../config.h" /* mklove output */
#endif
''',
'#include "../config.h"')

            files.mkdir("./{}/build".format(self.folder_name))
            with tools.chdir("./{}/build".format(self.folder_name)):
                cmake = CMake(self)

                cmake.definitions['RDKAFKA_BUILD_STATIC'] = "OFF" if self.options.shared else "ON"

                cmake.definitions['ENABLE_DEVEL'] = "ON" if self.options.with_devel_asserts else "OFF"
                cmake.definitions['ENABLE_REFCNT_DEBUG'] = 'ON' if self.options.with_refcount_debug else "OFF"
                cmake.definitions['ENABLE_SHAREDPTR_DEBUG'] = 'ON' if self.options.with_sharedptr_debug else "OFF"

                cmake.definitions["RDKAFKA_BUILD_EXAMPLES"] = "ON" if self.options.build_examples else "OFF"
                cmake.definitions["RDKAFKA_BUILD_TESTS"] = "ON"  if self.options.build_tests else "OFF"
                cmake.definitions["WITH_LIBDL"] = "OFF"
                cmake.definitions["WITH_PLUGINS"] = "OFF"
                cmake.definitions["WITH_SASL"] = "OFF"
                cmake.definitions["WITH_SSL"] = "ON" if self.options.with_openssl else "OFF"
                cmake.definitions["WITH_ZLIB"] = "ON" if self.options.with_zlib else "OFF"

                if self.settings.build_type == "Debug":
                    cmake.definitions["WITHOUT_OPTIMIZATION"] = "ON"
                if self.options.shared:
                    cmake.definitions["BUILD_SHARED_LIBS"] = "ON"

                # Enables overridding of default window build settings
                cmake.definitions["WITHOUT_WIN32_CONFIG"] = "ON"

                cmake.configure(source_dir="..", build_dir=".")
                cmake.build(build_dir=".")
        else:
            configure_args = [
                "--prefix=",
                "--disable-sasl"
            ]

            if not self.options.with_openssl:
                configure_args.append('--disable-ssl')
            if not self.options.with_zlib:
                configure_args.append('--disable-lz4')

            if self.options.shared:
                ldflags = os.environ.get("LDFLAGS", "")
                if tools.os_info.is_linux:
                    os.environ["LDFLAGS"] = ldflags + " -Wl,-rpath=\\$$ORIGIN"
                elif tools.os_info.is_macos:
                    os.environ["LDFLAGS"] = ldflags + " -headerpad_max_install_names"
            else:
                configure_args.append("--enable-static")

            if self.settings.build_type == "Debug":
                configure_args.append("--disable-optimization")

            destdir = os.path.join(os.getcwd(), "install")
            with tools.chdir(self.folder_name):
                if tools.os_info.is_macos and self.options.shared:
                    path = os.path.join(os.getcwd(), "mklove", "modules", "configure.lib")
                    tools.replace_in_file(
                        path,
                         '-dynamiclib -Wl,-install_name,$(DESTDIR)$(libdir)/$(LIBFILENAME)',
                         '-dynamiclib -Wl,-install_name,@rpath/$(LIBFILENAME)',
                    )

                env_build = AutoToolsBuildEnvironment(self)
                env_build.configure(args=configure_args)
                env_build.make()
                env_build.make(args=["install", "DESTDIR="+destdir])

        with tools.chdir(self.folder_name):
            os.rename("LICENSE", "LICENSE.librdkafka")
Exemplo n.º 34
0
 def build(self):
   env_build = AutoToolsBuildEnvironment(self)
   env_build.configure(configure_dir="cmake-3.10.2",args=[ '--prefix=`pwd`/build' ])
   env_build.make()