def package(self): cmake = CMake(self) cmake.install() self.copy('*.a', dst='lib', keep_path=False) self.copy('*.lib', dst='lib', keep_path=False) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.cmake")
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", "pkgconfig")) if self.options.shared: tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a")
def package(self): self.copy("COPYING.LIB", 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, "symbols")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb")
def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses") if is_msvc(self): self.copy("*.h", src=os.path.join(self._source_subfolder, "libxslt"), dst=os.path.join("include", "libxslt")) self.copy("*.h", src=os.path.join(self._source_subfolder, "libexslt"), dst=os.path.join("include", "libexslt")) build_dir = os.path.join(self._source_subfolder, "win32", "bin.msvc") self.copy("*.exe", src=build_dir, dst="bin") if self.options.shared: self.copy("*xslt.lib", src=build_dir, dst="lib") self.copy("*xslt.dll", src=build_dir, dst="bin") else: self.copy("*xslt_a.lib", src=build_dir, dst="lib") else: autotools = self._configure_autotools() autotools.install() os.remove(os.path.join(self.package_folder, "bin", "xslt-config")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.remove_files_by_mask( os.path.join(self.package_folder, "lib"), "*.la") tools.remove_files_by_mask( os.path.join(self.package_folder, "lib"), "*.sh") tools.rmdir(os.path.join(self.package_folder, "share"))
def package(self): self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) if self.settings.os == "Windows": cmake = self._configure_cmake() cmake.install() else: autotools = self._configure_autotools() autotools.install() tools.rmdir(os.path.join(self.package_folder, "share", "doc")) for i in ["var", "share", "etc"]: shutil.move(os.path.join(self.package_folder, i), os.path.join(self.package_folder, "res", i)) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "systemd")) tools.remove_files_by_mask(self.package_folder, "*.la") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {"dbus-1": "dbus-1::dbus-1"})
def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) if self.settings.os == "Windows": cmake = self._configure_cmake() cmake.install() else: with tools.chdir(os.path.join(self._source_subfolder, "c++")): autotools = self._configure_autotools() autotools.install() tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) for cmake_file in glob.glob(os.path.join(self.package_folder, self._cmake_folder, "*")): if os.path.basename(cmake_file) != "CapnProtoMacros.cmake": os.remove(cmake_file) # inject mandatory variables so that CAPNP_GENERATE_CPP function can # work in a robust way (build from source or from pre build package) find_execs = textwrap.dedent("""\ if(CMAKE_CROSSCOMPILING) find_program(CAPNP_EXECUTABLE capnp PATHS ENV PATH NO_DEFAULT_PATH) find_program(CAPNPC_CXX_EXECUTABLE capnpc-c++ PATHS ENV PATH NO_DEFAULT_PATH) endif() if(NOT CAPNP_EXECUTABLE) set(CAPNP_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../../bin/capnp${CMAKE_EXECUTABLE_SUFFIX}") endif() if(NOT CAPNPC_CXX_EXECUTABLE) set(CAPNPC_CXX_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../../bin/capnpc-c++${CMAKE_EXECUTABLE_SUFFIX}") endif() set(CAPNP_INCLUDE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../../../include") function(CAPNP_GENERATE_CPP SOURCES HEADERS) """) tools.replace_in_file(os.path.join(self.package_folder, self._cmake_folder, "CapnProtoMacros.cmake"), "function(CAPNP_GENERATE_CPP SOURCES HEADERS)", find_execs)
def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) with tools.vcvars( self.settings ) if self.settings.compiler == "Visual Studio" else tools.no_op(): cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "cmake")) if self.options.get_safe("single_object"): tools.remove_files_by_mask( os.path.join(self.package_folder, "lib"), "*.a") shutil.move( os.path.join(self.package_folder, self._obj_name + ".o"), os.path.join(self.package_folder, "lib")) shutil.copy( os.path.join(self.package_folder, "lib", self._obj_name + ".o"), os.path.join(self.package_folder, "lib", self._obj_name)) if self.settings.os == "Windows" and self.options.shared: if self.settings.arch == "x86_64": self.copy("mimalloc-redirect.dll", src=os.path.join(self._source_subfolder, "bin"), dst="bin") elif self.settings.arch == "x86": self.copy("mimalloc-redirect32.dll", src=os.path.join(self._source_subfolder, "bin"), dst="bin")
def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses") if self.settings.compiler == "Visual Studio": self.copy("*.lib", src=os.path.join(self._source_subfolder, "src"), dst="lib") self.copy("*.dll", src=os.path.join(self._source_subfolder, "src"), dst="bin") self.copy("argtable2.h", src=os.path.join(self._source_subfolder, "src"), dst="include") if self.options.shared: os.rename( os.path.join(self.package_folder, "lib", "impargtable2.lib"), os.path.join(self.package_folder, "lib", "argtable2.lib")) else: autotools = self._configure_autotools() autotools.install() tools.remove_files_by_mask( os.path.join(self.package_folder, "lib"), "*.la") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share"))
def package(self): self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) if self._is_msvc: src = os.path.join(self._source_subfolder, 'src') cairo_gobject = os.path.join(self._source_subfolder, 'util', 'cairo-gobject') inc = os.path.join('include', 'cairo') self.copy(pattern="cairo-version.h", dst=inc, src=(src if tools.Version(self.version) >= "1.17.4" else self._source_subfolder)) self.copy(pattern="cairo-features.h", dst=inc, src=src) self.copy(pattern="cairo.h", dst=inc, src=src) self.copy(pattern="cairo-deprecated.h", dst=inc, src=src) self.copy(pattern="cairo-win32.h", dst=inc, src=src) self.copy(pattern="cairo-script.h", dst=inc, src=src) self.copy(pattern="cairo-ft.h", dst=inc, src=src) self.copy(pattern="cairo-ps.h", dst=inc, src=src) self.copy(pattern="cairo-pdf.h", dst=inc, src=src) self.copy(pattern="cairo-svg.h", dst=inc, src=src) self.copy(pattern="cairo-gobject.h", dst=inc, src=cairo_gobject) if self.options.shared: self.copy(pattern="*cairo.lib", dst="lib", src=src, keep_path=False) self.copy(pattern="*cairo.dll", dst="bin", src=src, keep_path=False) self.copy(pattern="*cairo-gobject.lib", dst="lib", src=cairo_gobject, keep_path=False) self.copy(pattern="*cairo-gobject.dll", dst="bin", src=cairo_gobject, keep_path=False) else: self.copy(pattern="*cairo-static.lib", dst="lib", src=src, keep_path=False) self.copy(pattern="*cairo-gobject.lib", dst="lib", src=cairo_gobject, keep_path=False) shutil.move(os.path.join(self.package_folder, 'lib', "cairo-static.lib"), os.path.join(self.package_folder, 'lib', "cairo.lib")) else: with tools.chdir(self._source_subfolder): env_build = self._get_env_build() env_build.install() tools.remove_files_by_mask(self.package_folder, "*.la") self.copy("COPYING*", src=self._source_subfolder, dst="licenses", keep_path=False) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
def package(self): self.copy("*", dst="licenses", src=os.path.join(self._source_subfolder, "LICENSES")) cmake = self._configure_cmake() cmake.install() for mask in ["Find*.cmake", "*Config*.cmake", "*-config.cmake", "*Targets*.cmake"]: tools.remove_files_by_mask(self.package_folder, mask)
def package(self): self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") tools.rmdir(os.path.join(self.package_folder, "share")) if self._is_msvc and self.options.shared: tools.rename(os.path.join(self.package_folder, "lib", "gif.dll.lib"), os.path.join(self.package_folder, "lib", "gif.lib"))
def _package_autotools(self): autotools = self._configure_autools() autotools.install() tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la")
def package(self): with tools.chdir(self._source_subfolder): autotools = self._configure_autotools() autotools.install() self.copy("LICENSE", src=self._source_subfolder, dst="licenses") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.remove_files_by_mask(self.package_folder, "*.la")
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")
def package(self): self.copy("LICENSE", dst="licenses") with tools.chdir(self._source_subfolder): autotools = self._configure_autotools() tmp_install = os.path.join(self.build_folder, "prefix") install_args = [ "DESTDIR={}".format(tmp_install), "INCDIR=/include", "ETCDIR=/etc", "USRLIBDIR=/lib", "BINDIR=/bin", ] + self._imake_make_args autotools.install(args=["-j1"] + install_args) self.copy("*", src=os.path.join(tmp_install, "bin"), dst="bin") self.copy("*", src=os.path.join(tmp_install, "include"), dst=os.path.join("include", "audio")) self.copy("*", src=os.path.join(tmp_install, "lib"), dst="lib") if self.options.shared: 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"), "*.so*")
def package(self): self.copy("README", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) if self.settings.compiler == "Visual Studio": for filename in ["jpeglib.h", "jerror.h", "jconfig.h", "jmorecfg.h"]: self.copy(pattern=filename, dst="include", src=self._source_subfolder, keep_path=False) self.copy(pattern="*.lib", dst="lib", src=self._source_subfolder, keep_path=False) if self.options.shared: self.copy(pattern="*.dll", dst="bin", src=self._source_subfolder, keep_path=False) else: autotools = self._configure_autotools() autotools.install() if self.settings.os == "Windows" and self.options.shared: tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*[!.dll]") else: tools.rmdir(os.path.join(self.package_folder, "bin")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share")) for fn in ("jpegint.h", "transupp.h",): self.copy(fn, src=self._source_subfolder, dst="include") for fn in ("jinclude.h", "transupp.c",): self.copy(fn, src=self._source_subfolder, dst="res") # Remove export decorations of transupp symbols for relpath in os.path.join("include", "transupp.h"), os.path.join("res", "transupp.c"): path = os.path.join(self.package_folder, relpath) tools.save(path, re.subn(r"(?:EXTERN|GLOBAL)\(([^)]+)\)", r"\1", tools.load(path))[0])
def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses") with self._build_context(): autotools = self._configure_autotools() # Avoid installing i18n + perl things in arch-dependent folders or in a `local` subfolder install_args = [ "INSTALLARCHLIB={}".format(os.path.join(self.package_folder, "lib").replace("\\", "/")), "INSTALLSITEARCH={}".format(os.path.join(self.build_folder, "archlib").replace("\\", "/")), "INSTALLVENDORARCH={}".format(os.path.join(self.build_folder, "archlib").replace("\\", "/")), "INSTALLSITEBIN={}".format(os.path.join(self.package_folder, "bin").replace("\\", "/")), "INSTALLSITESCRIPT={}".format(os.path.join(self.package_folder, "bin").replace("\\", "/")), "INSTALLSITEMAN1DIR={}".format(os.path.join(self.build_folder, "share", "man", "man1").replace("\\", "/")), "INSTALLSITEMAN3DIR={}".format(os.path.join(self.build_folder, "share", "man", "man3").replace("\\", "/")), ] autotools.install(args=install_args) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pod") for d in glob.glob(os.path.join(self.package_folder, "lib", "python*")): tools.rmdir(d) for d in glob.glob(os.path.join(self.package_folder, "lib", "*")): if os.path.isdir(d): tools.rmdir(d) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "Library"))
def package(self): self.copy("COPYING", dst="licenses", src=self._source_subfolder) with self._build_context(): autotools = self._configure_autotools() autotools.install() tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") tools.rmdir(os.path.join(self.package_folder, "share"))
def package(self): cmake = self._configure_cmake() cmake.install() tools.rename(src=os.path.join(self.package_folder, "include", "source_subfolder"), dst=os.path.join(self.package_folder, "include", "DiligentCore")) tools.rmdir(os.path.join(self.package_folder, "Licenses")) tools.rmdir(os.path.join(self.package_folder, "lib")) tools.rmdir(os.path.join(self.package_folder, "bin")) self.copy("License.txt", dst="licenses", src=self._source_subfolder) self.copy(pattern="*.a", dst="lib", keep_path=False) self.copy(pattern="*.lib", dst="lib", keep_path=False) self.copy(pattern="*.dylib", dst="lib", keep_path=False) self.copy(pattern="*.so", dst="lib", keep_path=False) self.copy(pattern="*.dll", dst="bin", keep_path=False) self.copy(pattern="*.fxh", dst="res", keep_path=False) self.copy("File2String*", src=os.path.join(self._build_subfolder, "bin"), dst="bin", keep_path=False) tools.remove_files_by_mask(self.package_folder, "*.pdb")
def package(self): self._configured_cmake().install() self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.remove_files_by_mask(self.package_folder, "*.pdb")
def package(self): self.copy("LICENSE.txt", 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", "cmake")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "pdal-config*")
def package(self): self.copy(pattern="COPYING", dst="licenses") autotools = self._configure_autotools() autotools.install() tools.rmdir(os.path.join(self.package_folder, "share")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la")
def package(self): cmake = self._configure_cmake() cmake.install() with open(os.path.join(self.package_folder, "bin", "qt.conf"), "w") as f: f.write("""[Paths] Prefix = .. ArchData = res/archdatadir HostData = res/archdatadir Data = res/datadir Sysconf = res/sysconfdir LibraryExecutables = res/archdatadir/bin Plugins = res/archdatadir/plugins Imports = res/archdatadir/imports Qml2Imports = res/archdatadir/qml Translations = res/datadir/translations Documentation = res/datadir/doc Examples = res/datadir/examples""") self.copy("*LICENSE*", src="qt6/", dst="licenses") for module in self._submodules: if not self.options.get_safe(module): tools.rmdir(os.path.join(self.package_folder, "licenses", module)) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la*") tools.remove_files_by_mask(self.package_folder, "*.pdb*") os.remove(os.path.join(self.package_folder, "bin", "qt-cmake-private-install.cmake"))
def package(self): self.copy(pattern="LICENSE", dst="licenses") cmake = CMake(self) cmake.definitions["ASIO_GRPC_USE_BOOST_CONTAINER"] = self.options.use_boost_container cmake.configure() cmake.install() tools.remove_files_by_mask(os.path.join(self.package_folder, "lib", "cmake", "asio-grpc"), "asio-grpc*")
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", "pkgconfig")) os.unlink( os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config-version.cmake")) os.unlink( os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-targets.cmake")) os.unlink( os.path.join( self.package_folder, self._cmake_install_base_path, "protobuf-targets-{}.cmake".format( str(self.settings.build_type).lower()))) os.rename( os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"), os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake")) if not self.options.lite: tools.remove_files_by_mask( os.path.join(self.package_folder, "lib"), "libprotobuf-lite.*") tools.remove_files_by_mask( os.path.join(self.package_folder, "bin"), "libprotobuf-lite.*")
def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) with tools.vcvars(self.settings) if microsoft.is_msvc(self) else tools.no_op(): cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "cmake")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) if self.options.get_safe("single_object"): tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a") shutil.move(os.path.join(self.package_folder, self._obj_name + ".o"), os.path.join(self.package_folder, "lib")) shutil.copy(os.path.join(self.package_folder, "lib", self._obj_name + ".o"), os.path.join(self.package_folder, "lib", self._obj_name)) if self.settings.os == "Windows" and self.options.shared: if self.settings.arch == "x86_64": self.copy("mimalloc-redirect.dll", src=os.path.join(self._source_subfolder, "bin"), dst="bin") elif self.settings.arch == "x86": self.copy("mimalloc-redirect32.dll", src=os.path.join(self._source_subfolder, "bin"), dst="bin") tools.rmdir(os.path.join(self.package_folder, "share")) cmake_target = "mimalloc" if self.options.shared else "mimalloc-static" self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {cmake_target: "mimalloc::mimalloc"} )
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, "lib", "pkgconfig")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la")
def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses") cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) # Remove vc runtimes if self.settings.os == "Windows": if self.options.shared: for dll_pattern_to_remove in [ "concrt*.dll", "msvcp*.dll", "vcruntime*.dll" ]: tools.remove_files_by_mask( os.path.join(self.package_folder, "bin"), dll_pattern_to_remove, ) else: tools.rmdir(os.path.join(self.package_folder, "bin")) # Remove static/dynamic libraries depending on the build mode libs_pattern_to_remove = [ "*flann_cpp_s.*", "*flann_s.*" ] if self.options.shared else ["*flann_cpp.*", "*flann.*"] for lib_pattern_to_remove in libs_pattern_to_remove: tools.remove_files_by_mask( os.path.join(self.package_folder, "lib"), lib_pattern_to_remove)
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")) tools.rmdir(os.path.join(self.package_folder, "cmake")) tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb")
def package(self): with tools.chdir(self._source_subfolder): self._autotools.install() self.copy("COPYING", src=self._source_subfolder, dst="licenses") with tools.chdir(os.path.join(self.package_folder, "lib")): tools.rmdir("pkgconfig") tools.remove_files_by_mask(".", "*.la")