Exemplo n.º 1
0
 def build(self):
     with tools.chdir(self.source_subfolder):
         #with tools.chdir(self.build_subfolder):
         #self.run("./download_dependencies.sh")
         env_build = AutoToolsBuildEnvironment(self)
         env_build.fpic = True
         #env_build.libs.append("pthread")
         env_build.defines.append("BUILD_WITH_NNAPI=false")
         env_build.defines.append("BUILD_WITH_MMAP=false")
         build_target = "all"  # "micro"?
         env_build.make(target="%s -f %s/Makefile -C %s" %
                        (build_target, self.build_subfolder, getcwd()))
Exemplo n.º 2
0
    def build(self):
        env_build = AutoToolsBuildEnvironment(
            self, win_bash=self.settings.os == 'Windows')
        env_build.fpic = True
        config_args = []
        if self.options.shared:
            config_args.extend(["--enable-shared=yes", "--enable-static=no"])
        else:
            config_args.extend(["--enable-shared=no", "--enable-static=yes"])
        if self.options.with_bzlib:
            config_args.append('--with-bzlib')
        else:
            config_args.append('--without-bzlib')
        if self.options.with_jpeg:
            config_args.append('--with-jpeg')
        else:
            config_args.append('--without-jpeg')
        if self.options.with_png:
            config_args.append('--with-png')
        else:
            config_args.append('--without-png')
        config_args.extend([
            "--without-dps", "--without-fpx", "--without-jbig",
            "--without-jp2", "--without-lcms2", "--without-lzma",
            "--with-magick-plus-plus", "--without-perl", "--without-trio",
            "--without-webp", "--without-wmf", "--with-zlib"
        ])
        prefix = os.path.abspath(self.package_folder)
        if self.settings.os == 'Windows':
            prefix = tools.unix_path(prefix)
        config_args.append("--prefix=%s" % prefix)

        env_build_vars = env_build.vars
        #GM configure script links a program with jpeg lib and tries to run it. If libjpeg is a shared library, the dynamic linker must be able to find it
        if self.settings.os == 'Linux':
            env_build_vars['LD_LIBRARY_PATH'] = ""
            if self.options.with_jpeg:
                env_build_vars['LD_LIBRARY_PATH'] += self.deps_cpp_info[
                    "libjpeg"].lib_paths[0]
            if self.options.with_png:
                if len(env_build_vars['LD_LIBRARY_PATH']) != 0:
                    env_build_vars['LD_LIBRARY_PATH'] += ':'
                env_build_vars['LD_LIBRARY_PATH'] += self.deps_cpp_info[
                    "libpng"].lib_paths[0]
        print("configure with vars")
        print(env_build_vars['LD_LIBRARY_PATH'])

        env_build.configure(configure_dir=os.path.join(self.source_folder,
                                                       self.source_subfolder),
                            args=config_args,
                            vars=env_build_vars)
        env_build.make()
        env_build.make(args=["install"])
Exemplo n.º 3
0
 def _build_linux(self):
     env_build = AutoToolsBuildEnvironment(self)
     env_build.fpic = True
     with tools.environment_append(env_build.vars):
         configure_args = [
             '--with-fc=0',
             '--prefix=../%s' % self.install_dir
         ]
         with tools.chdir(self.source_subfolder):
             env_build.configure(args=configure_args)
             env_build.make(args=["-j", "1", "all"])
             env_build.make(args=["install"])
Exemplo n.º 4
0
    def unix_build(self):
        with tools.chdir(self.subfolder):
            env_build = AutoToolsBuildEnvironment(self)
            env_build.fpic = True

            if self.settings.build_type == "Debug":
                env_build.make()  # $ make
            else:
                if self.options.shared:
                    env_build.make(["shared_lib"])  # $ make shared_lib
                else:
                    env_build.make(["static_lib"])  # $ make static_lib
Exemplo n.º 5
0
 def _build_with_autotools(self):
     build_env = AutoToolsBuildEnvironment(self)
     build_env.fpic = self.options.fPIC
     with tools.environment_append(build_env.vars):
         with tools.chdir(self._source_subfolder):
             configure_args = ['--prefix=%s' % self.package_folder]
             configure_args.append('--enable-shared' if self.options.
                                   shared else '--disable-shared')
             configure_args.append('--enable-static' if not self.options.
                                   shared else '--disable-static')
             build_env.configure(args=configure_args)
             build_env.make(args=["-s", "all"])
             build_env.make(args=["-s", "install"])
Exemplo n.º 6
0
 def build(self):
     autotools = AutoToolsBuildEnvironment(self)
     autotools.fpic = True
     env_build_vars = autotools.vars
     autotools.configure(configure_dir="fuse-2.9.9",
                         vars=env_build_vars,
                         args=[
                             "--disable-util",
                             "--disable-example",
                             "--verbose",
                         ])
     autotools.make(vars=env_build_vars)
     autotools.install(vars=env_build_vars)
 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.with_libuv:
             args.append("WITH_LIBUV=1")
         # set CPPFLAGS, CFLAGS and LDFLAGS
         args.extend("{}={}".format(key, value) for key, value in autotools.vars.items())
         autotools.make(target="default", args=args)
Exemplo n.º 8
0
    def build(self):
        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = True

        configure_args = list()
        configure_args.append('--disable-rpath')

        if (self.options.shared):
            configure_args.append('--enable-shared')
        else:
            configure_args.append('--enable-static')

        env_build.configure(args=configure_args, configure_dir="libiconv")
        env_build.make()
Exemplo n.º 9
0
    def build(self):
        name = "libtar-{version}".format(version=self.version)
        install_folder = os.path.join(name, "install")
        with tools.chdir(name):
            args = ["--prefix={}".format(os.path.abspath(install_folder))]
            if not self.options.withzlib:
                args.append("--without-zlib")

            self.run("autoreconf --force --install")
            autotools = AutoToolsBuildEnvironment(self)
            autotools.fpic = self.options.fPIC
            autotools.configure(args=args)
            autotools.make()
            autotools.install()
Exemplo n.º 10
0
    def build(self):
        with tools.chdir(self.name):
            autotools = AutoToolsBuildEnvironment(
                self, win_bash=(platform.system() == "Windows"))

            env_vars = {}
            args = []

            if 'gcc' == self.settings.compiler and 'Windows' == platform.system(
            ):
                args.append('--prefix=%s' %
                            tools.unix_path(self.package_folder))
            else:
                args.append('--prefix=%s' % self.package_folder)

            for option_name in self.options.values.fields:
                activated = getattr(self.options, option_name)
                if not re.match(r'enable|disable', option_name):
                    continue
                if activated:
                    option_name = option_name.replace("_", "-")
                    self.output.info("Activated option! %s" % option_name)
                    args.append('--%s' % option_name)

            args.append('--%s-shared' %
                        ('enable' if self.options.shared else 'disable'))
            args.append('--%s-static' %
                        ('enable' if self.options.static else 'disable'))

            if self.settings.os == "Linux" or self.settings.os == "Macos":
                autotools.fpic = True
                if self.settings.arch == 'x86':
                    env_vars['ABI'] = '32'
                    autotools.cxx_flags.append('-m32')

            # Debug
            self.output.info('Configure arguments: %s' % ' '.join(args))

            # Set up our build environment
            with tools.environment_append(env_vars):
                autotools.configure(args=args)

            autotools.make()
            if 'gcc' == self.settings.compiler and 'Windows' == self.settings.os:
                if self.env['DLLTOOL'] is not None:
                    self.run(
                        '{dlltool} --output-lib gmp.lib --input-def .libs/libgmp-3.dll.def --dllname libgmp-10.dll'
                        .format(dlltool=self.env['DLLTOOL']))
            autotools.make(args=['install'])
Exemplo n.º 11
0
    def build_with_autotools(self):
        autotools = AutoToolsBuildEnvironment(self, win_bash=self.is_mingw)

        if self.settings.os != "Windows":
            autotools.fpic = self.options.fPIC

        autotools_vars = autotools.vars
        # tweaks for mingw
        if self.is_mingw:
            # patch autotools files
            self.patch_mingw_files()

            autotools.defines.append('_AMD64_')
            autotools_vars['RCFLAGS'] = '-O COFF'
            if self.settings.arch == "x86":
                autotools_vars['RCFLAGS'] += ' --target=pe-i386'
            else:
                autotools_vars['RCFLAGS'] += ' --target=pe-x86-64'

            del autotools_vars['LIBS']

        self.output.info("Autotools env vars: " + repr(autotools_vars))

        env_run = RunEnvironment(self)
        # run configure with *LD_LIBRARY_PATH env vars
        # it allows to pick up shared openssl
        self.output.info("Run vars: " + repr(env_run.vars))
        with tools.environment_append(env_run.vars):
            with tools.chdir(self.source_subfolder):
                # autoreconf
                self.run('./buildconf', win_bash=self.is_mingw)

                # fix generated autotools files
                tools.replace_in_file("configure", "-install_name \\$rpath/",
                                      "-install_name ")

                # BUG 1420, fixed in 7.54.1
                if self.version_components[
                        0] == 7 and self.version_components[1] < 55:
                    tools.replace_in_file(
                        "configure",
                        'LDFLAGS="`$PKGCONFIG --libs-only-L zlib` $LDFLAGS"',
                        'LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"')

                self.run("chmod +x configure")
                configure_args = self.get_configure_command_args()
                autotools.configure(vars=autotools_vars, args=configure_args)
                autotools.make(vars=autotools_vars)
                autotools.install(vars=autotools_vars)
Exemplo n.º 12
0
    def build(self):
        with tools.chdir(self.source_subfolder):
            self.run("autoreconf -f -i")

            autotools = AutoToolsBuildEnvironment(self)
            autotools.fpic = True
            _args = [
                '--prefix=%s/builddir' % (os.getcwd()),
                '--libdir=%s/builddir/lib' % (os.getcwd()),
                '--disable-maintainer-mode', '--disable-silent-rules'
            ]

            autotools.configure(args=_args)
            autotools.make(args=["-j2"])
            autotools.install()
Exemplo n.º 13
0
    def build(self):
        with tools.chdir(self.name):
            autotools = AutoToolsBuildEnvironment(
                self, win_bash=(platform.system() == "Windows"))

            env_vars = {}
            args = []

            if 'gcc' == self.settings.compiler and 'Windows' == platform.system(
            ):
                args.append('--prefix=%s' %
                            tools.unix_path(self.package_folder))
            else:
                args.append('--prefix=%s' % self.package_folder)

            args.append('--%s-shared' %
                        ('enable' if self.options.shared else 'disable'))
            args.append('--%s-static' %
                        ('enable' if self.options.static else 'disable'))

            if self.settings.os == "Linux" or self.settings.os == "Macos":
                autotools.fpic = True
                if self.settings.arch == 'x86':
                    env_vars['ABI'] = '32'
                    autotools.cxx_flags.append('-m32')

            # Add GMP
            autotools.library_paths.append(
                os.path.join(self.deps_cpp_info['gmp'].rootpath,
                             self.deps_cpp_info['gmp'].libdirs[0]))
            autotools.include_paths.append(
                os.path.join(self.deps_cpp_info['gmp'].rootpath,
                             self.deps_cpp_info['gmp'].includedirs[0]))

            # Debug
            self.output.info('Configure arguments: %s' % ' '.join(args))

            # Set up our build environment
            with tools.environment_append(env_vars):
                autotools.configure(args=args)

            autotools.make()
            if 'gcc' == self.settings.compiler and 'Windows' == self.settings.os:
                if self.env['DLLTOOL'] is not None:
                    self.run(
                        '{dlltool} --output-lib mpfr.lib --input-def src/.libs/libmpfr-6.dll.def --dllname libmpfr-6.dll'
                        .format(dlltool=self.env['DLLTOOL']))
            autotools.make(args=['install'])
Exemplo n.º 14
0
 def build_Linux(self):
     autotools = AutoToolsBuildEnvironment(self)
     env_build_vars = autotools.vars
     autotools.fpic = True
     autotools.library_paths.append(self.deps_cpp_info["proj"].lib_paths[0])
     autotools.library_paths.append(self.deps_cpp_info["sqlite3"].lib_paths[0])
     autotools.libs.append(self.deps_cpp_info["sqlite3"].libs[0])
     install_dir = os.path.join(self.build_folder,"install")
     options = ["--prefix="+install_dir, "--enable-shared=no", "--enable-static=yes", "CXXFLAGS=-fPIC","CFLAGS=-fPIC"]
     if self.settings.build_type == "Debug":
         options.append("--enable-debug=yes")
     os.chdir("gdal")
     autotools.configure(args=options,vars=env_build_vars)
     autotools.make()
     autotools.install()
     os.chdir("../")
Exemplo n.º 15
0
    def build(self):
        with tools.chdir(self.source_subfolder):
            with tools.environment_append({'LIBS' : "-lm"}):
                self.run("autoreconf -f -i")

                _args = ["--prefix=%s/builddir"%(os.getcwd()), "--with-pic", "--disable-silent-rules", "--enable-introspection"]
                if self.options.shared:
                    _args.extend(['--enable-shared=yes','--enable-static=no'])
                else:
                    _args.extend(['--enable-shared=no','--enable-static=yes'])

                autotools = AutoToolsBuildEnvironment(self)
                autotools.fpic = True
                autotools.configure(args=_args)
                autotools.make(args=["-j4"])
                autotools.install()
Exemplo n.º 16
0
 def build(self):
     if self.settings.compiler == "Visual Studio":
         #Just skip on win32
         return
     self.run("./autogen.sh")
     autotools = AutoToolsBuildEnvironment(self)
     if self.options.fPIC:
         autotools.fpic = True
     autotools.configure()
     autotools.make()
     autotools.install()
     #If we're building static libraries we don't want the shared around.
     if not self.options.shared:
         for filename in Path(self.package_folder).glob('**/*.so*'):
             print("Removing shared object file at {}".format(filename))
             os.remove(str(filename))
Exemplo n.º 17
0
    def build(self):
        if self.settings.compiler == 'Visual Studio':
            # self.build_vs()
            self.output.fatal(
                "No windows support yet. Sorry. Help a fellow out and contribute back?"
            )

        with tools.chdir("sources"):
            env_build = AutoToolsBuildEnvironment(self)
            env_build.fpic = True

            config_args = []
            for option_name in self.options.values.fields:
                if (option_name == "shared"):
                    if (getattr(self.options, "shared")):
                        config_args.append("--enable-shared")
                        config_args.append("--disable-static")
                    else:
                        config_args.append("--enable-static")
                        config_args.append("--disable-shared")
                else:
                    activated = getattr(self.options, option_name)
                    if activated:
                        self.output.info(
                            "Activated option! {0}".format(option_name))
                        config_args.append("--{0}".format(option_name))

            # find the libgpg-error folder, so we can set the binary path for configuring it
            gpg_error_path = ""
            for path in self.deps_cpp_info.lib_paths:
                if "libgpg-error" in path:
                    gpg_error_path = '/lib'.join(
                        path.split("/lib")[0:-1]
                    )  #remove the final /lib. There are probably better ways to do this.
                    config_args.append("--with-libgpg-error-prefix={0}".format(
                        gpg_error_path))
                    break

            # This is a terrible hack to make cross-compiling on Travis work
            if (self.settings.arch == 'x86' and self.settings.os == 'Linux'):
                env_build.configure(
                    args=config_args, host="i686-linux-gnu"
                )  #because Conan insists on setting this to i686-linux-gnueabi, which smashes gpg-error hard
            else:
                env_build.configure(args=config_args)
            env_build.make()
Exemplo n.º 18
0
    def build_unix(self, install_folder):
        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = self.options.shared
        with tools.environment_append(env_build.vars):
            configure_command = "./configure"
            configure_command += " --prefix=" + install_folder
            configure_command += " --enable-shared=" + (
                "yes" if self.options.shared else "no")
            configure_command += " --enable-static=" + (
                "yes" if not self.options.shared else "no")

            src_path_abs = self.source_folder + "/apr-" + self.version

            with tools.chdir(src_path_abs):
                self.run(configure_command)
                self.run("make -j " + str(max(tools.cpu_count() - 1, 1)))
                self.run("make install")
Exemplo n.º 19
0
    def build_unix(self):
        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = True
        with tools.environment_append(env_build.vars):
            change_build_dir = "cd fltk && "
            configure_cmd = "./configure"
            make_cmd = "make -j%d" % (tools.cpu_count())
            self.configure_options = ""
            self.setConfigureOptions("enable-cygwin",
                                     self.options.enable_cygwin)
            self.setConfigureOptions("enable-x11", self.options.enable_x11)
            self.setConfigureOptions("enable-cairoext",
                                     self.options.enable_cairoext)
            self.setConfigureOptions("enable-cairo", self.options.enable_cairo)
            self.setConfigureOptions("enable-gl", self.options.enable_gl)
            self.setConfigureOptions("enable-shared",
                                     self.options.enable_shared)
            self.setConfigureOptions("enable-threads",
                                     self.options.enable_threads)
            self.setConfigureOptions("enable-localjpeg",
                                     self.options.enable_localjpeg)
            self.setConfigureOptions("enable-localzlib",
                                     self.options.enable_localzlib)
            self.setConfigureOptions("enable-localpng",
                                     self.options.enable_localpng)
            self.setConfigureOptions("enable-xft", self.options.enable_xft)
            self.setConfigureOptions("enable-xdbe", self.options.enable_xdbe)
            self.setConfigureOptions("enable-xfixes",
                                     self.options.enable_xfixes)
            self.setConfigureOptions("enable-xcursor",
                                     self.options.enable_xcursor)
            self.setConfigureOptions("enable-xrender",
                                     self.options.enable_xrender)

            self.configure_options += " --enable-debug=%s" % (
                "yes" if self.settings.build_type == "Debug" else "no")
            if (self.options.disable_largefile):
                self.configure_options += " --disable-largefile"

            complete_configure_cmd = change_build_dir + configure_cmd + self.configure_options
            self.output.info("Configure: " + complete_configure_cmd)
            self.run(complete_configure_cmd)

            complete_make_cmd = change_build_dir + make_cmd
            self.output.info("Make: " + complete_make_cmd)
            self.run(complete_make_cmd)
Exemplo n.º 20
0
    def build(self):
        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = self.options.fPIC
        with tools.environment_append(env_build.vars):
            with tools.chdir(self.source_subfolder):
                self.run("./bootstrap")

            config_args = []
            config_args.append('--disable-%s' %
                               ('static' if self.options.shared else 'shared'))
            config_args.append("--prefix=%s" % self.package_folder)
            config_args.append("--disable-tests")

            env_build.configure(configure_dir=self.source_subfolder,
                                args=config_args)
            env_build.make()
            env_build.make(args=["install"])
Exemplo n.º 21
0
    def build(self):
        self.output.info("")
        self.output.info("---------- build ----------")
        self.output.info("")
        self.output.info("os        : " + str(self.settings.os))
        self.output.info("arch      : " + str(self.settings.arch))
        self.output.info("build_type: " + str(self.settings.build_type))

        if self.settings.compiler == "Visual Studio":
            self.output.info("runtime   : " +
                             str(self.settings.compiler.runtime))

        with tools.chdir(self.ZIP_FOLDER_NAME):
            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
                    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.º 22
0
    def build_configure(self):
        prefix = os.path.abspath(self.package_folder)
        with tools.chdir(self._source_subfolder):
            # works for unix and mingw environments
            env_build = AutoToolsBuildEnvironment(
                self,
                win_bash=self.settings.os == 'Windows'
                and platform.system() == 'Windows')
            env_build.fpic = self.options.fPIC
            if self.settings.os == 'Windows':
                prefix = tools.unix_path(prefix)
            args = ['--prefix=%s' % prefix]
            if self.options.shared:
                args.extend(['--disable-static', '--enable-shared'])
            else:
                args.extend(['--disable-shared', '--enable-static'])
            args.append('--with-jpeg7' if self.options.
                        libjpeg7_compatibility else '--without-jpeg7')
            args.append('--with-jpeg8' if self.options.
                        libjpeg8_compatibility else '--without-jpeg8')
            args.append('--with-arith-enc' if self.options.
                        arithmetic_encoder else '--without-arith-enc')
            args.append('--with-arith-dec' if self.options.
                        arithmetic_decoder else '--without-arith-dec')
            args.append('--with-turbojpeg' if self.options.
                        turbojpeg else '--without-turbojpeg')
            args.append('--with-mem-srcdst' if self.options.
                        mem_src_dst else '--without-mem-srcdst')
            args.append('--with-12bit' if self.options.
                        enable12bit else '--without-12bit')
            args.append(
                '--with-java' if self.options.java else '--without-java')
            args.append(
                '--with-simd' if self.options.SIMD else '--without-simd')
            if self.options.fPIC:
                args.append('--with-pic')

            if self.settings.os == "Macos":
                tools.replace_in_file("configure",
                                      r'-install_name \$rpath/\$soname',
                                      r'-install_name \$soname')

            env_build.configure(args=args)
            env_build.make()
            env_build.make(args=['install'])
Exemplo n.º 23
0
 def build(self):
     self.patch()
     if self.settings.os == "Windows":
         cmake = CMake(self)
         cmake.configure(source_folder=self.lib_name)
         cmake.build()
         cmake.install()
     else:
         env_build = AutoToolsBuildEnvironment(self)
         env_build.fpic = True
         env_build.configure(configure_dir=self.lib_name,
                             args=[
                                 '--prefix',
                                 self.package_folder,
                             ],
                             build=False)
         env_build.make()
         env_build.make(args=['install'])
Exemplo n.º 24
0
    def build_make(self):
        install_dir = os.path.abspath('lz4-install')
        with tools.chdir(self.source_subfolder):
            env_build = AutoToolsBuildEnvironment(self)
            if self.settings.compiler != 'Visual Studio':
                env_build.fpic = self.options.fPIC
            with tools.environment_append(env_build.vars):
                self.run("make")
                self.run("make DESTDIR=%s install" % install_dir)

                if self.settings.os == 'Macos' and self.options.shared:
                    lib_dir = os.path.join(install_dir, 'usr', 'local', '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.º 25
0
    def build(self):
        env_build = AutoToolsBuildEnvironment(self)
        env_build.fpic = True

        configure_args = list()
        configure_args.append('--prefix=%s' %
                              (os.path.join(self.build_folder, '__install')))

        if (self.options.shared):
            configure_args.append('--enable-shared')
            configure_args.append('--disable-static')
        else:
            configure_args.append('--enable-static')
            configure_args.append('--disable-shared')

        env_build.configure(args=configure_args, configure_dir="gmp")
        env_build.make()
        env_build.make(args=["install"])
Exemplo n.º 26
0
    def _build_autotools(self):
        prefix = os.path.abspath(self.package_folder)
        rc = None
        host = None
        build = None
        if self._is_mingw_windows or self._is_msvc:
            prefix = prefix.replace('\\', '/')
            build = False
            if self.settings.arch == "x86":
                host = "i686-w64-mingw32"
                rc = "windres --target=pe-i386"
            elif self.settings.arch == "x86_64":
                host = "x86_64-w64-mingw32"
                rc = "windres --target=pe-x86-64"

        #
        # If you pass --build when building for iPhoneSimulator, the configure script halts.
        # So, disable passing --build by setting it to False.
        #
        if self.settings.os == "iOS" and self.settings.arch == "x86_64":
            build = False

        env_build = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)

        if self.settings.os != "Windows":
            env_build.fpic = self.options.fPIC

        configure_args = ['--prefix=%s' % prefix]
        if self.options.shared:
            configure_args.extend(['--disable-static', '--enable-shared'])
        else:
            configure_args.extend(['--enable-static', '--disable-shared'])

        env_vars = {}

        if rc:
            configure_args.extend(['RC=%s' % rc, 'WINDRES=%s' % rc])

        with tools.chdir(self._source_subfolder):
            with tools.environment_append(env_vars):
                self.run("autoreconf -vfi", win_bash=tools.os_info.is_windows)
                env_build.configure(args=configure_args, host=host, build=build)
                env_build.make()
                env_build.install()
Exemplo n.º 27
0
    def build(self):
        for p in self.conan_data["patches"][self.version]:
            tools.patch(**p)
        self.patch_source()

        if self.settings.os == "Linux" or self.settings.os == "Macos":
            env = AutoToolsBuildEnvironment(self)
            env.fpic = self.options.fPIC
            args = []
            if self.options.cpp_bindings:
                args.append("--enable-cxx")
            if self.settings.os == "Macos" and self.settings.compiler == "apple-clang":
                args.append("--disable-mac-universal")
            elif self.settings.os == "Linux":
                args.append("--with-alsa" if self.options.
                            with_alsa else "--without-alsa")
                args.append("--with-jack" if self.options.
                            with_jack else "--without-jack")
                if self.options.with_alsa:
                    env.flags.extend(
                        "-I%s" % p
                        for p in self.deps_cpp_info["libalsa"].include_paths
                    )  # env.include_paths does not seem to work here
            env.configure(configure_dir=self.sources_folder, args=args)
            if self.settings.os == "Macos" and self.settings.compiler == "apple-clang":
                env_args = []
                if self.options.cpp_bindings:
                    env_args.append("-j1")
                env.make(args=env_args)
            else:
                env.make(target="lib/libportaudio.la")
            if self.settings.os == "Macos" and self.options.shared:
                self.run(
                    'cd lib/.libs && for filename in *.dylib; do install_name_tool -id $filename $filename; done'
                )
        else:
            cmake = CMake(self)
            cmake.definitions[
                "MSVS"] = self.settings.compiler == "Visual Studio"
            cmake.definitions["PA_BUILD_STATIC"] = not self.options.shared
            cmake.definitions["PA_BUILD_SHARED"] = self.options.shared
            cmake.configure()
            cmake.build()
Exemplo n.º 28
0
    def _make_args(self):
        prefix = os.path.abspath(self.package_folder)
        if tools.os_info.is_windows:
            prefix = tools.unix_path(prefix)
        args = [
            "ARCH={}".format(self._make_arch),
            "PREFIX={}".format(prefix),
        ]
        autotools = AutoToolsBuildEnvironment(self)
        if self._is_msvc:
            autotools.flags.extend(
                ["-nologo", "-{}".format(self.settings.compiler.runtime)])
            autotools.link_flags.insert(0, "-link")
            if not (self.settings.compiler == "Visual Studio"
                    and tools.Version(self.settings.compiler.version) < "12"):
                autotools.flags.append("-FS")
        elif self.settings.compiler in ("apple-clang", ):
            if self.settings.arch in ("armv8", ):
                autotools.link_flags.append("-arch arm64")
        if self.options.shared:
            autotools.fpic = True
        args.extend(["{}={}".format(k, v) for k, v in autotools.vars.items()])

        if self._is_msvc:
            args.append("OS=msvc")
        else:
            if self.settings.os == "Windows":
                args.append("OS=mingw_nt")
            if self.settings.os == "Android":
                libcxx = str(self.settings.compiler.libcxx)
                stl_lib = "$(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/lib{}".format("c++_static.a" if libcxx == "c++_static" else "c++_shared.so") \
                          + "$(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/libc++abi.a"
                ndk_home = os.environ["ANDROID_NDK_HOME"]
                args.extend([
                    "NDKLEVEL={}".format(self.settings.os.api_level),
                    "STL_LIB={}".format(stl_lib),
                    "OS=android",
                    "NDKROOT={}".format(ndk_home),  # not NDK_ROOT here
                    "TARGET={}".format(self._android_target),
                    "CCASFLAGS=$(CFLAGS) -fno-integrated-as",
                ])

        return args
Exemplo n.º 29
0
 def build(self):
     with tools.chdir(self._source_subfolder):
         env_build = AutoToolsBuildEnvironment(self)
         env_build.fpic = self.options.fPIC
         args = ['--disable-wrapper-rpath', '--disable-wrapper-runpath']
         if self.settings.build_type == 'Debug':
             args.append('--enable-debug')
         if self.options.shared:
             args.extend(['--enable-shared', '--disable-static'])
         else:
             args.extend(['--enable-static', '--disable-shared'])
         args.append('--with-pic' if self.options.fPIC else '--without-pic')
         args.append('--enable-mpi-fortran=%s' % str(self.options.fortran))
         args.append('--with-zlib=%s' % self.deps_cpp_info['zlib'].rootpath)
         args.append('--with-zlib-libdir=%s' %
                     self.deps_cpp_info['zlib'].lib_paths[0])
         env_build.configure(args=args)
         env_build.make()
         env_build.install()
Exemplo n.º 30
0
    def build(self):
        with tools.chdir(self.name):
            autotools = AutoToolsBuildEnvironment(self, win_bash=(platform.system() == "Windows"))

            env_vars = {}
            args = []

            if 'gcc' == self.settings.compiler and 'Windows' == platform.system():
                args.append('--prefix=%s'%tools.unix_path(self.package_folder))
            else:
                args.append('--prefix=%s'%self.package_folder)

            for option_name in self.options.values.fields:
                activated = getattr(self.options, option_name)
                if not re.match(r'enable|disable', option_name):
                    continue
                if activated:
                    option_name = option_name.replace("_", "-")
                    self.output.info("Activated option! %s"%option_name)
                    args.append('--%s'%option_name)

            args.append('--%s-shared'%('enable' if self.options.shared else 'disable'))
            args.append('--%s-static'%('enable' if self.options.static else 'disable'))

            if self.settings.os == 'Linux' or self.settings.os == 'Macos':
                autotools.fpic = True
                if self.settings.arch == 'x86':
                    env_vars['ABI'] = '32'
                    autotools.cxx_flags.append('-m32')

            if self.settings.get_safe('arch') and self.settings.get_safe('arch').startswith('arm') and not tools.cross_building(self.settings):
                # There's an issue with the assemle gmp attempts to use when building on ARM
                args.append('--enable-assembly=no')

            # Debug
            self.output.info('Configure arguments: %s'%' '.join(args))

            # Set up our build environment
            with tools.environment_append(env_vars):
                autotools.configure(args=args)

            autotools.make()
            autotools.make(args=['install'])