-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
libtiff: add libtiff/4.4.0 #12083
libtiff: add libtiff/4.4.0 #12083
Conversation
recipes/libtiff/all/conanfile.py
Outdated
|
||
def package_info(self): | ||
self.cpp_info.set_property("cmake_find_mode", "both") | ||
self.cpp_info.set_property("cmake_file_name", "TIFF") | ||
self.cpp_info.set_property("cmake_target_name", "TIFF::TIFF") | ||
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(tools.Version(self.version).major)) | ||
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major)) | |
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major)) |
There is no major
accessor in conan.tools.scm.Version
, it returns None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
major
is a method of Version
, so it would print e.g. <bound method Version.major of '3.4'>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, conans.tools.Version != conan.tools.scm.Version ;)
https://docs.conan.io/en/latest/reference/conanfile/tools/scm/other.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am saying major
is also available on conan.tools.scm.Version
, not as a property, but as a method.
Run the following in your terminal:
python -c "import conan.tools.scm; v = conan.tools.scm.Version('5.4.3.2'); print(f'{v.major=}')"
The behavior of conan.tools.scm.Version
's v.major()
is completely different from conans.tools.Version
's .major
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so something like this would work: Version(self.version).major(fill=False)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it with version[0]
, that looked simpler to me.
recipes/libtiff/all/conanfile.py
Outdated
self.cpp_info.libs = [lib + ".dll" for lib in self.cpp_info.libs] | ||
if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: | ||
self.cpp_info.system_libs.append("m") | ||
|
||
# TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed | ||
self.cpp_info.names["cmake_find_package"] = "TIFF" | ||
self.cpp_info.names["cmake_find_package_multi"] = "TIFF" | ||
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(tools.Version(self.version).major) | ||
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(Version(self.version).major) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment here, major returns None
This comment has been minimized.
This comment has been minimized.
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
All green in build 4 (
|
self.cpp_info.libs = [lib + ".dll" for lib in self.cpp_info.libs] | ||
if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: | ||
self.cpp_info.system_libs.append("m") | ||
|
||
# TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed | ||
self.cpp_info.names["cmake_find_package"] = "TIFF" | ||
self.cpp_info.names["cmake_find_package_multi"] = "TIFF" | ||
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(tools.Version(self.version).major) | ||
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(Version(self.version)[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To "fix" once conan-io/conan#11823 released in a version we can use in cci?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as we have 1.52.0 or 1.51.2 running on CCI.
Specify library name and version: libtiff/4.4.0
This is also a good place to share with all of us why you are submitting this PR (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks!