def package(self): cmake = self._configure_cmake() cmake.install() self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "loader"))
def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses") autotools = self._configure_autotools() autotools.install() tools.rmdir(os.path.join(self.package_folder, "share"))
def _patch_files(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): tools.patch(**patch) libs_to_remove = [ "icu", "libevent", "re2", "rapidjson", "protobuf", "libedit" ] if not self._with_lz4: libs_to_remove.append("lz4") for lib in libs_to_remove: tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "MYSQL_CHECK_%s()\n" % lib.upper(), "", strict=False) tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "INCLUDE(%s)\n" % lib, "", strict=False) tools.rmdir(os.path.join(self._source_subfolder, "extra")) for folder in ["client", "man", "mysql-test", "libbinlogstandalone"]: tools.rmdir(os.path.join(self._source_subfolder, folder)) tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "ADD_SUBDIRECTORY(%s)\n" % folder, "", strict=False) tools.rmdir(os.path.join(self._source_subfolder, "storage", "ndb")) for t in ["INCLUDE(cmake/boost.cmake)\n", "MYSQL_CHECK_EDITLINE()\n"]: tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), t, "", strict=False) if self._with_zstd: tools.replace_in_file( os.path.join(self._source_subfolder, "cmake", "zstd.cmake"), "NAMES zstd", "NAMES zstd %s" % self.deps_cpp_info["zstd"].libs[0]) tools.replace_in_file( os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), "NAMES ssl", "NAMES ssl %s" % self.deps_cpp_info["openssl"].components["ssl"].libs[0]) tools.replace_in_file( os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), "NAMES crypto", "NAMES crypto %s" % self.deps_cpp_info["openssl"].components["crypto"].libs[0]) # Do not copy shared libs of dependencies to package folder deps_shared = ["SSL"] if tools.Version(self.version) > "8.0.17": deps_shared.extend( ["KERBEROS", "SASL", "LDAP", "PROTOBUF", "CURL"]) for dep in deps_shared: tools.replace_in_file( os.path.join(self._source_subfolder, "CMakeLists.txt"), "MYSQL_CHECK_{}_DLLS()".format(dep), "") sources_cmake = os.path.join(self._source_subfolder, "CMakeLists.txt") sources_cmake_orig = os.path.join(self._source_subfolder, "CMakeListsOriginal.txt") rename(self, sources_cmake, sources_cmake_orig) rename(self, "CMakeLists.txt", sources_cmake) if self.settings.os == "Macos": tools.replace_in_file( os.path.join(self._source_subfolder, "libmysql", "CMakeLists.txt"), "COMMAND %s" % ("$<TARGET_FILE:libmysql_api_test>" if tools.Version( self.version) < "8.0.25" else "libmysql_api_test"), "COMMAND DYLD_LIBRARY_PATH=%s %s" % (os.path.join(self.build_folder, "library_output_directory"), os.path.join(self.build_folder, "runtime_output_directory", "libmysql_api_test"))) tools.replace_in_file( os.path.join(self._source_subfolder, "cmake", "install_macros.cmake"), " INSTALL_DEBUG_SYMBOLS(", " # INSTALL_DEBUG_SYMBOLS(")
def package(self): self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) self.copy(pattern="*", dst="bin", src=self._source_subfolder) tools.rmdir(os.path.join(self.package_folder, "bin", "test cases"))
def package(self): self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools")) tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-link")) tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-opt")) tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-reduce")) tools.rmdir(os.path.join(self.package_folder, "SPIRV-Tools-lint")) if self.options.shared: for file_name in ["*SPIRV-Tools", "*SPIRV-Tools-opt", "*SPIRV-Tools-link", "*SPIRV-Tools-reduce"]: for ext in [".a", ".lib"]: tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), file_name + ext) else: tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*SPIRV-Tools-shared.dll") tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*SPIRV-Tools-shared*") # TODO: to remove in conan v2 once cmake_find_package* generators removed if self.options.shared: targets = {"SPIRV-Tools-shared": "spirv-tools::SPIRV-Tools"} else: targets = { "SPIRV-Tools": "spirv-tools::SPIRV-Tools", # before 2020.5, kept for conveniency "SPIRV-Tools-static": "spirv-tools::SPIRV-Tools", "SPIRV-Tools-opt": "spirv-tools::SPIRV-Tools-opt", "SPIRV-Tools-link": "spirv-tools::SPIRV-Tools-link", "SPIRV-Tools-reduce": "spirv-tools::SPIRV-Tools-reduce", } if tools.Version(self.version) >= "2021.3": targets.update({"SPIRV-Tools-lint": "spirv-tools::SPIRV-Tools-lint"}) self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), targets, )
def package(self): self.copy("COPYING", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) os.remove(os.path.join(self.package_folder, "lib", "libhdf4.settings"))
def package(self): self.copy("COPYING*", src=self._source_subfolder, dst="licenses") with self._build_context(): autotools = self._configure_autotools() autotools.install() tools.rmdir(os.path.join(self._datarootdir, "info")) tools.rmdir(os.path.join(self._datarootdir, "man")) os.unlink(os.path.join(self.package_folder, "lib", "libltdl.la")) if self.options.shared: self._rm_binlib_files_containing(self._static_ext, self._shared_ext) else: self._rm_binlib_files_containing(self._shared_ext) import re files = ( os.path.join(self.package_folder, "bin", "libtool"), os.path.join(self.package_folder, "bin", "libtoolize"), ) replaces = { "GREP": "/usr/bin/env grep", "EGREP": "/usr/bin/env grep -E", "FGREP": "/usr/bin/env grep -F", "SED": "/usr/bin/env sed", } for file in files: contents = open(file).read() for key, repl in replaces.items(): contents, nb1 = re.subn("^{}=\"[^\"]*\"".format(key), "{}=\"{}\"".format(key, repl), contents, flags=re.MULTILINE) contents, nb2 = re.subn( "^: \\$\\{{{}=\"[^$\"]*\"\\}}".format(key), ": ${{{}=\"{}\"}}".format(key, repl), contents, flags=re.MULTILINE) if nb1 + nb2 == 0: raise ConanException("Failed to find {} in {}".format( key, repl)) open(file, "w").write(contents) binpath = os.path.join(self.package_folder, "bin") if self.settings.os == "Windows": tools.rename(os.path.join(binpath, "libtoolize"), os.path.join(binpath, "libtoolize.exe")) tools.rename(os.path.join(binpath, "libtool"), os.path.join(binpath, "libtool.exe")) if self.settings.compiler == "Visual Studio" and self.options.shared: tools.rename( os.path.join(self.package_folder, "lib", "ltdl.dll.lib"), os.path.join(self.package_folder, "lib", "ltdl.lib")) # allow libtool to link static libs into shared for more platforms libtool_m4 = os.path.join(self._datarootdir, "aclocal", "libtool.m4") method_pass_all = "lt_cv_deplibs_check_method=pass_all" tools.replace_in_file( libtool_m4, "lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'", method_pass_all) tools.replace_in_file( libtool_m4, "lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'", method_pass_all)
def package(self): cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
def _package_unix(self): with tools.chdir(self._source_subfolder): env_build, env_vars = self._configure_autotools() env_build.install(vars=env_vars) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "bin"))
def package(self): self.copy("LICENSE", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
def package(self): self.copy(pattern="BSD.txt", dst="licenses", src=self._source_subfolder) self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) if self.settings.os_build == 'Windows': self.copy(pattern='*.exe', src=self._source_subfolder, dst='bin', keep_path=False) tools.rmdir(os.path.join(self.package_folder, "share"))
def package(self): self.copy("COPYING", dst="licenses", src=self._source_subfolder) autotools = self._configure_autotools() autotools.install() os.unlink(os.path.join(self.package_folder, "lib", "libfontconfig.la")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))