From patchwork Thu Aug 11 10:54:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kletzander X-Patchwork-Id: 17075 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 DBDEEC3272 for ; Thu, 11 Aug 2022 10:55:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3B6EE6332D; Thu, 11 Aug 2022 12:55:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660215315; bh=hBuZ6itUtTd3AbMntYUKbt7iqZROLrOdyvDTsl2GsCw=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gYhP+4kgFFrKsvFoiFaEmPQJOdeCi1Rg8tRbREwYe2zCojKJvY8IaJoF4QRDFJf/o iOAdmwH55hVXayoPxKGWI9ez6aFApVBTHC/yXVq5JlDgWPKS796Qu27VtnydT3pr/l Gbxxb3RR3EzkSfSw4PgvcT/VmD9gwTH952AMN0AVdZPD2VbSYF7U1y7ixVuvuI1dMS tzO/PrxGvEpgQDp04SgvmnZAHhlLlOdSBELxrCYklBSxqSFaJ3oeCLP/i3v9cwzVbW hyZaPEV8TN8Pf9ww2Jd28e1927UmRprPYQJQscUWyK8R60ebL17AJTtYSKHOGu2MWM 5AEk9EixfgTiQ== Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A2C0B6330E for ; Thu, 11 Aug 2022 12:55:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pCQN8jXL"; dkim-atps=neutral Received: by mail-ej1-x62b.google.com with SMTP id kb8so32850875ejc.4 for ; Thu, 11 Aug 2022 03:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=P6KjMfnlhwgAEAcJfU3m7emgIWC9Re3R6s/WY5d2ZcA=; b=pCQN8jXLdJ+CCvSavEntUG0rlEKAO+V3QEDv8slw8GW5ivkxX9YHrqyo1tpmZeW8tS UyIPxaNHGk1wjFx8Xr6QiDdItC6d/8chsIabA8Hwl7hzGn/RmgVpMPEyoF3IEtCNStUj CFR5jHRjEm7gk9YAjqXhynjkDPLzJN5k1SbIS7Hck1hk5MZ79nidGo4kOzjlNq/Y3kgL qQtpmz9dfeAoZ/m6S4AvoEUYcXlwzvdHNgTDf3VDjV62atETxwJ85qBJwyhnnCuR1jwy PVBA9meeOjrq85aYDQ9M1QrGOMJvQhmxgBlEywkpzuLyqZht9soqChmP5qT4nZec2Ech jMkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=P6KjMfnlhwgAEAcJfU3m7emgIWC9Re3R6s/WY5d2ZcA=; b=PCftYDqNPndPhu7MZ1dQ6YClKVdVWEep97Spi3jIFlkgPB5DXsOx0voUtkXFCTB5Sk JKRiyGruKNV5zaO9B84IvK5ByP/RSNGxD+71wZUbePPRqd66bV/+u0PTwcxfPFea0txx 6SO0VpTjRG8pkWAyLbZ5Q9hnJioU8J1aE2XMZvnDOgg0+x4tKEWRjzzHH+j9eZ8Dym3f 0YepRvHKo3VEBLXpiazuKEtUgi6uumJo0AK7Avc77Fl/yRpV7ltGpSPGLI0qASQC51xn GZyAIjU8HqBgzSzJocDtzUQ2vlllZXsv3U9rwcNk1Xx4lhQ+MO66nsgsPREzvaL8pWhU GbhA== X-Gm-Message-State: ACgBeo3UilVZxtYD/VYfujJ24WNAZzFsC0uRTGrhElm8u0Fs1R7J5kFa UtuifeQYiBx8Lfh/doa2hn5BwzoIJB4= X-Google-Smtp-Source: AA6agR6YBYdaAHpL8HL006qi/uzQP3clg5nDn7y62+oOmn0nXyKylKBvnNOoeLYTX2yaOR8h5B1Jug== X-Received: by 2002:a17:906:4fca:b0:731:5e07:e59a with SMTP id i10-20020a1709064fca00b007315e07e59amr12453748ejw.140.1660215313103; Thu, 11 Aug 2022 03:55:13 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id kx22-20020a170907775600b0072b342ad997sm3356618ejc.199.2022.08.11.03.55.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Aug 2022 03:55:12 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id EDD3A8CE426F for ; Thu, 11 Aug 2022 12:55:11 +0200 (CEST) To: libcamera-devel@lists.libcamera.org Date: Thu, 11 Aug 2022 12:54:59 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] build: Fix python dependency 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: , X-Patchwork-Original-From: Martin Kletzander via libcamera-devel From: Martin Kletzander Reply-To: Martin Kletzander Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Building with pycamera fails due to dependency search for 'python3'. Fix that by using meson's python module which searches for the proper files and various versions. Signed-off-by: Martin Kletzander --- src/py/libcamera/meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build index eb8845388692..cf2e9395de38 100644 --- a/src/py/libcamera/meson.build +++ b/src/py/libcamera/meson.build @@ -1,8 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 -py3_dep = dependency('python3', required : get_option('pycamera')) +pymod = import('python') +py3 = pymod.find_installation('python3', required : get_option('pycamera')) -if not py3_dep.found() +if not py3.found() pycamera_enabled = false subdir_done() endif @@ -60,7 +61,7 @@ pycamera_sources += custom_target('py_gen_formats', pycamera_deps = [ libcamera_public, - py3_dep, + py3.dependency(), pybind11_dep, ] @@ -71,7 +72,7 @@ pycamera_args = [ '-DLIBCAMERA_BASE_PRIVATE', ] -destdir = get_option('libdir') / ('python' + py3_dep.version()) / 'site-packages' / 'libcamera' +destdir = get_option('libdir') / ('python' + py3.language_version()) / 'site-packages' / 'libcamera' pycamera = shared_module('_libcamera', pycamera_sources,