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

libxshmfence: generate gcc11 binaries #14938

Closed
wants to merge 2 commits into from
Closed
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
36 changes: 21 additions & 15 deletions recipes/libxshmfence/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from conans import ConanFile, tools, AutoToolsBuildEnvironment
from conans.errors import ConanInvalidConfiguration
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir
from conans import tools, AutoToolsBuildEnvironment
import contextlib
import os

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.53.0"

class LibxshmfenceConan(ConanFile):
name = "libxshmfence"
Expand Down Expand Up @@ -38,31 +40,35 @@ def _settings_build(self):
def _user_info_build(self):
return getattr(self, "user_info_build", self.deps_user_info)

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
del self.options.fPIC
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd
self.options.rm_safe("fPIC")
# for plain C projects only
self.settings.rm_safe("compiler.libcxx")
self.settings.rm_safe("compiler.cppstd")
Comment on lines +54 to +55
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to bump the required_conan_version to 1.53.0 for using rm_safe?


def validate(self):
if self.settings.os == "Windows":
raise ConanInvalidConfiguration("Windows is not supported by libxshmfence recipe. Contributions are welcome")

def build_requirements(self):
self.build_requires("automake/1.16.4")
self.build_requires("pkgconf/1.7.4")
self.build_requires("automake/1.16.5")
self.build_requires("pkgconf/1.9.3")
if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"):
self.build_requires("msys2/cci.latest")

def requirements(self):
self.requires("xorg-proto/2021.4")
self.requires("xorg-proto/2022.2")

def source(self):
tools.get(**self.conan_data["sources"][self.version],
get(self, **self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

@contextlib.contextmanager
Expand Down Expand Up @@ -91,8 +97,7 @@ def _configure_autotools(self):
return self._autotools

def build(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
apply_conandata_patches(self)
with self._build_context():
autotools = self._configure_autotools()
autotools.make()
Expand All @@ -102,9 +107,10 @@ def package(self):
with self._build_context():
autotools = self._configure_autotools()
autotools.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la")
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rm(self, "*.la", os.path.join(self.package_folder, "lib"))

def package_info(self):
self.cpp_info.libs = ["xshmfence"]
self.cpp_info.names["pkg_config"] = "xshmfence"
self.cpp_info.set_property("pkg_config_name", "xshmfence")