def build(self): with tools.chdir(self.ZIP_FOLDER_NAME): if not tools.OSInfo().is_windows: env_build = AutoToolsBuildEnvironment(self) if self.settings.arch == "x86" or self.settings.arch == "x86_64": 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) # Zlib configure doesnt allow this parameters (in 1.2.8) env_build.configure("./", build=False, host=False, target=False) env_build.make() else: files.mkdir("_build") with tools.chdir("_build"): cmake = CMake(self) cmake.configure(build_dir=".") cmake.build(build_dir=".")
def system_requirements(self): pack_names = [] os_info = tools.OSInfo() if os_info.with_apt: pack_names = ["texlive-latex-base", "imagemagick"] elif os_info.with_pacman: pack_names = ["texlive-core", "imagemagick"] elif os_info.with_yum: pack_names = ["texlive-latex", "imagemagick"] for package in pack_names: installer = tools.SystemPackageTool() installer.install(package)
def build_requirements(self): if self.options.build_testing: self.build_requires("doctest/2.3.4@bincrafters/stable") installer = SystemPackageTool() if self.options.build_docs: os_info = tools.OSInfo() if os_info.with_pacman: installer.install("ruby-ronn") if os_info.with_yum: installer.install("rubygem-ronn") if os_info.with_apt: installer.install("ruby-ronn")
def config_options(self): os_info = tools.OSInfo() if os_info.is_linux: self.options.host_os = "Linux" elif os_info.is_windows: self.options.host_os = "Windows" elif os_info.is_macos: self.options.host_os = "Macos" else: raise Exception("Unsupported platform") import sys is_64bits = sys.maxsize > 2**32 if is_64bits: self.options.host_arch = "x86_64" else: self.options.host_arch = "x86"
def system_requirements(self): if self._settings_build.os == "Linux" and self.settings.os == "Linux": if self.options.enable_udev: package_tool = tools.SystemPackageTool(conanfile=self) libudev_name = "" os_info = tools.OSInfo() if os_info.with_apt: libudev_name = "libudev-dev" elif os_info.with_yum: libudev_name = "libudev-devel" elif os_info.with_zypper: libudev_name = "libudev-devel" elif os_info.with_pacman: libudev_name = "libsystemd systemd" else: self.output.warn("Could not install libudev: Undefined package name for current platform.") return package_tool.install(packages=libudev_name, update=True)
def system_requirements(self): pack_names = [] os_info = tools.OSInfo() if os_info.with_apt: pack_names = [ "texlive-latex-extra", "texlive-fonts-recommended", "texlive-generic-recommended", "texlive-publishers" ] elif os_info.with_pacman: pack_names = ["texlive-latexextra", "texlive-publishers"] elif os_info.with_yum: pack_names = [ "texlive-collection-latexextra", "texlive-wasysym", "tex(ulem.sty)", "texlive-collection-publishers" ] for package in pack_names: installer = tools.SystemPackageTool() installer.install(package)
def system_requirements(self): if self.settings.os == "Linux": if self.options.enable_udev: package_tool = tools.SystemPackageTool() libudev_name = "" os_info = tools.OSInfo() if os_info.with_apt: libudev_name = "libudev-dev" if tools.detected_architecture() == "x86_64" and str( self.settings.arch) == "x86": libudev_name += ":i386" elif "x86" in tools.detected_architecture( ) and "arm" in str(self.settings.arch): libudev_name += ":armhf" elif os_info.with_yum: libudev_name = "libudev-devel" if tools.detected_architecture() == "x86_64" and str( self.settings.arch) == "x86": libudev_name += ".i686" else: raise Exception( "Could not install libudev: Undefined package name for platform." ) package_tool.install(packages=libudev_name, update=True)
def system_requirements(self): if tools.cross_building(self): self.output.info("Cross-compiling, not installing system packages") return os_info = tools.OSInfo() if os_info.with_apt: pm = "apt" elif os_info.with_pacman: pm = "pacman" elif os_info.with_yum: pm = "yum" elif os_info.is_freebsd: pm = "freebsd" else: self.output.warn("Don't know how to install packages.") return installer = tools.SystemPackageTool(conanfile=self) if self.options.magic: installer.install({ "apt": "libmagic-dev", "pacman": "file", "yum": "file-devel", "freebsd": [], }[pm]) if self.options.exif: installer.install({ "apt": "libexif-dev", "pacman": "libexif", "yum": "libexif-devel", "freebsd": "libexif", }[pm]) if self.options.matroska: installer.install({ "apt": "libmatroska-dev", "pacman": "libmatroska", "yum": "libmatroska-devel", "freebsd": "libmatroska", }[pm]) if self.options.ffmpeg: installer.install({ "apt": "libavformat-dev", "pacman": "ffmpeg", "yum": "ffmpeg-devel", "freebsd": "ffmpeg", }[pm]) if self._needs_system_uuid: installer.install({ "apt": "uuid-dev", "pacman": [], "yum": [], "freebsd": [] }[pm]) if self.options.ffmpegthumbnailer: installer.install({ "apt": "libffmpegthumbnailer-dev", "pacman": "ffmpegthumbnailer", "yum": "ffmpegthumbnailer-devel", "freebsd": "ffmpegthumbnailer", }[pm])
def _needs_system_uuid(self): if self.options.ffmpeg: os_info = tools.OSInfo() # ffmpeg on Ubuntu has libuuid as a deep transitive dependency # and fails to link otherwise. return os_info.with_apt
def detected_os(): if tools.OSInfo().is_macos: return "Macos" if tools.OSInfo().is_windows: return "Windows" return platform.system()
def build_requirements(self): if tools.OSInfo().is_linux: installer = SystemPackageTool() installer.install("ragel")
def system_requirements(self): if tools.cross_building(self): self.output.info("Cross-compiling, not installing system packages") return os_info = tools.OSInfo() if os_info.with_apt: pm = "apt" elif os_info.with_pacman: pm = "pacman" elif os_info.with_yum: pm = "yum" elif os_info.is_freebsd: pm = "freebsd" else: self.output.warn("Don't know how to install packages.") return installer = tools.SystemPackageTool(conanfile=self) if self.options.magic: installer.install({ "apt": "libmagic-dev", "pacman": "file-dev", "yum": "file-devel", "freebsd": [], }[pm]) if self.options.taglib: installer.install({ "apt": "libtag1-dev", "pacman": "taglib-dev", "yum": "libtag-devel", "freebsd": "taglib", }[pm]) if self.options.exif: installer.install({ "apt": "libexif-dev", "pacman": "libexif-dev", "yum": "libexif-devel", "freebsd": "libexif", }[pm]) if self.options.matroska: installer.install({ "apt": "libmatroska-dev", "pacman": "libmatroska-dev", "yum": "libmatroska-devel", "freebsd": "libmatroska", }[pm]) # Note: there is a CURL Conan package, but it depends on openssl # which is also in Conan. if self.options.curl: installer.install({ "apt": "libcurl4-openssl-dev", "pacman": "curl-dev", "yum": "libcurl-devel", "freebsd": "curl", }[pm]) if self.options.mysql: installer.install({ "apt": "libmariadb-dev", "pacman": "mariadb-connector-c-dev", "yum": "mariadb-connector-c-devel", "freebsd": "mysql-connector-c", }[pm]) if self.options.ffmpeg: installer.install({ "apt": "libavformat-dev", "pacman": "ffmpeg-dev", "yum": "ffmpeg-devel", "freebsd": "ffmpeg", }[pm]) if self._needs_system_uuid: installer.install({ "apt": "uuid-dev", "pacman": [], "yum": [], "freebsd": [] }[pm]) if self.options.ffmpegthumbnailer: installer.install({ "apt": "libffmpegthumbnailer-dev", "pacman": "ffmpegthumbnailer-dev", "yum": "ffmpegthumbnailer-devel", "freebsd": "ffmpegthumbnailer", }[pm])