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

libgphoto2: add new recipe #7664

Merged
merged 5 commits into from
Oct 28, 2021
Merged

Conversation

sparik
Copy link
Contributor

@sparik sparik commented Oct 12, 2021

Specify library name and version: libgphoto2/2.5.27


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@sparik
Copy link
Contributor Author

sparik commented Oct 12, 2021

This needs to be added to the KB-H050 whitelist

self._autotools = AutoToolsBuildEnvironment(self)
self._autotools.libs = []
yes_no = lambda v: "yes" if v else "no"
auto_no = lambda v: "auto" if v else "no"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use auto. auto might mean yes or no, so it's kinda random.
If a library is not detected when using yes, that means we must help the build system to find it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure that would work. There is no yes option

--with-libcurl=PREFIX where to find libcurl, "no" or "auto"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think auto here means "try to find it"

Copy link
Contributor

@madebr madebr Oct 14, 2021

Choose a reason for hiding this comment

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

I checked the m4 files, and those --with options accept prefixes.
Perhaps you can pass "--with-libcurl={}".format(tools.unix_path(self.deps_cpp_info["libcurl"].rootpath))?
It indeed does not accept yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just tried that, doesn't work. Everything seems to go well except a warning like below:

* Warning:
*   libtool file libxml-2.0.la could not be found.
*   We may be linking against the WRONG library.```

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked again, and your current approach looks fine after all.
no disabled the functionality, and it will fall back to the pc files.
So LGTM.

@madebr
Copy link
Contributor

madebr commented Oct 14, 2021

This needs to be added to the KB-H050 whitelist

Indeed, libgphoto uses a main library + loadable libraries.
There's no switch to build the main library as a static library, while keep building the loadable libraries as a shared library.

Feel free to add libgphoto2 to the (sorted) list at
https://github.com/conan-io/hooks/blob/9345dda32175f229d41d943dc964e840988d946a/hooks/conan-center.py#L753-L760

"utilsdir={}".format(tools.unix_path(os.path.join(self.package_folder, "bin"))),
]
if not self.options.with_libjpeg:
args.append("--without-jpeg")
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do: "with-jpeg={}".format(yes_no(self.options.with_libjpeg) and add it to the list above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure? ./configure --help does not list with-jpeg as an option

Copy link
Contributor

@madebr madebr Oct 14, 2021

Choose a reason for hiding this comment

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

You're right about with-jpeg. It doesn't support yes.
I checked configure.ac and it's behavior is "unsafe".

AC_ARG_WITH([jpeg], AS_HELP_STRING([--without-jpeg], [Build without jpeg library (default: no)]))
AS_IF([test "x$with_jpeg" != "xno"], [
	AC_CHECK_LIB(jpeg,jpeg_start_decompress,[
		AC_CHECK_HEADER(jpeglib.h,[
			AC_DEFINE(HAVE_LIBJPEG,1,[define if we found LIBJPEG and its headers])
			LIBJPEG="-ljpeg"
			libjpeg_msg="yes"
		])
	])
])

If it cannot find the jpeg_start_decompress symbol or find the jpeglib.h header, it fails.
It can potentially not find libjpeg.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
madebr
madebr previously approved these changes Oct 14, 2021
@conan-center-bot

This comment has been minimized.

@sparik sparik closed this Oct 26, 2021
@sparik sparik reopened this Oct 26, 2021
@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 4 (31df04986675c12c2a41305db722c9d471feb012):

  • libgphoto2/2.5.27@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit 30a1b4e into conan-io:master Oct 28, 2021
ivanvurbanov pushed a commit to ivanvurbanov/conan-center-index that referenced this pull request Dec 2, 2021
* add libgphoto2 recipe

* WIP

* support only shared build; change test_package.c

* Update recipes/libgphoto2/all/test_package/conanfile.py

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* patch for snprintf on macos

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants