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()
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()
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()
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 pc_name in glob.glob('%s/*.pc' % self.build_folder): shutil.copy( pc_name, os.path.join('pkgconfig', os.path.basename(pc_name))) if self.options.enable_ft: 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.settings.os != "Windows": configure_args.append('--enable-fc' if self.options. enable_fc else '--disable-fc') if self.settings.os == 'Linux': configure_args.append('--enable-xlib' if self.options. enable_xlib else '--disable-xlib') configure_args.append( '--enable-xlib_xrender' if self.options. enable_xlib_xrender else '--disable-xlib_xrender') configure_args.append('--enable-xcb' if self.options. enable_xcb else '--disable-xcb') configure_args.append('--enable-gobject' if self.options. enable_glib else '--disable-gobject') 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()
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()
def build(self): if self.settings.os == "Windows": cfg = str(self.settings.build_type).lower() debug_suffix = "d" if self.settings.build_type == "Debug" else "" pixman_includedir = "pixman/pixman" pixman_libdir = "pixman/pixman/%s" % cfg os.makedirs(pixman_libdir) h_files = glob.glob('%s/include/pixman-1/*.h' % self.deps_cpp_info["pixman"].rootpath) for x in h_files: shutil.copy(x, pixman_includedir) lib_files = glob.glob('%s/lib/*.lib' % self.deps_cpp_info["pixman"].rootpath) for x in lib_files: shutil.copy(x, pixman_libdir) if self.options.png: libpng_dir = "libpng" os.makedirs(libpng_dir) h_files = glob.glob('%s/include/*.h' % self.deps_cpp_info["libpng"].rootpath) for x in h_files: shutil.copy(x, libpng_dir) libpng_file = '%s/lib/libpng16%s.lib' % ( self.deps_cpp_info["libpng"].rootpath, debug_suffix) shutil.copy(libpng_file, libpng_dir) zlib_dir = "zlib" os.makedirs(zlib_dir) zlib_file = '%s/lib/zlib.lib' % self.deps_cpp_info[ "zlib"].rootpath shutil.copy(zlib_file, zlib_dir) with tools.chdir(self.source_subfolder): features = "build/Makefile.win32.features" common = "build/Makefile.win32.common" tools.replace_in_file(features, "CAIRO_HAS_PDF_SURFACE=1", "CAIRO_HAS_PDF_SURFACE=0") tools.replace_in_file(features, "CAIRO_HAS_PS_SURFACE=1", "CAIRO_HAS_PS_SURFACE=0") tools.replace_in_file(features, "CAIRO_HAS_SCRIPT_SURFACE=1", "CAIRO_HAS_SCRIPT_SURFACE=0") if self.options.png: tools.replace_in_file( common, "CAIRO_LIBS += $(LIBPNG_PATH)/libpng.lib", "CAIRO_LIBS += $(LIBPNG_PATH)/libpng16%s.lib $(top_builddir)/../zlib/zlib.lib" % debug_suffix) else: tools.replace_in_file(features, "CAIRO_HAS_PNG_FUNCTIONS=1", "CAIRO_HAS_PNG_FUNCTIONS=0") if self.options.svg: #TODO pass else: tools.replace_in_file(features, "CAIRO_HAS_SVG_SURFACE=1", "CAIRO_HAS_SVG_SURFACE=0") with tools.vcvars(self.settings): self.run( "make -f Makefile.win32 CFG={cfg}".format(cfg=cfg)) else: with tools.chdir(self.source_subfolder): env_build = AutoToolsBuildEnvironment(self) env_build.pic = self.options.fPIC def yes_no(b): return "yes" if b else "no" args = [ "--enable-shared={}".format(yes_no(self.options.shared)), "--enable-static={}".format( yes_no(not self.options.shared)), "--enable-png={}".format(yes_no(self.options.png)), "--enable-svg={}".format(yes_no(self.options.svg)), ] env_vars = env_build.vars pkg_config_paths = [ os.path.join(self.deps_cpp_info["pixman"].rootpath, "lib", "pkgconfig") ] if self.options.png: pkg_config_paths.append( os.path.join(self.deps_cpp_info["libpng"].rootpath, "lib", "pkgconfig")) env_vars["PKG_CONFIG_PATH"] = ":".join(pkg_config_paths) env_build.configure(args=args, vars=env_vars) env_build.make() env_build.install()