Exemplo n.º 1
0
 def build(self):
     args = [
         "--with-quantum-depth=16",
         "--enable-shared=yes",
         "--enable-static=no",
         "--without-bzlib",
         "--without-dps",
         "--without-fpx",
         "--without-gslib",
         "--without-jbig",
         "--without-jpeg",
         "--without-jp2",
         "--without-lcms2",
         "--without-lzma",
         "--without-magick-plus-plus",
         "--without-png",
         "--without-tiff",
         "--without-trio",
         "--without-ttf",
         "--without-umem",
         "--without-wmf",
         "--without-webp",
         "--without-x",
         "--without-xml",
         "--without-zlib",
     ]
     autotools = AutoToolsBuildEnvironment(self)
     autotools.configure(configure_dir="GraphicsMagick-1.3.28", args=args)
     autotools.make()
     autotools.install()
Exemplo n.º 2
0
 def build(self):
     with tools.chdir(self.source_subfolder):
         _args = ["--prefix=%s/builddir" % (os.getcwd())]
         autotools = AutoToolsBuildEnvironment(self)
         autotools.configure(args=_args)
         autotools.make(args=["-j4"])
         autotools.install()
Exemplo n.º 3
0
    def build_configure(self):
        without_ext = (tuple(
            extension for extension in self.extensions
            if not getattr(self.options, "with_" + extension)))

        with tools.chdir(self._source_subfolder):
            if self.settings.compiler == "Visual Studio":
                with tools.environment_append({
                        "INCLUDE":
                        self.deps_cpp_info.include_paths,
                        "LIB":
                        self.deps_cpp_info.lib_paths
                }):
                    if self.settings.arch == "x86":
                        target = "i686-mswin32"
                    elif self.settings.arch == "x86_64":
                        target = "x64-mswin64"
                    else:
                        raise Exception("Invalid arch")
                    self.run(
                        '{} --prefix={} --target={} --without-ext="{}," --with-ext="{}" --with-static-linked-ext --disable-install-doc'
                        .format(os.path.join("win32", "configure.bat"),
                                self.package_folder, target,
                                ",".join(without_ext),
                                str(self.options.get_safe("additional_exts"))))

                    # Patch in runtime settings
                    def define(line):
                        tools.replace_in_file("Makefile", "CC = cl -nologo",
                                              "CC = cl -nologo\n" + line)

                    define("RUNTIMEFLAG = -{}".format(
                        self.settings.compiler.runtime))
                    if self.settings.build_type == "Debug":
                        define("COMPILERFLAG = -Zi")
                        define("OPTFLAGS = -Od -Ob0")

                    self.run("nmake")
                    self.run("nmake install")
            else:
                win_bash = tools.os_info.is_windows
                autotools = AutoToolsBuildEnvironment(self, win_bash=win_bash)
                # Remove our libs; Ruby doesn't like Conan's help
                autotools.libs = []
                if self.settings.compiler == "clang":
                    autotools.link_flags.append("--rtlib=compiler-rt")

                args = [
                    "--with-out-ext=" + ",".join(without_ext),
                    "--with-ext=" +
                    str(self.options.get_safe("additional_exts")),
                    "--with-static-linked-ext",
                    "--disable-install-doc",
                    "--without-gmp",
                    "--enable-shared",
                ]

                autotools.configure(args=args)
                autotools.make()
                autotools.install()
Exemplo n.º 4
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}/{self.name}-{self.version}"
            , pkg_config_paths = [
                f'''{self.deps_cpp_info["xorg-util-macros"].rootpath}/share/pkgconfig'''
                , f'''{self.deps_cpp_info["xcb"].rootpath}/share/pkgconfig'''
            ]
            , args = [
                "--disable-static" if self.options.shared else "--enable-static"
                , "--enable-shared" if self.options.shared else "--disable-shared"
                , "--disable-selective-werror"
                , "--disable-strict-compilation"
                , "--disable-devel-docs"
            ]
        )
        autotools.make()
        autotools.install()
Exemplo n.º 5
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, "sis")
        shutil.copytree(os.path.join(self.source_folder, "sis"), 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.º 6
0
    def _build_autotools(self):
        prefix = os.path.abspath(self.package_folder)
        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"
            elif self.settings.arch == "x86_64":
                host = "x86_64-w64-mingw32"

        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]
        configure_args.extend(['--enable-static', '--disable-shared'])

        env_vars = {
            "FFMPEG_LIBS": "-L%s" % self.deps_cpp_info["ffmpeg"].lib_paths[0],
            "FFMPEG_CFLAGS": "-I%s" % self.deps_cpp_info["ffmpeg"].include_paths[0]
        }

        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.º 7
0
    def build_with_make(self):
        autotools = AutoToolsBuildEnvironment(self)
        sharedargs = ([
            '--enable-shared', '--disable-static'
        ] if self.options.shared else ['--enable-static', '--disable-shared'])
        autotools.configure(configure_dir=self.folder,
                            args=[
                                "--with-freetype-exec-prefix=" +
                                self.deps_cpp_info["freetype"].lib_paths[0]
                            ] + sharedargs)

        old_str = '\nLIBS = '
        new_str = '\n# Removed by conan: LIBS = '
        tools.replace_in_file("Makefile", old_str, new_str)

        old_str = '\nLIBTOOL = '
        new_str = '\nLIBS = {}\nLIBTOOL = '.format(" ".join([
            "-l%s" % lib for lib in self.deps_cpp_info.libs
        ]))  # Trust conaaaan!
        tools.replace_in_file("Makefile", old_str, new_str)

        old_str = '\nSDL_CFLAGS ='
        new_str = '\n# Removed by conan: SDL_CFLAGS ='
        tools.replace_in_file("Makefile", old_str, new_str)

        old_str = '\nSDL_LIBS ='
        new_str = '\n# Removed by conan: SDL_LIBS ='
        tools.replace_in_file("Makefile", old_str, new_str)

        autotools.make()
        autotools.install()
Exemplo n.º 8
0
    def build(self):
        env_build = AutoToolsBuildEnvironment(self)
        static_flag = 'no' if self.options.shared else 'yes'
        shared_flag = 'yes' if self.options.shared else 'no'
        libiconv_flag = 'yes' if self.options.with_libiconv else 'no'
        args = [
            '--enable-static=%s' % static_flag,
            '--enable-shared=%s' % shared_flag, '--enable-ltdl-install',
            '--enable-iconv=%s' % libiconv_flag
        ]
        if self.options.with_libiconv:
            if tools.is_apple_os(self.settings.os):
                libiconv_prefix = "/usr"
            else:
                libiconv_prefix = self.deps_cpp_info["libiconv"].rootpath
            args.append('--with-libiconv-prefix=%s' % libiconv_prefix)

        env_build.configure(configure_dir=self._source_subfolder, args=args)
        env_build.make()
        env_build.install()
        tools.rmdir(os.path.join(self.package_folder, "share"))
        tools.rmdir(os.path.join(self.package_folder, "etc"))
        tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
        os.remove(os.path.join(self.package_folder, "lib", "libodbc.la"))
        os.remove(os.path.join(self.package_folder, "lib", "libodbccr.la"))
        os.remove(os.path.join(self.package_folder, "lib", "libodbcinst.la"))
        os.remove(os.path.join(self.package_folder, "lib", "libltdl.la"))
Exemplo n.º 9
0
 def build(self):
     triple = str(self.settings.arch)+"-elf"
     #TODO swap this to use self.settings.arch
     env_build = AutoToolsBuildEnvironment(self)
     env_build.configure(configure_dir=self.source_folder+"/musl",target=triple,args=["--enable-debug","--disable-shared"]) #what goes in here preferably
     env_build.make()
     env_build.install()
Exemplo n.º 10
0
 def package(self):
     be = AutoToolsBuildEnvironment(self)
     tmp_dir = os.path.join(self.build_folder, "install")
     with tools.chdir(self._source_subfolder):
         with tools.environment_append(be.vars):
             be.install(args=["DESTDIR={}".format(tmp_dir)])
     self.copy("*", src=os.path.join(tmp_dir, "usr", "local"))
Exemplo n.º 11
0
    def build(self):
        autotools = AutoToolsBuildEnvironment(self)
        autotools.fPIC = True
        env_build_vars = autotools.vars
        configure_args = [
            "--disable-bsdtar", "--disable-bsdcat", "--disable-bsdcpio",
            "--with-zlib", "--without-bz2lib", "--without-iconv",
            "--without-lz4", "--without-lzma", "--without-lzo2",
            "--without-nettle", "--without-openssl", "--without-xml2",
            "--without-expat"
        ]

        if self.options["shared"]:
            configure_args += ["--enable-shared", "--disable-static"]
        else:
            configure_args += ["--disable-shared", "--enable-static"]

        if self.options["fPIC"]:
            configure_args += ["--with-pic"]

        autotools.configure(configure_dir="libarchive-3.3.3",
                            vars=env_build_vars,
                            args=configure_args)

        autotools.make(vars=env_build_vars)
        autotools.install(vars=env_build_vars)
    def package(self):       
        autotools = AutoToolsBuildEnvironment(self)

        with build_env_vars_set(self, append_libdirs_to_rpath = True, additional_vars_to_merge=self.fpic_env):
            autotools.configure(configure_dir=self.topdir, args=self.configure_additional_args)
            autotools.make(target=self.topdir)
            autotools.install()
Exemplo n.º 13
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", "-j1"])
                autotools.install()
Exemplo n.º 14
0
    def build(self):
        for lib in self.deps_cpp_info.deps:
            self.import_pkg_config_files(lib, self.build_folder)

        autotools = AutoToolsBuildEnvironment(self)
        env = autotools.vars
        env["PATH"] = os.getenv("PATH") + ":" + os.path.join(
            self.deps_cpp_info["glib"].rootpath, "bin")
        env["PKG_CONFIG_PATH"] = env.get("PKG_CONFIG_PATH",
                                         "") + ":" + self.build_folder

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

        with tools.environment_append(env):
            os.chdir("%s/pango" % self.build_folder)
            self.run("NOCONFIGURE=1 ./autogen.sh --disable-gtk-doc")
            autotools.pic = self.options.fPIC
            autotools.include_paths.extend(
                os.path.join(s, "harfbuzz")
                for s in self.deps_cpp_info["harfbuzz"].include_paths)

            autotools.configure(args=configure_args,
                                pkg_config_paths=[self.build_folder])
            autotools.make()
            autotools.install()
Exemplo n.º 15
0
 def build_configure(self):
     win_bash = tools.os_info.is_windows
     if self.settings.compiler == "Visual Studio":
         make_vars = {
             "MMX": "on" if self.settings.arch == "x86" else "off",
             "SSE2": "on",
             "SSSE3": "on",
             "CFG": str(self.settings.build_type).lower(),
         }
         tools.replace_in_file(
             os.path.join(self.folder, 'Makefile.win32.common'), '-MDd ',
             '-%s ' % str(self.settings.compiler.runtime))
         tools.replace_in_file(
             os.path.join(self.folder, 'Makefile.win32.common'), '-MD ',
             '-%s ' % str(self.settings.compiler.runtime))
         var_args = " ".join("{}={}".format(k, v)
                             for k, v in make_vars.items())
         self.run("make -C {}/pixman -f Makefile.win32 {}".format(
             self.folder, var_args),
                  win_bash=win_bash)
     else:
         args = ["--disable-libpng", "--disable-gtk"]
         if self.options.shared:
             args.extend(["--enable-shared", "--disable-static"])
         else:
             args.extend(["--enable-static", "--disable-shared"])
         autotools = AutoToolsBuildEnvironment(self, win_bash=win_bash)
         if self.settings.os != 'Windows':
             autotools.pic = self.options.fPIC
         autotools.configure(configure_dir=self.folder, args=args)
         autotools.make(target="pixman")
         autotools.install()
Exemplo n.º 16
0
    def build(self):

        # the previous step might hang when converting from ISO-8859-2 to UTF-8 late in the build process
        os.unlink(os.path.join(self._source_subfolder, "po", "ro.po"))
        build = None
        host = None
        rc = None
        env = dict()
        args = [
            "--disable-dependency-tracking", "--disable-nls",
            "--disable-languages", "--disable-doc", "--disable-tests"
        ]
        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(["--disable-shared", "--enable-static"])
        if self.settings.os == "Linux" and self.settings.arch == "x86":
            host = "i686-linux-gnu"

        with tools.chdir(self._source_subfolder):
            with tools.environment_append(env):
                env_build = AutoToolsBuildEnvironment(
                    self, win_bash=tools.os_info.is_windows)
                env_build.configure(args=args, build=build, host=host)
                env_build.make()
                env_build.install()
Exemplo n.º 17
0
    def _build_install_binutils(self, target):
        autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
        conf_args = [
            "--prefix={}".format(os.path.join(self.package_folder, target).replace("\\", "/")),
            "--disable-build-warnings",
            "--target={}".format(target),
        ]
        autotools.flags.extend(["-DSTDC_HEADERS", "-D_FORTIFY_SOURCE=0"])

        host = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler))
        build = tools.get_gnu_triplet(tools.detected_os(), tools.detected_architecture(), "gcc")
        if tools.os_info.is_windows:
            build = "{}-w64-mingw32".format({
                "x86": "i686",
            }.get(str(tools.detected_architecture()), str(tools.detected_architecture())))
        if self.settings.os == "Windows":
            host = "{}-w64-mingw32".format({
                "x86": "i686",
            }.get(str(self.settings.arch), str(self.settings.arch)))

        build_folder = os.path.join("build_binutils_{}".format(target))
        tools.mkdir(build_folder)
        with tools.chdir(build_folder):
            self.output.info("Building binutils for target={}".format(target))
            autotools.configure(args=conf_args, configure_dir=os.path.join(self.source_folder, "binutils"), build=build, host=host)
            autotools.make()
            autotools.install()
Exemplo n.º 18
0
    def build_with_make(self):
        win_bash = tools.os_info.detect_windows_subsystem() == "msys2"
        with tools.environment_append(RunEnvironment(self).vars):
            self.run("./autogen.sh", win_bash=win_bash, cwd=self._source_subfolder)

        autotools = AutoToolsBuildEnvironment(self, win_bash=win_bash)
        args = [
            "--with-freetype-prefix=" + self.deps_cpp_info["freetype"].rootpath,
            "--with-sdl-prefix=" + self.deps_cpp_info["sdl2"].rootpath,
        ]
        if self.options.shared:
            args.extend(['--enable-shared', '--disable-static'])
        else:
            args.extend(['--enable-static', '--disable-shared'])
        autotools.configure(configure_dir=self._source_subfolder, args=args)

        patches = (
            ('\nnoinst_PROGRAMS = ', '\n# Removed by conan: noinst_PROGRAMS = '),
            ('\nLIBS = ', '\n# Removed by conan: LIBS = '),
            ('\nLIBTOOL = ', '\nLIBS = {}\nLIBTOOL = '.format(" ".join(["-l%s" % lib for lib in self.deps_cpp_info.libs]))),
            ('\nSDL_CFLAGS =', '\n# Removed by conan: SDL_CFLAGS ='),
            ('\nSDL_LIBS =' , '\n# Removed by conan: SDL_LIBS ='),
        )

        for old_str, new_str in patches:
            tools.replace_in_file("Makefile", old_str, new_str)

        autotools.make()
        autotools.install()
Exemplo n.º 19
0
    def build(self):
        os.unlink("musl/arch/{}/syscall_arch.h".format(self._find_arch()))
        # this will remove set_thread_area which is just a regular function now
        os.unlink("musl/src/thread/{}/__set_thread_area.s".format(
            self._find_arch()))
        host = self._find_host_arch() + "-pc-linux-gnu"
        triple = self._find_arch() + "-elf"
        args = ["--disable-shared", "--disable-gcc-wrapper"]
        if (self.settings.build_type == "Debug"):
            args.append("--enable-debug")
        env_build = AutoToolsBuildEnvironment(self)
        if str(self.settings.compiler) == 'clang':
            env_build.flags = [
                "-g", "-target {}-pc-linux-gnu".format(self._find_arch())
            ]
            args.append("--target={}-pc-linux-gnu".format(self._find_arch()))

        #TODO fix this is only correct if the host is x86_64
        if str(self.settings.compiler) == 'gcc':
            if self._find_arch() == "x86_64":
                env_build.flags = ["-g", "-m64"]
            if self._find_arch() == "i386":
                env_build.flags = ["-g", "-m32"]

        if self.settings.build_type == "Debug":
            env_build.flags += ["-g"]
        env_build.configure(configure_dir=self.source_folder + "/musl",
                            host=host,
                            target=triple,
                            args=args)  #what goes in here preferably
        env_build.make()
        env_build.install()
Exemplo n.º 20
0
 def package(self):
     self.copy("*LICENSE", src=self._source_subfolder, dst="licenses", keep_path=False)
     if self.settings.compiler == "Visual Studio":
         self.copy("*.h", src=os.path.join(self._source_subfolder, "include"), dst="include")
         self.copy("*.dll", src=os.path.join(self._source_subfolder, "vs2015", "build"), dst="bin")
         self.copy("*.lib", src=os.path.join(self._source_subfolder, "vs2015", "build"), dst="lib")
         os.rename(os.path.join(self.package_folder, "lib", "Argon2OptDll.lib"),
                   os.path.join(self.package_folder, "lib", "argon2.lib"))
     else:
         autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
         with tools.chdir(self._source_subfolder):
             with tools.environment_append(autotools.vars):
                 autotools.install(args=self._make_args)
         # drop unneeded dirs
         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
         tools.rmdir(os.path.join(self.package_folder, "bin"))
         if self.settings.os == "Windows" and self.options.shared:
             os.unlink(os.path.join(self.package_folder, "lib", "libargon2.a"))
             self.copy("libargon2.dll.a", src=self._source_subfolder, dst="lib")
             tools.mkdir(os.path.join(self.package_folder, "bin"))
             os.rename(os.path.join(self.package_folder, "lib", "libargon2.dll"),
                       os.path.join(self.package_folder, "bin", "libargon2.dll"))
         # drop unneeded libs
         if self.options.shared:
             if self.settings.os != "Windows":
                 tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a*")
         else:
             tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.dll")
             tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so")
             tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so.*")
             tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.dylib")
Exemplo n.º 21
0
class LibevConan(ConanFile):
    name = "libev"
    version = "4.24"
    license = "http://cvs.schmorp.de/libev/LICENSE?view=markup"
    url = "http://software.schmorp.de/pkg/libev.html"
    description = "A full-featured and high-performance event loop that is loosely modelled after libevent, but without its limitations and bugs."
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False]}
    default_options = "shared=True"
    generators = "cmake"
    exports_sources = ["FindLibev.cmake"]

    def source(self):
        self.run("wget http://dist.schmorp.de/libev/libev-4.24.tar.gz")
        self.run("tar xf libev-4.24.tar.gz")

    def build(self):
        self.autotools = AutoToolsBuildEnvironment(self)
        self.autotools.configure(configure_dir="libev-4.24")
        self.autotools.make()

    def package(self):
        self.autotools.install()
        self.copy("FindLibev.cmake", ".", ".")

    def package_info(self):
        self.cpp_info.libs = ["ev"]
Exemplo n.º 22
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}/libXdmcp-{self.version}",
            pkg_config_paths=[
                f'''{self.deps_cpp_info["xorg-util-macros"].rootpath}/share/pkgconfig''',
                f'''{self.deps_cpp_info["xorgproto"].rootpath}/share/pkgconfig'''
            ],
            args=[
                "--disable-static" if self.options.shared else
                "--enable-static", "--enable-shared" if self.options.shared
                else "--disable-shared", "--disable-selective-werror",
                "--disable-strict-compilation", "--disable-lint-library",
                "--disable-unit-tests", "--without-xmlto", "--without-fop",
                "--without-xsltproc", "--without-lint"
            ])
        autotools.make()
        autotools.install()
Exemplo n.º 23
0
    def _build_configure(self):
        with tools.chdir(self._source_subfolder):
            args = ['--disable-cli']
            if self.options.shared:
                args.append('--enable-shared')
            else:
                args.append('--enable-static')
            if self.settings.os != 'Windows' and self.options.fPIC:
                args.append('--enable-pic')
            if self.settings.build_type == 'Debug':
                args.append('--enable-debug')
            args.append('--bit-depth=%s' % str(self.options.bit_depth))
            if self.settings.os == "Android":
                if str(self.settings.arch).startswith('armv7'):
                    args.append('--host=arm-linux')
                elif str(self.settings.arch).startswith('armv8'):
                    args.append('--host=aarch64-linux')

            env_vars = dict()
            env_vars['PATH'] = [self.source_folder]
            if self._is_msvc:
                env_vars['CC'] = 'cl'
            with tools.environment_append(env_vars):
                env_build = AutoToolsBuildEnvironment(
                    self, win_bash=tools.os_info.is_windows)
                if self._is_msvc:
                    env_build.flags.append('-%s' %
                                           str(self.settings.compiler.runtime))
                    # cannot open program database ... if multiple CL.EXE write to the same .PDB file, please use /FS
                    env_build.flags.append('-FS')
                env_build.configure(args=args, build=False, host=False)
                env_build.make()
                if not (self.settings.os == "Android"
                        and tools.os_info.is_windows):
                    env_build.install()
Exemplo n.º 24
0
 def package(self):
     be = AutoToolsBuildEnvironment(self)
     re = RunEnvironment(self)
     with tools.chdir(self._source_subfolder):
         with tools.environment_append(be.vars):
             with tools.environment_append(re.vars):
                 be.install()
Exemplo n.º 25
0
    def build_configure(self):
        with tools.chdir(self._source_subfolder):
            # disable build of test suite
            tools.replace_in_file(os.path.join('test', 'Makefile.am'), 'noinst_PROGRAMS = cairo-test-suite$(EXEEXT)',
                                  '')
            os.makedirs('pkgconfig')
            for lib in ['libpng', 'zlib', 'pixman']:
                self.copy_pkg_config(lib)

            if self.options.enable_ft:
                self.copy_pkg_config('freetype')
                tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "src", "cairo-ft-font.c"),
                                      '#if HAVE_UNISTD_H', '#ifdef HAVE_UNISTD_H')

            pkg_config_path = os.path.abspath('pkgconfig')
            pkg_config_path = tools.unix_path(pkg_config_path) if self.settings.os == 'Windows' else pkg_config_path

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

            env_build = AutoToolsBuildEnvironment(self)
            if self.settings.os == 'Macos':
                env_build.link_flags.extend(['-framework CoreGraphics',
                                             '-framework CoreFoundation'])
            if str(self.settings.compiler) in ['gcc', 'clang', 'apple-clang']:
                env_build.flags.append('-Wno-enum-conversion')
            with tools.environment_append(env_build.vars):
                self.run('PKG_CONFIG_PATH=%s NOCONFIGURE=1 ./autogen.sh' % pkg_config_path)
                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.º 26
0
 def package_linux(self):
     autotools = AutoToolsBuildEnvironment(self)
     autotools.install()
     # Delete all shared-objects for static-mode, since we cannot prevent building them
     if not self.options.shared:
         for shared_object in glob.iglob(os.path.join(self.package_folder, "lib", "lib*.so*")):
             os.remove(shared_object)
Exemplo n.º 27
0
    def build_configure(self):
        # works for unix and mingw environments
        env_build = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_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"])
        prefix = os.path.abspath(self.package_folder)
        if tools.os_info.is_windows:
            prefix = tools.unix_path(prefix)
        config_args.append("--prefix=%s" % prefix)

        # mingw-specific
        if self.settings.os == 'Windows':
            if self.settings.arch == "x86_64":
                config_args.append('--build=x86_64-w64-mingw32')
                config_args.append('--host=x86_64-w64-mingw32')
            if self.settings.arch == "x86":
                config_args.append('--build=i686-w64-mingw32')
                config_args.append('--host=i686-w64-mingw32')

        env_build.configure(configure_dir=self.source_subfolder, args=config_args)
        env_build.make()
        env_build.install()
Exemplo n.º 28
0
 def package(self):
     with tools.chdir(self.build_folder):
         autoTools = AutoToolsBuildEnvironment(self)
         autoTools.install()
     self.copy("COPYING",
               src=os.path.join(self.source_folder, self._source_subfolder),
               dst="licenses")
Exemplo n.º 29
0
    def build(self):
        autotools = AutoToolsBuildEnvironment(self)
        autotools.fpic = True
        env_build_vars = autotools.vars
        self.run("cd squashfuse.git && ./autogen.sh")

        lzma_libs_dir = self.deps_cpp_info["lzma"].lib_paths[0]
        autotools.configure(configure_dir="squashfuse.git",
                            vars=env_build_vars,
                            args=[
                                "--disable-demo", "--disable-high-level",
                                "--without-lzo", "--without-lz4",
                                "--with-xz=%s" % lzma_libs_dir
                            ])

        # https://github.com/vasi/squashfuse/issues/12
        self.run(
            "cd squashfuse.git && sed -i \"/PKG_CHECK_MODULES.*/,/,:./d\" configure"
        )

        # off_t's size might differ, see https://stackoverflow.com/a/9073762
        self.run(
            "cd squashfuse.git && sed -i \"s/typedef off_t sqfs_off_t/typedef int64_t sqfs_off_t/g\" common.h"
        )

        autotools.make(vars=env_build_vars)
        autotools.install(vars=env_build_vars)
Exemplo n.º 30
0
    def build(self):
        self.run('sh autogen.sh')

        autotools = AutoToolsBuildEnvironment(self)

        args = []

        if self.options.shared:
            args.append('--enable-static=no')
        else:
            args.append('--enable-shared=no')

        if 'Rel' in self.settings.build_type:
            args.append('--disable-debug')

        if not self.options.cli:
            args.append('--enable-cli=no')

        autotools.configure(args=args)

        autotools.install()

        def here(*args):
            return os.path.join(self.package_folder, *args)

        shutil.rmtree(here('share'))
        shutil.rmtree(here('lib', 'pkgconfig'))
        for path in glob.iglob(here('lib', '*.la')):
            os.remove(path)