Skip to content

Commit

Permalink
[zulu-openjdk] Bugfixes for the Zulu JDK package
Browse files Browse the repository at this point in the history
Recently the Zulu package was enhance by
adding many different binaries for version 11.0.24.
However, other changes to support these binary packages should
also have been made at that time, as none of them were functional.

host settings should identfy the binary type of the package:
 #25484

validation should support all the new configurations:
 #25483

Zip files with executables need an extra flag:
 #25482
  • Loading branch information
datalogics-robb committed Oct 1, 2024
1 parent 44ce640 commit 5061f16
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions recipes/zulu-openjdk/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,33 @@ 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):
del self.info.settings.compiler
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"),
Expand Down

0 comments on commit 5061f16

Please sign in to comment.