Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zulu-openjdk] Bugfixes for the Zulu JDK package #25485

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions recipes/zulu-openjdk/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,32 @@ class ZuluOpenJDK(ConanFile):
homepage = "https://www.azul.com"
topics = ("java", "jdk", "openjdk")
package_type = "application"
settings = "os", "arch", "compiler", "build_type"

@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings)
settings = "os", "arch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
settings = "os", "arch"
settings = "os", "arch", "compiler", "build_type"

Keep the original settings.

Copy link
Contributor Author

@datalogics-robb datalogics-robb Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valgur can you comment as to why we'd keep the settings here? My thinking is that we don't use a compiler, so we don't need its 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.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.os))
if srcs is None:
raise ConanInvalidConfiguration(f"Unsupported os ({self.settings.os}). "
f"This version {self.version} currently does not support"
f" {self.settings.arch} on {self.settings.os})")
if srcs.get(str(self.settings.arch)) is None:
raise ConanInvalidConfiguration(f"Unsupported Architecture ({self.settings.arch}). "
f"This version {self.version} currently does not support"
f" {self.settings.arch} on {self.settings.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.os)]
[str(self.settings.arch)], strip_root=True, keep_permissions=True)

def package(self):
copy(self, pattern="*", dst=os.path.join(self.package_folder, "bin"),
Expand Down