Beispiel #1
0
    def package(self):
        self.copy("LICENSE", src=self._source_subfolder, dst="licenses")

        self.copy("*.h", src=os.path.join(self._source_subfolder, "client"), dst=os.path.join("include", "client"))
        self.copy("*.h", src=os.path.join(self._source_subfolder, "util"), dst=os.path.join("include", "util"))
        self.copy("*.h", src=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "base"), dst=os.path.join("include", "base"))
        self.copy("*.h", src=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "build"), dst=os.path.join("include", "build"))
        self.copy("*.h", src=os.path.join(self._source_subfolder, "out", "Default", "gen", "build"), dst=os.path.join("include", "build"))

        self.copy("*.a", src=os.path.join(self._source_subfolder, "out", "Default"), dst="lib", keep_path=False)

        self.copy("*.lib", src=os.path.join(self._source_subfolder, "out", "Default"), dst="lib", keep_path=False)
        self.copy("crashpad_handler", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False)
        self.copy("crashpad_handler.exe", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False)
        self.copy("crashpad_handler_com.com", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False)
        if self.settings.os == "Windows":
            tools.rename(os.path.join(self.package_folder, "bin", "crashpad_handler_com.com"),
                         os.path.join(self.package_folder, "bin", "crashpad_handler.com"))

        # Remove accidentally copied libraries. These are used by the executables, not by the libraries.
        tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*getopt*")

        tools.save(os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake"),
                   textwrap.dedent("""\
                    if(TARGET crashpad::mini_chromium_base)
                        target_compile_features(crashpad::mini_chromium_base INTERFACE cxx_std_14)
                    endif()
                   """))
Beispiel #2
0
    def build(self):
        for patch in self.conan_data.get("patches", {}).get(self.version, []):
            tools.patch(**patch)

        if self.settings.compiler == "Visual Studio":
            tools.replace_in_file(os.path.join(self._source_subfolder, "third_party", "zlib", "BUILD.gn"),
                                  "libs = [ \"z\" ]",
                                  "libs = [ {} ]".format(", ".join("\"{}.lib\"".format(l) for l in self.deps_cpp_info["zlib"].libs)))

        if self.settings.compiler == "gcc":
            toolchain_path = os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "build", "config", "BUILD.gn")
            # Remove gcc-incompatible compiler arguments
            for comp_arg in ("-Wheader-hygiene", "-Wnewline-eof", "-Wstring-conversion", "-Wexit-time-destructors", "-fobjc-call-cxx-cdtors", "-Wextra-semi", "-Wimplicit-fallthrough"):
                tools.replace_in_file(toolchain_path,
                                      "\"{}\"".format(comp_arg), "\"\"")

        autotools = AutoToolsBuildEnvironment(self)
        extra_cflags = autotools.flags + ["-D{}".format(d) for d in autotools.defines]
        extra_cflags_c = []
        extra_cflags_cc = autotools.cxx_flags
        extra_ldflags = autotools.link_flags
        if self.options.get_safe("fPIC"):
            extra_cflags.append("-fPIC")
        extra_cflags.extend("-I {}".format(inc) for inc in autotools.include_paths)
        extra_ldflags.extend("-{}{}".format("LIBPATH:" if self.settings.compiler == "Visual Studio" else "L ", libdir) for libdir in autotools.library_paths)
        if self.settings.compiler == "clang":
            if self.settings.compiler.get_safe("libcxx"):
                stdlib = {
                    "libstdc++11": "libstdc++",
                }.get(str(self.settings.compiler.libcxx), str(self.settings.compiler.libcxx))
                extra_cflags_cc.append("-stdlib={}".format(stdlib))
                extra_ldflags.append("-stdlib={}".format(stdlib))
        gn_args = [
            "host_os=\\\"{}\\\"".format(self._gn_os),
            "host_cpu=\\\"{}\\\"".format(self._gn_arch),
            "is_debug={}".format(str(self.settings.build_type == "Debug").lower()),
            "crashpad_http_transport_impl=\\\"{}\\\"".format(self._http_transport_impl),
            "crashpad_use_boringssl_for_http_transport_socket={}".format(str(self.options.get_safe("with_tls", False) != False).lower()),
            "extra_cflags=\\\"{}\\\"".format(" ".join(extra_cflags)),
            "extra_cflags_c=\\\"{}\\\"".format(" ".join(extra_cflags_c)),
            "extra_cflags_cc=\\\"{}\\\"".format(" ".join(extra_cflags_cc)),
            "extra_ldflags=\\\"{}\\\"".format(" ".join(extra_ldflags)),
        ]
        with tools.chdir(self._source_subfolder):
            with self._build_context():
                self.run("gn gen out/Default --args=\"{}\"".format(" ".join(gn_args)), run_environment=True)
                targets = ["client", "minidump", "crashpad_handler", "snapshot"]
                if self.settings.os == "Windows":
                    targets.append("crashpad_handler_com")
                self.run("ninja -C out/Default {targets} -j{parallel}".format(
                    targets=" ".join(targets),
                    parallel=tools.cpu_count()), run_environment=True)

        def lib_filename(name):
            prefix, suffix = ("", ".lib")  if self.settings.compiler == "Visual Studio" else ("lib", ".a")
            return "{}{}{}".format(prefix, name, suffix)
        tools.rename(os.path.join(self._source_subfolder, "out", "Default", "obj", "client", lib_filename("common")),
                     os.path.join(self._source_subfolder, "out", "Default", "obj", "client", lib_filename("client_common")))
        tools.rename(os.path.join(self._source_subfolder, "out", "Default", "obj", "handler", lib_filename("common")),
                     os.path.join(self._source_subfolder, "out", "Default", "obj", "handler", lib_filename("handler_common")))
Beispiel #3
0
 def package(self):
     cmake = self._configure_cmake()
     cmake.install()
     self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
     tools.rmdir(self._pkg_share)
     tools.rmdir(self._pkg_cmake)
     if self.options.toml_config:
         tools.rename(
             os.path.join(self._pkg_etc, "roudi_config_example.toml"),
             os.path.join(self._pkg_bin, "roudi_config_example.toml")
         )
     tools.rmdir(self._pkg_etc)
     for alias, aliased in self._target_aliases.items():
         cmake_file = "conan-official-{}-targets.cmake".format(
             aliased.replace("::", "_")
         )
         self._create_cmake_module_alias_targets(
             os.path.join(
                 self.package_folder,
                 self._module_subfolder,
                 cmake_file
             ),
             alias,
             aliased
         )
    def source(self):
        suffix = "CRYPTOPP_{}".format(self.version.replace(".", "_"))
        data = self.conan_data["sources"][self.version]

        # Get sources
        source_cryptopp = {
            "url": data["url"]["source"],
            "sha256": data["sha256"]["source"],
        }
        tools.get(**source_cryptopp)
        tools.rename("cryptopp-" + suffix, self._source_subfolder)

        # Get CMakeLists
        cmake_cryptopp = {
            "url": data["url"]["cmake"],
            "sha256": data["sha256"]["cmake"],
        }
        tools.get(**cmake_cryptopp)
        src_folder = os.path.join(self.source_folder,
                                  "cryptopp-cmake-" + suffix)
        dst_folder = os.path.join(self.source_folder, self._source_subfolder)
        shutil.move(os.path.join(src_folder, "CMakeLists.txt"),
                    os.path.join(dst_folder, "CMakeLists.txt"))
        shutil.move(os.path.join(src_folder, "cryptopp-config.cmake"),
                    os.path.join(dst_folder, "cryptopp-config.cmake"))
        tools.rmdir(src_folder)
 def package(self):
     self.copy("COPYING", src=self._source_subfolder, dst="licenses")
     if self._is_msvc:
         with self._build_context():
             meson = self._configure_meson()
             meson.install()
             if os.path.isfile(
                     os.path.join(self.package_folder, "lib",
                                  "libfontconfig.a")):
                 tools.rename(
                     os.path.join(self.package_folder, "lib",
                                  "libfontconfig.a"),
                     os.path.join(self.package_folder, "lib",
                                  "fontconfig.lib"))
     else:
         with tools.run_environment(self):
             autotools = self._configure_autotools()
             autotools.install()
     tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"),
                                "*.pdb")
     tools.remove_files_by_mask(
         os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d"),
         "*.conf")
     tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"),
                                "*.def")
     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, "etc"))
     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 _create_executable_module_file(self, target, executable):
        # Copy our CMake module template file to package folder
        self.copy(self._grpc_plugin_template,
                  dst=self._module_path,
                  src=os.path.join(self.source_folder, "cmake"))

        # Rename it
        dst_file = os.path.join(self.package_folder, self._module_path,
                                "{}.cmake".format(executable))
        tools.rename(
            os.path.join(self.package_folder, self._module_path,
                         self._grpc_plugin_template), dst_file)

        # Replace placeholders
        tools.replace_in_file(dst_file, "@target_name@", target)
        tools.replace_in_file(dst_file, "@executable_name@", executable)

        find_program_var = "{}_PROGRAM".format(executable.upper())
        tools.replace_in_file(dst_file, "@find_program_variable@",
                              find_program_var)

        module_folder_depth = len(
            os.path.normpath(self._module_path).split(os.path.sep))
        rel_path = "".join(["../"] * module_folder_depth)
        tools.replace_in_file(dst_file, "@relative_path@", rel_path)
    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())))
        tools.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.*")
Beispiel #9
0
    def package(self):
        self.copy("COPYING", src=self._source_subfolder, dst="licenses")
        with self._build_context():
            autotools = self._configure_autotools()
            autotools.install()

        if self.settings.compiler == "Visual Studio":
            if self.options.shared:
                pass
            else:
                tools.rename(
                    os.path.join(self.package_folder, "lib", "libxapian.lib"),
                    os.path.join(self.package_folder, "lib", "xapian.lib"))

        os.unlink(
            os.path.join(
                os.path.join(self.package_folder, "bin", "xapian-config")))
        os.unlink(
            os.path.join(
                os.path.join(self.package_folder, "lib", "libxapian.la")))
        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._datarootdir, "doc"))
        tools.rmdir(os.path.join(self._datarootdir, "man"))
        self._create_cmake_module_variables(
            os.path.join(self.package_folder, self._module_file_rel_path))
Beispiel #10
0
    def package(self):
        cmake = self._configure_cmake()
        cmake.install()
        self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
        tools.rmdir(os.path.join(self.package_folder, "share"))
        tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
        if self.options.toml_config:
            tools.mkdir(os.path.join(self.package_folder, "res"))
            tools.rename(os.path.join(self.package_folder, "etc", "roudi_config_example.toml"),
                         os.path.join(self.package_folder, "res", "roudi_config.toml"))
        tools.rmdir(os.path.join(self.package_folder, "etc"))
        # bring to default package structure
        if (tools.Version(self.version) >= "2.0.0"):
            include_paths = ["iceoryx_binding_c", "iceoryx_hoofs", "iceoryx_posh", "iceoryx_versions.hpp"]
            for include_path in include_paths:
                tools.rename(
                    os.path.join(self.package_folder, "include", "iceoryx", "v{}".format(self.version), include_path),
                    os.path.join(self.package_folder, "include", include_path))

        # TODO: to remove in conan v2 once cmake_find_package* generators removed
        if (tools.Version(self.version) >= "2.0.0"):
            self._create_cmake_module_alias_targets(
                os.path.join(self.package_folder, self._module_file_rel_path),
                {v["target"]: "iceoryx::{}".format(k)
                 for k, v in self._iceoryx_components["2.0.0"].items()})
        else:
            self._create_cmake_module_alias_targets(
                os.path.join(self.package_folder, self._module_file_rel_path),
                {v["target"]: "iceoryx::{}".format(k)
                 for k, v in self._iceoryx_components["1.0.X"].items()})
Beispiel #11
0
    def package(self):
        tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text)

        # Copying zlib.h, zutil.h, zconf.h
        self.copy("*.h", "include", "%s" % self._source_subfolder, keep_path=False)

        # Copying static and dynamic libs
        if self.settings.os == "Windows":
            suffix = "d" if self.settings.build_type == "Debug" else ""
            self.copy(pattern="*.h", dst="include", src=self._build_subfolder, keep_path=False)
            if self.options.shared:
                self.copy(pattern="*.dll", src=self._build_subfolder, dst="bin", keep_path=False)
                self.copy(pattern="libzlib.dll.a", src=os.path.join(self._build_subfolder, "lib"), dst="lib")
                self.copy(pattern="zlib{}.lib".format(suffix), src=os.path.join(self._build_subfolder, "lib"), dst="lib")
            else:
                self.copy(pattern="zlibstatic{}.lib".format(suffix), src=os.path.join(self._build_subfolder, "lib"), dst="lib")
                self.copy(pattern="libzlibstatic.a", src=os.path.join(self._build_subfolder, "lib"), dst="lib")

                lib_path = os.path.join(self.package_folder, "lib")
                if self.settings.compiler == "Visual Studio":
                    tools.rename(os.path.join(lib_path, "zlibstatic{}.lib".format(suffix)),
                                 os.path.join(lib_path, "zlib{}.lib".format(suffix)))
                elif self.settings.compiler == "gcc":
                    tools.rename(os.path.join(lib_path, "libzlibstatic.a"),
                                 os.path.join(lib_path, "libzlib.a"))
        else:
            if self.options.shared:
                if self.settings.os == "Macos":
                    self.copy(pattern="*.dylib", src=self._source_subfolder, dst="lib", keep_path=False)
                else:
                    self.copy(pattern="*.so*", src=self._source_subfolder, dst="lib", keep_path=False)
            else:
                self.copy(pattern="*.a", src=self._source_subfolder, dst="lib", keep_path=False)
Beispiel #12
0
    def package(self):
        self.copy("*LICENSE*", src=self._source_subfolder, dst="licenses")
        with tools.vcvars(self) if self._use_nmake else tools.no_op():
            self._make_install()
        for root, _, files in os.walk(self.package_folder):
            for filename in files:
                if fnmatch.fnmatch(filename, "*.pdb"):
                    os.unlink(os.path.join(self.package_folder, root,
                                           filename))
        if self._use_nmake:
            if self.settings.build_type == "Debug":
                with tools.chdir(os.path.join(self.package_folder, "lib")):
                    tools.rename("libssl.lib", "libssld.lib")
                    tools.rename("libcrypto.lib", "libcryptod.lib")

        if self.options.shared:
            libdir = os.path.join(self.package_folder, "lib")
            for file in os.listdir(libdir):
                if self._is_mingw and file.endswith(".dll.a"):
                    continue
                if file.endswith(".a"):
                    os.unlink(os.path.join(libdir, file))

        tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

        self._create_cmake_module_variables(
            os.path.join(self.package_folder, self._module_file_rel_path))
Beispiel #13
0
 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"))
Beispiel #14
0
    def package(self):
        cmake = self._configure_cmake()
        cmake.install()
        self.copy("License.txt", dst="licenses", src=self._source_subfolder)
        tools.rename(src=os.path.join(self.package_folder, "include",
                                      "source_subfolder"),
                     dst=os.path.join(self.package_folder, "include",
                                      "DiligentFx"))
        shutil.move(os.path.join(self.package_folder, "Shaders"),
                    os.path.join(self.package_folder, "res", "Shaders"))

        self.copy(pattern="*.dll",
                  src=self._build_subfolder,
                  dst="bin",
                  keep_path=False)
        self.copy(pattern="*.dylib",
                  src=self._build_subfolder,
                  dst="lib",
                  keep_path=False)
        self.copy(pattern="*.lib",
                  src=self._build_subfolder,
                  dst="lib",
                  keep_path=False)
        self.copy(pattern="*.a",
                  src=self._build_subfolder,
                  dst="lib",
                  keep_path=False)
Beispiel #15
0
 def _patch_sources(self):
     # Rename the generated Findjbig.cmake and Findzstd.cmake to avoid case insensitive conflicts with FindJBIG.cmake and FindZSTD.cmake on Windows
     tools.rename(os.path.join(self.build_folder, "Findjbig.cmake"),
                  os.path.join(self.build_folder, "ConanFindjbig.cmake"))
     if tools.Version(self.version) >= "4.1":
         tools.rename(
             os.path.join(self.build_folder, "Findzstd.cmake"),
             os.path.join(self.build_folder, "ConanFindzstd.cmake"))
     for patch in self.conan_data.get("patches", {}).get(self.version, []):
         tools.patch(**patch)
     if self.options.shared and self.settings.compiler == "Visual Studio":
         # https://github.com/Microsoft/vcpkg/blob/master/ports/tiff/fix-cxx-shared-libs.patch
         tools.replace_in_file(
             os.path.join(self._source_subfolder, "libtiff",
                          "CMakeLists.txt"),
             r"set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})",
             r"set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION} "
             r"WINDOWS_EXPORT_ALL_SYMBOLS ON)")
     cmakefile = os.path.join(self._source_subfolder, "CMakeLists.txt")
     if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio":
         if tools.Version(self.version) < "4.2.0":
             tools.replace_in_file(
                 cmakefile, "find_library(M_LIBRARY m)",
                 "if (NOT MINGW)\n  find_library(M_LIBRARY m)\nendif()")
         if tools.Version(self.version) < "4.0.9":
             tools.replace_in_file(cmakefile, "if (UNIX)",
                                   "if (UNIX OR MINGW)")
     tools.replace_in_file(
         cmakefile,
         "add_subdirectory(tools)\nadd_subdirectory(test)\nadd_subdirectory(contrib)\nadd_subdirectory(build)\n"
         "add_subdirectory(man)\nadd_subdirectory(html)", "")
Beispiel #16
0
 def _fix_library_names(self):
     if self._is_msvc:
         with tools.chdir(os.path.join(self.package_folder, "lib")):
             for filename_old in glob.glob("*.a"):
                 filename_new = filename_old[3:-2] + ".lib"
                 self.output.info("rename %s into %s" % (filename_old, filename_new))
                 tools.rename(filename_old, filename_new)
Beispiel #17
0
    def package(self):
        self.copy("LICENSE_1_0.txt",
                  dst="licenses",
                  src=self._source_subfolder)

        cmake = self._configure_cmake()
        cmake.install()
        tools.rmdir(os.path.join(self.package_folder, "cmake"))

        if os.path.isdir(os.path.join(self.package_folder, "lib64")):
            if os.path.isdir(os.path.join(self.package_folder, "lib")):
                self.copy("*",
                          dst="lib",
                          src="lib64",
                          keep_path=False,
                          symlinks=True)
                tools.rmdir(os.path.join(self.package_folder, "lib64"))
            else:
                tools.rename(os.path.join(self.package_folder, "lib64"),
                             os.path.join(self.package_folder, "lib"))

        os.remove(
            os.path.join(self.package_folder, "include", "soci",
                         "soci-config.h.in"))
        tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
Beispiel #18
0
    def package(self):
        self.copy("COPYING",
                  src=os.path.join(self._source_subfolder, "nss"),
                  dst="licenses")
        with tools.chdir(os.path.join(self._source_subfolder, "nss")):
            self.run("make install %s" % " ".join(self._make_args))
        self.copy("*",
                  src=os.path.join(self._source_subfolder, "dist", "public",
                                   "nss"),
                  dst="include")
        for d in os.listdir(os.path.join(self._source_subfolder, "dist")):
            if d in ["private", "public"]:
                continue
            f = os.path.join(self._source_subfolder, "dist", d)
            if not os.path.isdir(f):
                continue
            self.copy("*", src=f)

        for dll_file in glob.glob(
                os.path.join(self.package_folder, "lib", "*.dll")):
            tools.rename(
                dll_file,
                os.path.join(self.package_folder, "bin",
                             os.path.basename(dll_file)))

        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")
            tools.remove_files_by_mask(
                os.path.join(self.package_folder, "bin"), "*.dll")
Beispiel #19
0
    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"))
        self.copy("License.txt", dst="licenses", src=self._source_subfolder)
Beispiel #20
0
    def package(self):
        # copy package license
        self.copy("COPYING",
                  src=self._source_subfolder,
                  dst="licenses",
                  ignore_case=True,
                  keep_path=False)
        if self._is_msvc:
            self._package_msvc()
            # remove redundant libraries to avoid confusion
            if not self.options.shared:
                os.remove(
                    os.path.join(self.package_folder, "bin", "libxml2.dll"))
            os.remove(
                os.path.join(self.package_folder, "lib", "libxml2_a_dll.lib"))
            os.remove(
                os.path.join(
                    self.package_folder, "lib",
                    "libxml2_a.lib" if self.options.shared else "libxml2.lib"))
            tools.remove_files_by_mask(
                os.path.join(self.package_folder, "bin"), "*.pdb")
        elif self._is_mingw_windows:
            self._package_mingw()
            if self.options.shared:
                os.remove(os.path.join(self.package_folder, "lib",
                                       "libxml2.a"))
                tools.rename(
                    os.path.join(self.package_folder, "lib", "libxml2.lib"),
                    os.path.join(self.package_folder, "lib", "libxml2.dll.a"))
            else:
                os.remove(
                    os.path.join(self.package_folder, "bin", "libxml2.dll"))
                os.remove(
                    os.path.join(self.package_folder, "lib", "libxml2.lib"))
        else:
            autotools = self._configure_autotools()
            autotools.make(["install-libLTLIBRARIES", "install-data"])

            if self.options.include_utils:
                autotools.make(
                    ["install", "xmllint", "xmlcatalog", "xml2-config"])

            os.remove(os.path.join(self.package_folder, "lib", "libxml2.la"))
            for prefix in ["run", "test"]:
                tools.remove_files_by_mask(
                    os.path.join(self.package_folder, "bin"), prefix + "*")
            tools.rmdir(os.path.join(self.package_folder, "share"))
            tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
            tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

        for header in ["win32config.h", "wsockcompat.h"]:
            self.copy(pattern=header,
                      src=os.path.join(self._source_subfolder, "include"),
                      dst=os.path.join("include", "libxml2"),
                      keep_path=False)

        self._create_cmake_module_variables(
            os.path.join(self.package_folder, self._module_file_rel_path))
Beispiel #21
0
    def _patch_files(self):
        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.patch(**self.conan_data["patches"][self.version])
        sources_cmake = os.path.join(self._source_subfolder, "CMakeLists.txt")
        sources_cmake_orig = os.path.join(self._source_subfolder,
                                          "CMakeListsOriginal.txt")
        tools.rename(sources_cmake, sources_cmake_orig)
        tools.rename("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="LICENSE", dst="licenses")
     self.copy(pattern=self._bazel_filename, dst="bin")
     old_target_filename = os.path.join(self.package_folder, "bin",
                                        self._bazel_filename)
     new_target_filename = os.path.join(self.package_folder, "bin",
                                        "bazel" + self._program_suffix)
     tools.rename(old_target_filename, new_target_filename)
     self._chmod_plus_x(new_target_filename)
Beispiel #23
0
 def _install_msvc(self):
     self.copy("mDNSResponder.exe", dst="bin", src=self._msvc_build_folder("mDNSWindows", "SystemService"))
     self.copy("dns_sd.h", dst="include", src=os.path.join(self._source_subfolder, "mDNSShared"))
     self.copy("dnssd.dll", dst="bin", src=self._msvc_build_folder("mDNSWindows", "DLL"))
     self.copy("dnssdStatic.lib", dst="lib", src=self._msvc_build_folder("mDNSWindows", "DLLStub"))
     # rename consistently with Bonjour SDK
     tools.rename(src=os.path.join(self.package_folder, "lib", "dnssdStatic.lib"),
                  dst=os.path.join(self.package_folder, "lib", "dnssd.lib"))
     self.copy("dns-sd.exe", dst="bin", src=self._msvc_build_folder("Clients", "DNS-SD.VisualStudio"))
Beispiel #24
0
 def _fix_library_names(self, path):
     # https://github.com/mesonbuild/meson/issues/1412
     if not self.options.shared and self._is_msvc:
         with tools.chdir(path):
             for filename_old in glob.glob("*.a"):
                 filename_new = filename_old[3:-2] + ".lib"
                 self.output.info("rename %s into %s" %
                                  (filename_old, filename_new))
                 tools.rename(filename_old, filename_new)
Beispiel #25
0
 def package(self):
     with self._build_context():
         autotools = self._configure_autotools()
         autotools.install()
     self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
     lib_folder = os.path.join(self.package_folder, "lib")
     if self._is_msvc:
         tools.rename(os.path.join(lib_folder, "libbacktrace.lib"),
                      os.path.join(lib_folder, "backtrace.lib"))
     tools.remove_files_by_mask(lib_folder, "*.la")
Beispiel #26
0
    def package(self):
        self.copy("COPYING", src=self._source_subfolder, dst="licenses")
        with tools.chdir(os.path.join(self._source_subfolder)):
            self._autotools = self._configure_autotools()
            self._autotools.install()

        tools.mkdir(os.path.join(self.package_folder, "res"))
        tools.rename(os.path.join(self.package_folder, "share", "aclocal"),
                     os.path.join(self.package_folder, "res", "aclocal"))
        tools.rmdir(os.path.join(self.package_folder, "share"))
 def package(self):
     with tools.vcvars(self.settings) if self._is_msvc else tools.no_op():
         autotools = self._configure_autotools()
         autotools.install()
     self.copy(pattern="COPYING", src=self._source_subfolder, dst='licenses')
     tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig'))
     if self._is_msvc:
         ext = ".dll.lib" if self.options.shared else ".lib"
         tools.rename(os.path.join(self.package_folder, "lib", "libx264{}".format(ext)),
                      os.path.join(self.package_folder, "lib", "x264.lib"))
Beispiel #28
0
 def package(self):
     self.copy(pattern="COPYING", src=self._source_subfolder, dst="licenses")
     with self._build_context():
         autotools = self._configure_autotools()
         autotools.install()
     tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
     if self._is_msvc:
         ext = ".dll.lib" if self.options.shared else ".lib"
         tools.rename(os.path.join(self.package_folder, "lib", "libx264{}".format(ext)),
                      os.path.join(self.package_folder, "lib", "x264.lib"))
Beispiel #29
0
    def _patch_sources(self):
        sources_cmake = os.path.join(self._source_subfolder, "CMakeLists.txt")
        sources_cmake_orig = os.path.join(self._source_subfolder,
                                          "CMakeListsOriginal.txt")

        tools.rename(sources_cmake, sources_cmake_orig)
        tools.rename("CMakeLists.txt", sources_cmake)

        for patch in self.conan_data["patches"][self.version]:
            tools.patch(**patch)
Beispiel #30
0
 def _build_cmake(self):
     if self.options.get_safe("pulse"):
         tools.rename("libpulse.pc", "libpulse-simple.pc")
     lib_paths = [
         lib for dep in self.deps_cpp_info.deps
         for lib in self.deps_cpp_info[dep].lib_paths
     ]
     with tools.environment_append(
         {"LIBRARY_PATH": os.pathsep.join(lib_paths)}):
         cmake = self._configure_cmake()
         cmake.build()