diff options
| author | Ingar <ingar@telenet.be> | 2026-02-23 20:29:28 +0100 |
|---|---|---|
| committer | Ingar <ingar@telenet.be> | 2026-02-23 20:29:28 +0100 |
| commit | 20041b2163e7f7be47f4cea066f8c079e25ba260 (patch) | |
| tree | 745b6ebf0266416aca342f5f7c7f9725cbf6bece | |
| parent | f94fc51ae684a64b2878dd8b8780a0d49a3fc66c (diff) | |
| -rw-r--r-- | PKGBUILD | 19 | ||||
| -rw-r--r-- | libcamera-fix-python3.14-macro-redefinition.patch | 36 |
2 files changed, 49 insertions, 6 deletions
@@ -10,9 +10,9 @@ pkgname=( gst-plugin-libcamera-rpi python-libcamera-rpi ) -pkgver=0.6.0 -_customtag=rpt20251202 -pkgrel=2 +pkgver=0.7.0 +_customtag=rpt20260205 +pkgrel=1 pkgdesc="A complex camera support library for Linux, Android, and ChromeOS" arch=(aarch64) url="https://github.com/raspberrypi/libcamera" @@ -47,8 +47,14 @@ makedepends=( nlohmann-json python-sphinxcontrib-doxylink ) -source=("libcamera-${pkgver}+${_customtag}.tar.gz::https://github.com/raspberrypi/libcamera/archive/refs/tags/v${pkgver}+${_customtag}.tar.gz") -sha256sums=('6182cd1e2c9da2b5a5ee1dc3733b2068629fb4d53b20d3071de30a36a2221796') +source=( + "libcamera-${pkgver}+${_customtag}.tar.gz::https://github.com/raspberrypi/libcamera/archive/refs/tags/v${pkgver}+${_customtag}.tar.gz" + "libcamera-fix-python3.14-macro-redefinition.patch" +) +sha256sums=( + '0060fd0b6b10803505fecd13ee379e1b88e1ab6399940f7d924f6b2bb8a99df0' + '2eb9407d11ea073e3c392bbb584b75803ce1b2a3d73afaefda5c1fa799c151ad' +) _pick() { local p="$1" f d; shift @@ -68,13 +74,14 @@ _pick() { prepare() { mv $pkgbase-$pkgver-$_customtag $pkgbase cd $pkgbase + patch -Np1 < ../$pkgbase-fix-python3.14-macro-redefinition.patch # add version, so that utils/gen-version.sh may rely on it printf "%s\n" "$pkgver" > .tarball-version } build() { - meson setup $pkgbase build --prefix=/usr --libexecdir=lib --sbindir=bin --auto-features=enabled --wrap-mode=nodownload --buildtype=release -Db_lto=false -Db_pie=true -Dtracing=disabled -Dpython.bytecompile=1 -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dv4l2=enabled -Dgstreamer=enabled -Dtest=true -Dlc-compliance=enabled -Dcam=enabled -Dqcam=enabled -Ddocumentation=enabled -Dpycamera=enabled + meson setup $pkgbase build --prefix=/usr --libexecdir=lib --sbindir=bin --auto-features=enabled --wrap-mode=nodownload --buildtype=release -Db_lto=false -Db_pie=true -Dtracing=disabled -Dpython.bytecompile=1 -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dv4l2=enabled -Dgstreamer=enabled -Dtest=true -Dlc-compliance=enabled -Dcam=enabled -Dqcam=enabled -Ddocumentation=enabled -Dpycamera=enabled -Drpi-awb-nn=disabled meson compile -C build #ninja -C build install } diff --git a/libcamera-fix-python3.14-macro-redefinition.patch b/libcamera-fix-python3.14-macro-redefinition.patch new file mode 100644 index 0000000..92e41c8 --- /dev/null +++ b/libcamera-fix-python3.14-macro-redefinition.patch @@ -0,0 +1,36 @@ +From 0f580ec44434651ee30d68656dcdb8e7d91f082b Mon Sep 17 00:00:00 2001 +From: Carl Smedstad <carsme@archlinux.org> +Date: Sun, 15 Feb 2026 07:09:45 +0100 +Subject: [PATCH] py: Fix _POSIX_C_SOURCE and _XOPEN_SOURCE redefinition with + Python 3.14 + +Python 3.14's pyconfig.h defines _POSIX_C_SOURCE as 200809L and _XOPEN_SOURCE +as 700, but glibc's features.h now defines them as 202405L and 800 +respectively. When C++ standard library headers are included before Python.h, +features.h sets the newer values first, and pyconfig.h's redefinition triggers +a warning that -Werror turns into an error. + +Fix by adding -include Python.h to the Python bindings compiler args, ensuring +pyconfig.h is processed first. This causes features.h to see _GNU_SOURCE +(defined by pyconfig.h) and safely #undef the macros before redefining them. + +Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> +--- + src/py/libcamera/meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build +index b0bd291f..c01f702f 100644 +--- a/src/py/libcamera/meson.build ++++ b/src/py/libcamera/meson.build +@@ -55,6 +55,7 @@ pycamera_args = [ + '-fvisibility=hidden', + '-Wno-shadow', + '-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT', ++ '-include', 'Python.h', + ] + + if meson.is_cross_build() +-- +2.53.0 + |
