diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py index 648597913dd65..c376737f8f4f3 100644 --- a/recipes/zulu-openjdk/all/conanfile.py +++ b/recipes/zulu-openjdk/all/conanfile.py @@ -16,12 +16,13 @@ class ZuluOpenJDK(ConanFile): settings = "os", "arch", "compiler", "build_type" @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def _settings_host(self): + return getattr(self, "settings_host", self.settings) @property def _jni_folder(self): - folder = {"Linux": "linux", "Macos": "darwin", "Windows": "win32"}.get(str(self._settings_build.os)) + folder = {"Linux": "linux", "Macos": "darwin", + "Windows": "win32", "SunOS": "solaris"}.get(str(self._settings_host.os)) return os.path.join("include", folder) def package_id(self): @@ -29,17 +30,19 @@ def package_id(self): del self.info.settings.build_type def validate(self): - supported_archs = ["x86_64", "armv8"] - if self._settings_build.arch not in supported_archs: - raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_build.arch}). " - f"This version {self.version} currently only supports {supported_archs}.") - supported_os = ["Windows", "Macos", "Linux"] - if self._settings_build.os not in supported_os: - raise ConanInvalidConfiguration(f"Unsupported os ({self._settings_build.os}). " - f"This package currently only support {supported_os}.") + srcs = self.conan_data["sources"].get(self.version, {}).get(str(self._settings_host.os)) + if srcs is None: + raise ConanInvalidConfiguration(f"Unsupported os ({self._settings_host.os}). " + f"This version {self.version} currently does not support" + f" {self._settings_host.arch} on {self._settings_host.os})") + if srcs.get(str(self._settings_host.arch)) is None: + raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_host.arch}). " + f"This version {self.version} currently does not support" + f" {self._settings_host.arch} on {self._settings_host.os})") def build(self): - get(self, **self.conan_data["sources"][self.version][str(self._settings_build.os)][str(self._settings_build.arch)], strip_root=True) + get(self, **self.conan_data["sources"][self.version][str(self._settings_host.os)] + [str(self._settings_host.arch)], strip_root=True, keep_permissions=True) def package(self): copy(self, pattern="*", dst=os.path.join(self.package_folder, "bin"),