From patchwork Tue Aug 19 01:23:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24159 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DCBE7BDCC1 for ; Tue, 19 Aug 2025 01:24:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7DF53613C5; Tue, 19 Aug 2025 03:24:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YznbFUng"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B3F4A613C5 for ; Tue, 19 Aug 2025 03:24:24 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E3095446; Tue, 19 Aug 2025 03:23:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755566607; bh=dJWLzMyQ7qjSZ3rrZJcSwK7F3tmZE8oDUmW8GNb/Mi4=; h=From:To:Cc:Subject:Date:From; b=YznbFUngygVSqytQ0xri9Y2PP/raieC+4n0AcbonL45xPqpD5uF9tcYPf8NBdAqps DqRG7kUjF9hkIZB46P12Zea7BnnQCOXrW128Kc+0EiRDYyI8OY3aO39pR5c4lgvUCp w7FPb453le20CM+neg8dIfyR28DbtUf7NauAv6Iw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: William Vinnicombe , Tomi Valkeinen Subject: [PATCH v3 0/3] py: Improve native and cross-compilation of Python bindings Date: Tue, 19 Aug 2025 04:23:58 +0300 Message-ID: <20250819012402.8395-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series resurects an old patch from William ([1]) that fixes the installation path of Python bindings on Debian when compiling libcamera natively. I've stumbled upon a similar issue on Gentoo, which pushed me to investigate how meson handles Python extension modules, and how Debian implements "original" and "clever" very unconventional conventions for installation paths. The result of that investigation is summarized in a reply to [1], I will not duplicate it here. Patch 1/3 is a rebased version of William's patch. The next two patches are new, they attempt to also improve cross-compilation by using the meson python module to locate the Python dependency (2/3) and calculate the installation path (3/3). Please see individual patches for details of the pros and cons. I have tested this series with native compilation on Debian 11, 12 and 13 as well as on Gentoo, and cross-compilation using Debian 12 multiarch as well manually compiling libcamera against a Buildroot environment. All three patches bring in my opinion a net improvement, even if cross-compilation on Debian 12 required specifying the installation path manually. [1] https://patchwork.libcamera.org/patch/19186/ Laurent Pinchart (2): py: libcamera: Get dependency from meson python module unconditionally py: libcamera: Always use install path from meson python module William Vinnicombe (1): py: libcamera: Improve python binding installation src/py/libcamera/meson.build | 41 ++++++++++++++++++++++++------------ src/py/meson.build | 5 +++-- test/py/meson.build | 3 --- 3 files changed, 30 insertions(+), 19 deletions(-) base-commit: af43c2f945c42cc7d111de63abed9ca3df830ca4 prerequisite-patch-id: 1298ff340024778a333472d63b8bf28c618ccad7 prerequisite-patch-id: 1967c9e8fb4ab43fc8b1fe9784737a36bc882076 prerequisite-patch-id: dd4ee79a61e075a5e2037b9aae68938d008f92dd prerequisite-patch-id: c3106cd30df87783fcdb30b84402d0ba232baf0e Reviewed-by: Tomi Valkeinen --- Regards, Laurent Pinchart