Skip to content

[libcamera] Add libcamera port #45018

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

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open

Conversation

OhmV-IR
Copy link
Contributor

@OhmV-IR OhmV-IR commented Apr 14, 2025

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx. (no optional deps)
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@OhmV-IR OhmV-IR marked this pull request as ready for review April 14, 2025 02:12
@LilyWangLL LilyWangLL self-assigned this Apr 14, 2025
@LilyWangLL LilyWangLL added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Apr 14, 2025
@LilyWangLL
Copy link
Contributor

Thanks for your PR. Please adjust the line indentation in file portfile.cmake by replacing tabs with 4 spaces.

@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Apr 15, 2025
Comment on lines 26 to 38
- LD_PRELOAD='@LIBCAMERA_V4L2_SO@'
+ if [ $debug = 0 ] ; then
+ LD_PRELOAD="$SCRIPTPATH/../v412-compat.so"
+ else
+ LD_PRELOAD="$SCRIPTPATH/../../v412-compat.so"
+ fi
else
- LD_PRELOAD="$LD_PRELOAD "'@LIBCAMERA_V4L2_SO@'
+ if [ $debug = 0 ] ; then
+ LD_PRELOAD="$LD_PRELOAD " "$SCRIPTPATH/../v412-compat.so"
+ else
+ LD_PRELOAD="$LD_PRELOAD " "$SCRIPTPATH/../../v412-compat.so"
+ fi
Copy link
Contributor

Choose a reason for hiding this comment

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

The else part lacks indent.

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 don't see it, if you're talking about l32 it should be indented like that because its the else corresponding to the first if statement on l25

Comment on lines +8 to +12
"libgnutls",
"libunwind",
"libyaml",
"libyuv",
"openssl",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it needs both libgnutls and openssl.

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 tested, it won't build without both

Copy link
Contributor

Choose a reason for hiding this comment

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

In src/libcamera/meson.build, openssl libcrypto is an alternative to libgnutls. More uses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

libcrypto isn't in vcpkg I believe, so that isn't an option at the moment

Copy link
Contributor Author

@OhmV-IR OhmV-IR Apr 16, 2025

Choose a reason for hiding this comment

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

image
from the rpi fork of libcamera

Copy link
Contributor

Choose a reason for hiding this comment

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

libssl and libcrypto are binaries from openssl. So the picture confirms my guess: libgnutls or openssl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

libssl and libcrypto are binaries from openssl. So the picture confirms my guess: libgnutls or openssl.

yes, but in practice it doesn't work, tried on my vm and it refused to build without both present. Don't know why

@LilyWangLL LilyWangLL removed the info:reviewed Pull Request changes follow basic guidelines label Apr 15, 2025
OhmV-IR and others added 7 commits April 15, 2025 10:56
Comment on lines 19 to 21
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

There are several "auto" options. They may need explicit control to avoid installation order issues with binary artifacts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the only auto options I'll leave is for the pipelines(since it just builds everything that's compatible with the target), and the android platform as generic

@OhmV-IR
Copy link
Contributor Author

OhmV-IR commented Apr 16, 2025

CI fail seems to be some sort of upstream server crash, is there a way to restart the pipeline on my end?

Trying to download meson-1.7.2.tar.gz using asset cache https://vcpkgassetcachewus.blob.core.windows.net/cache/91ddf5421f2808f9f011c2d7f5f2cf9767cf26128821251bae454fc9f36b986ec19d7713b0a938abaaa6300b7f9f06491a91da42080e3811f5271076669da400?*** SECRET ***
Download successful! Asset cache hit, did not try authoritative source https://github.com/mesonbuild/meson/archive/1.7.2.tar.gz
-- Applying patch /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-tool-meson/meson-intl.patch
-- Applying patch /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-tool-meson/adjust-python-dep.patch
-- Applying patch /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-tool-meson/adjust-args.patch
-- Applying patch /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-tool-meson/remove-freebsd-pcfile-specialization.patch
-- Found Python version '3.10.12 at /usr/bin/python3'
-- Using meson: /vcpkg/downloads/tools/meson-1.7.2-549ef7/meson.py
-- Fetching https://git.libcamera.org/libcamera/libcamera.git 058f589ae36170935e537910f2c303b1c3ea03b3...
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: /usr/bin/git fetch https://git.libcamera.org/libcamera/libcamera.git 058f589ae36170935e537910f2c303b1c3ea03b3 --depth 1 -n
    Working Directory: /vcpkg/downloads/git-tmp
    Error code: 128
    See logs for more information:
      /mnt/vcpkg-ci/b/libcamera/git-fetch-x64-linux-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_git.cmake:86 (vcpkg_execute_required_process)
  ports/libcamera/portfile.cmake:1 (vcpkg_from_git)
  scripts/ports.cmake:206 (include)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants