Esempio n. 1
0
    def package(self):
        self.copy("COPYING", dst="licenses", src=self._source_subfolder)
        meson = self._configure_meson()
        meson.install()
        if self.settings.compiler == "Visual Studio":
            tools.remove_files_by_mask(
                os.path.join(self.package_folder, "bin"), "*.pdb")
            if not self.options.shared:
                rename(
                    self,
                    os.path.join(self.package_folder, "lib", "libsigc-2.0.a"),
                    os.path.join(self.package_folder, "lib", "sigc-2.0.lib"))

        for header_file in glob.glob(
                os.path.join(self.package_folder, "lib", "sigc++-2.0",
                             "include", "*.h")):
            shutil.move(
                header_file,
                os.path.join(self.package_folder, "include", "sigc++-2.0",
                             os.path.basename(header_file)))

        for dir_to_remove in ["pkgconfig", "sigc++-2.0"]:
            tools.rmdir(os.path.join(self.package_folder, "lib",
                                     dir_to_remove))
    def package(self):
        self.copy(src=self._source_subfolder,
                  pattern="*LICENSE",
                  dst="licenses")
        with tools.vcvars(self.settings) 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' and self._full_version >= "1.1.0":
                with tools.chdir(os.path.join(self.package_folder, 'lib')):
                    rename(self, "libssl.lib", "libssld.lib")
                    rename(self, "libcrypto.lib", "libcryptod.lib")
        # Old OpenSSL version family has issues with permissions.
        # See https://github.com/conan-io/conan/issues/5831
        if self._full_version < "1.1.0" and self.options.shared and self.settings.os in (
                "Android", "FreeBSD", "Linux"):
            with tools.chdir(os.path.join(self.package_folder, "lib")):
                os.chmod("libssl.so.1.0.0", 0o755)
                os.chmod("libcrypto.so.1.0.0", 0o755)

        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))
Esempio n. 3
0
    def package(self):
        self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder)
        with self._build_context():
            autotools = self._configure_autotools()
            autotools.install()

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

        if self._is_msvc:
            if self.options.shared:
                # ffmpeg created `.lib` files in the `/bin` folder
                for fn in os.listdir(os.path.join(self.package_folder, "bin")):
                    if fn.endswith(".lib"):
                        rename(self,
                               os.path.join(self.package_folder, "bin", fn),
                               os.path.join(self.package_folder, "lib", fn))
                tools.remove_files_by_mask(
                    os.path.join(self.package_folder, "lib"), "*.def")
            else:
                # ffmpeg produces `.a` files that are actually `.lib` files
                with tools.chdir(os.path.join(self.package_folder, "lib")):
                    for lib in glob.glob("*.a"):
                        rename(self, lib, lib[3:-2] + ".lib")
Esempio n. 4
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")):
                    rename(self, "libssl.lib", "libssld.lib")
                    rename(self, "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))

        if not self.options.no_fips:
            provdir = os.path.join(self._source_subfolder, "providers")
            if self.settings.os == "Macos":
                self.copy("fips.dylib", src=provdir, dst="lib/ossl-modules")
            elif self.settings.os == "Windows":
                self.copy("fips.dll", src=provdir, dst="lib/ossl-modules")
            else:
                self.copy("fips.so", src=provdir, dst="lib/ossl-modules")

        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))
Esempio n. 5
0
 def package(self):
     self.copy(pattern="LICENSE",
               src=self._source_subfolder,
               dst="licenses")
     if self._is_msvc:
         self.copy(pattern="*.h",
                   src=os.path.join(self._source_subfolder, "include"),
                   dst=os.path.join("include", "lame"))
         name = "libmp3lame.lib" if self.options.shared else "libmp3lame-static.lib"
         self.copy(name,
                   src=os.path.join(self._source_subfolder, "output"),
                   dst="lib")
         if self.options.shared:
             self.copy(pattern="*.dll",
                       src=os.path.join(self._source_subfolder, "output"),
                       dst="bin")
         rename(self, os.path.join(self.package_folder, "lib", name),
                os.path.join(self.package_folder, "lib", "mp3lame.lib"))
     else:
         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")
Esempio n. 6
0
 def _replace_package_folder(self, source, target):
     if os.path.isdir(os.path.join(self.package_folder, source)):
         tools.rmdir(os.path.join(self.package_folder, target))
         rename(self, os.path.join(self.package_folder, source),
                os.path.join(self.package_folder, target))
Esempio n. 7
0
 def source(self):
     # can't use strip_root here because if fails since 2.9.10 with:
     # KeyError: "linkname 'libxml2-2.9.1x/test/relaxng/ambig_name-class.xml' not found"
     tools.get(**self.conan_data["sources"][self.version])
     rename(self, "libxml2-{}".format(self.version), self._source_subfolder)
Esempio n. 8
0
    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(")
Esempio n. 9
0
 def source(self):
     tools.get(**self.conan_data["sources"][self.version])
     rename(self, self.name + "-" + self.version, self._source_subfolder)
Esempio n. 10
0
 def source(self):
     tools.get(**self.conan_data["sources"][self.version][0])
     extracted_dir = self.name + "-" + self.version
     rename(self, extracted_dir, self._source_subfolder)
Esempio n. 11
0
 def source(self):
     tools.get(**self.conan_data["sources"][self.version],
               destination="tmp", strip_root=True)
     rename(self, os.path.join("tmp", "nspr"), self._source_subfolder)
     tools.rmdir("tmp")
Esempio n. 12
0
 def source(self):
     get(self, **self.conan_data["sources"][self.version])
     extracted_dir = "acl-" + self.version
     rename(self, extracted_dir, self._source_subfolder)