All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Hoffmann via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>,
	Asaf Kahlon <asafka7@gmail.com>
Subject: [Buildroot] [PATCH 2/2] package/python-can: add option to install the viewer tool
Date: Thu, 22 Aug 2024 11:59:53 +0200	[thread overview]
Message-ID: <20240822095953.524686-2-buildroot@bubu1.eu> (raw)
In-Reply-To: <20240822095953.524686-1-buildroot@bubu1.eu>

Enabling the option correctly select the python-curses module dependency
of the viewer tool.

Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
---
 package/python-can/Config.in     | 7 +++++++
 package/python-can/python-can.mk | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/package/python-can/Config.in b/package/python-can/Config.in
index 61955a2b00..36e25b8764 100644
--- a/package/python-can/Config.in
+++ b/package/python-can/Config.in
@@ -11,3 +11,10 @@ config BR2_PACKAGE_PYTHON_CAN
 	  Python.
 
 	  https://github.com/hardbyte/python-can
+
+config BR2_PACKAGE_PYTHON_CAN_VIEWER
+	bool "python-can-viewer"
+	depends on BR2_PACKAGE_PYTHON_CAN
+	select BR2_PACKAGE_PYTHON3_CURSES # runtime
+	help
+	  Also install the viewer tool (requires ncurses).
diff --git a/package/python-can/python-can.mk b/package/python-can/python-can.mk
index b6547a4d3f..bc67be4f8c 100644
--- a/package/python-can/python-can.mk
+++ b/package/python-can/python-can.mk
@@ -11,4 +11,11 @@ PYTHON_CAN_SETUP_TYPE = setuptools
 PYTHON_CAN_LICENSE = LGPL-3.0
 PYTHON_CAN_LICENSE_FILES = LICENSE.txt
 
+ifneq ($(BR2_PACKAGE_PYTHON_CAN_VIEWER),y)
+define PYTHON_CAN_REMOVE_VIEWER
+	rm -f $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/can/viewer.py
+endef
+PYTHON_CAN_POST_INSTALL_TARGET_HOOKS += PYTHON_CAN_REMOVE_VIEWER
+endif
+
 $(eval $(python-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-08-22 10:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  9:59 [Buildroot] [PATCH 1/2] package/python-can: bump to 4.4.2 Marcus Hoffmann via buildroot
2024-08-22  9:59 ` Marcus Hoffmann via buildroot [this message]
2024-08-23 17:36   ` [Buildroot] [PATCH 2/2] package/python-can: add option to install the viewer tool Thomas Petazzoni via buildroot
2024-08-23 17:35 ` [Buildroot] [PATCH 1/2] package/python-can: bump to 4.4.2 Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240822095953.524686-2-buildroot@bubu1.eu \
    --to=buildroot@buildroot.org \
    --cc=angelo.compagnucci@gmail.com \
    --cc=asafka7@gmail.com \
    --cc=buildroot@bubu1.eu \
    --cc=james.hilliard1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.