From patchwork Fri Jan 10 12:41:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhavan Krishnan X-Patchwork-Id: 2546 Return-Path: Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 192CA60673 for ; Fri, 10 Jan 2020 13:41:46 +0100 (CET) Received: by mail-wm1-x342.google.com with SMTP id t14so1816991wmi.5 for ; Fri, 10 Jan 2020 04:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sljE80jVTtoRo1R08hsPOxtCsbzS62o5GOf52zs8ZXc=; b=bQfUSPLHt1X86ruAGBU6gKAaZAhUbyjznSrEzMnetySPBmZHTluPoSfAFPe+3GIPFd Zp0zWgjQhglQWPeutolAqTdbBPUeMS6aM2+YxbYHWKQuf2PODAmSTpJ5x7VjLWm6RvdQ gb1kQOgGUDKnlrmD5l3mHsqsi9ORmfWL4f2B1soEAwB9xFCzjDqGbyx2rll8t9Bde3IG /KmY4ULMbZg0SMmKNgvqdcXRmCo4FcgC1hwpoPwPdThVIZ/NRxuQOc92lP2bBRccPhMI kEiYOif5hgiyWeUWPETPwTVDdRWHQdye6pXmkr5Nou2y3FGb14EzP8Oi0wVQ8z++If4W 7fBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sljE80jVTtoRo1R08hsPOxtCsbzS62o5GOf52zs8ZXc=; b=Vf/3QYAm8Fsu0AIXPc7xufLT92kU25EOXea8l0eOZOTkZ3gOB4piSoNt9XVd722+tc Ga/R1urXxcvqFze/4hB0Q85++cQTZgL4aywnumeVnxJ97qGu2QYE2qbUN6tCuybfnl8y eBVEmpvcQZdd2V7Y5JM0R4B4G8KYPs1Y30vSm3KzxDnJZIbPL4cuPRuaUMFWaRG+Cdjq b3HSPx4UI79eFTqLQfzxnXsd4BxnfQsKWZn06IDiTZ6nE389/fKrI67aFn5MfD7HlKvP VPQVJPwe7qOPSpMKBexKHRQe6vF9Mwni6Y7NWakb44EltRU/s0VfD62oOut3CDNIgl6/ 5ibA== X-Gm-Message-State: APjAAAX2ARJujVASJOQw1Fsu42kyh3q7dqkea9azelD/HVnuOHlxRkKY pvkklgcZq9bezTImeUA1Aqs6tsq6o1NjovNQ2cU= X-Google-Smtp-Source: APXvYqz84Yn1uQYvvSE78ySOWX8ZrrJftwXfpHMyGG6DG7d/JcxqexOCV4QTTVw4Js7DleC9uCnm+g== X-Received: by 2002:a7b:c190:: with SMTP id y16mr4203264wmi.107.1578660105146; Fri, 10 Jan 2020 04:41:45 -0800 (PST) Received: from lhg-hackbox.linaro.org.de ([2a01:4f8:10a:2685::2]) by smtp.gmail.com with ESMTPSA id u7sm2083547wmj.3.2020.01.10.04.41.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Jan 2020 04:41:44 -0800 (PST) From: madhavan.krishnan@linaro.org To: libcamera-devel@lists.libcamera.org Cc: Madhavan Krishnan Date: Fri, 10 Jan 2020 13:41:43 +0100 Message-Id: <1578660103-29974-1-git-send-email-madhavan.krishnan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-Mailman-Approved-At: Fri, 10 Jan 2020 14:05:02 +0100 Subject: [libcamera-devel] [PATCH] meson: import python3 to use also from sysroot 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-List-Received-Date: Fri, 10 Jan 2020 12:41:46 -0000 From: Madhavan Krishnan importing python module can provide the exact path which can be used in desktop build as well as from any build system --- include/libcamera/meson.build | 4 +++- src/libcamera/meson.build | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 99abf06..83525e2 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -21,13 +21,15 @@ include_dir = join_paths(libcamera_include_dir, 'libcamera') install_headers(libcamera_api, subdir : include_dir) +python_mod = import('python3').find_python() + gen_controls = files('../../src/libcamera/gen-controls.py') control_ids_h = custom_target('control_ids_h', input : files('../../src/libcamera/control_ids.yaml', 'control_ids.h.in'), output : 'control_ids.h', depend_files : gen_controls, - command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'], + command : [python_mod, gen_controls, '-o', '@OUTPUT@', '@INPUT@'], install : true, install_dir : join_paths('include', include_dir)) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index c4f965b..243935b 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -65,13 +65,15 @@ if libudev.found() ]) endif +python_mod = import('python3').find_python() + gen_controls = files('gen-controls.py') control_ids_cpp = custom_target('control_ids_cpp', input : files('control_ids.yaml', 'control_ids.cpp.in'), output : 'control_ids.cpp', depend_files : gen_controls, - command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@']) + command : [python_mod, gen_controls, '-o', '@OUTPUT@', '@INPUT@']) libcamera_sources += control_ids_cpp libcamera_sources += control_ids_h