package/rpi-rgb-led-matrix: new package

A library to control commonly available 64x64, 32x32 or 16x32
RGB LED panels with the Raspberry Pi. Can support PWM up to
11Bit per channel, providing true 24bpp color with CIE1931
profile.

Signed-off-by: Grzegorz Blach <grzegorz@blach.pl>
[Arnout: reorder build/install hooks inside conditions]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Grzegorz Blach 2021-10-11 12:06:43 +02:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent ed73210515
commit e821078031
6 changed files with 172 additions and 0 deletions

View File

@ -1098,6 +1098,7 @@ F: package/python-pyjwt/
F: package/python-redis/
F: package/python-rpi-ws281x/
F: package/python-wtforms/
F: package/rpi-rgb-led-matrix/
N: Guillaume William Brs <guillaume.bressaix@gmail.com>
F: package/libnids/

View File

@ -1621,6 +1621,7 @@ menu "Hardware handling"
source "package/neardal/Config.in"
source "package/owfs/Config.in"
source "package/pcsc-lite/Config.in"
source "package/rpi-rgb-led-matrix/Config.in"
source "package/tslib/Config.in"
source "package/uhd/Config.in"
source "package/urg/Config.in"

View File

@ -0,0 +1,46 @@
From 056a189836a82b832cd8e6f886cb2090344bfa08 Mon Sep 17 00:00:00 2001
From: Grzegorz Blach <grzegorz@blach.pl>
Date: Sat, 29 Aug 2020 20:48:57 +0200
Subject: [PATCH] Rename LDFLAGS to RGB_LDFLAGS.
This change allows additional flags to be added to the linker
from the command line.
Signed-off-by: Grzegorz Blach <grzegorz@blach.pl>
---
utils/Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/utils/Makefile b/utils/Makefile
index e751adc..e704442 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -12,7 +12,7 @@ RGB_INCDIR=$(RGB_LIB_DISTRIBUTION)/include
RGB_LIBDIR=$(RGB_LIB_DISTRIBUTION)/lib
RGB_LIBRARY_NAME=rgbmatrix
RGB_LIBRARY=$(RGB_LIBDIR)/lib$(RGB_LIBRARY_NAME).a
-LDFLAGS+=-L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lrt -lm -lpthread
+RGB_LDFLAGS+=-L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lrt -lm -lpthread
# Imagemagic flags, only needed if actually compiled.
MAGICK_CXXFLAGS?=$(shell GraphicsMagick++-config --cppflags --cxxflags)
@@ -28,13 +28,13 @@ $(RGB_LIBRARY): FORCE
$(MAKE) -C $(RGB_LIBDIR)
text-scroller: text-scroller.o $(RGB_LIBRARY)
- $(CXX) $(CXXFLAGS) text-scroller.o -o $@ $(LDFLAGS)
+ $(CXX) $(CXXFLAGS) text-scroller.o -o $@ $(LDFLAGS) $(RGB_LDFLAGS)
led-image-viewer: led-image-viewer.o $(RGB_LIBRARY)
- $(CXX) $(CXXFLAGS) led-image-viewer.o -o $@ $(LDFLAGS) $(MAGICK_LDFLAGS)
+ $(CXX) $(CXXFLAGS) led-image-viewer.o -o $@ $(LDFLAGS) $(RGB_LDFLAGS) $(MAGICK_LDFLAGS)
video-viewer: video-viewer.o $(RGB_LIBRARY)
- $(CXX) $(CXXFLAGS) video-viewer.o -o $@ $(LDFLAGS) $(AV_LDFLAGS)
+ $(CXX) $(CXXFLAGS) video-viewer.o -o $@ $(LDFLAGS) $(RGB_LDFLAGS) $(AV_LDFLAGS)
%.o : %.cc
$(CXX) -I$(RGB_INCDIR) $(CXXFLAGS) -c -o $@ $<
--
2.24.3 (Apple Git-128)

View File

@ -0,0 +1,43 @@
config BR2_PACKAGE_RPI_RGB_LED_MATRIX
bool "rpi-rgb-led-matrix"
depends on BR2_aarch64 || BR2_arm
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on !BR2_STATIC_LIBS
help
A library to control commonly available 64x64, 32x32 or 16x32
RGB LED panels with the Raspberry Pi. Can support PWM up to
11Bit per channel, providing true 24bpp color with CIE1931
profile.
https://github.com/hzeller/rpi-rgb-led-matrix
if BR2_PACKAGE_RPI_RGB_LED_MATRIX
config BR2_PACKAGE_RPI_RGB_LED_MATRIX_IMAGE_VIEWER
bool "Build led-image-viewer"
select BR2_PACKAGE_GRAPHICSMAGICK
help
The image viewer reads all kinds of image formats,
including animated gifs.
config BR2_PACKAGE_RPI_RGB_LED_MATRIX_TEXT_SCROLLER
bool "Build text-scroller"
help
The text scroller allows to show some scrolling text.
config BR2_PACKAGE_RPI_RGB_LED_MATRIX_VIDEO_VIEWER
bool "Build video-viewer"
select BR2_PACKAGE_FFMPEG
select BR2_PACKAGE_FFMPEG_SWSCALE
help
The video viewer allows to play common video formats
on the RGB matrix (just the picture, no sound).
endif
comment "rpi-rgb-led-matrix needs a toolchain w/ C++, threads, dynamic library"
depends on BR2_aarch64 || BR2_arm
depends on !BR2_INSTALL_LIBSTDCPP || \
!BR2_TOOLCHAIN_HAS_THREADS || \
BR2_STATIC_LIBS

View File

@ -0,0 +1,3 @@
# Locally computed:
sha256 5efc0293bb180b958079910e968721ff2dac291c435d065ecec9ceba8589567d rpi-rgb-led-matrix-63e3e7ffdbe88223cc80e1faa508bc4f3cf2bea4.tar.gz
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING

View File

@ -0,0 +1,78 @@
################################################################################
#
# rpi-rgb-led-matrix
#
################################################################################
RPI_RGB_LED_MATRIX_VERSION = 63e3e7ffdbe88223cc80e1faa508bc4f3cf2bea4
RPI_RGB_LED_MATRIX_SITE = $(call github,hzeller,rpi-rgb-led-matrix,$(RPI_RGB_LED_MATRIX_VERSION))
RPI_RGB_LED_MATRIX_LICENSE = GPL-2.0
RPI_RGB_LED_MATRIX_LICENSE_FILES = COPYING
RPI_RGB_LED_MATRIX_INSTALL_STAGING = YES
define RPI_RGB_LED_MATRIX_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/lib all
endef
define RPI_RGB_LED_MATRIX_INSTALL_STAGING_CMDS
$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/rpi-rgb-led-matrix/
$(INSTALL) -m 0644 $(@D)/include/*.h $(STAGING_DIR)/usr/include/rpi-rgb-led-matrix/
$(INSTALL) -D -m 0644 $(@D)/lib/librgbmatrix.a $(STAGING_DIR)/usr/lib/librgbmatrix.a
$(INSTALL) -D -m 0755 $(@D)/lib/librgbmatrix.so.1 $(STAGING_DIR)/usr/lib/librgbmatrix.so.1
ln -sf librgbmatrix.so.1 $(STAGING_DIR)/usr/lib/librgbmatrix.so
endef
define RPI_RGB_LED_MATRIX_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/lib/librgbmatrix.so.1 $(TARGET_DIR)/usr/lib/librgbmatrix.so.1
ln -sf librgbmatrix.so.1 $(TARGET_DIR)/usr/lib/librgbmatrix.so
endef
ifeq ($(BR2_PACKAGE_RPI_RGB_LED_MATRIX_IMAGE_VIEWER),y)
RPI_RGB_LED_MATRIX_DEPENDENCIES += graphicsmagick
define RPI_RGB_LED_MATRIX_BUILD_IMAGE_VIEWER_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) \
MAGICK_CXXFLAGS="-I$(STAGING_DIR)/usr/include/GraphicsMagick $(shell $(STAGING_DIR)/usr/bin/GraphicsMagick++-config --cxxflags)" \
MAGICK_LDFLAGS="-L$(STAGING_DIR)/usr/lib $(shell $(STAGING_DIR)/usr/bin/GraphicsMagick++-config --libs)" \
-C $(@D)/utils led-image-viewer
endef
RPI_RGB_LED_MATRIX_POST_BUILD_HOOKS += RPI_RGB_LED_MATRIX_BUILD_IMAGE_VIEWER_CMDS
define RPI_RGB_LED_MATRIX_INSTALL_IMAGE_VIEWER_CMDS
$(INSTALL) -D -m 0755 $(@D)/utils/led-image-viewer $(TARGET_DIR)/usr/bin/led-image-viewer
endef
RPI_RGB_LED_MATRIX_POST_INSTALL_TARGET_HOOKS += RPI_RGB_LED_MATRIX_INSTALL_IMAGE_VIEWER_CMDS
endif
ifeq ($(BR2_PACKAGE_RPI_RGB_LED_MATRIX_TEXT_SCROLLER),y)
define RPI_RGB_LED_MATRIX_BUILD_TEXT_SCROLLER_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/utils text-scroller
endef
RPI_RGB_LED_MATRIX_POST_BUILD_HOOKS += RPI_RGB_LED_MATRIX_BUILD_TEXT_SCROLLER_CMDS
define RPI_RGB_LED_MATRIX_INSTALL_TEXT_SCROLLER_CMDS
$(INSTALL) -D -m 0755 $(@D)/utils/text-scroller $(TARGET_DIR)/usr/bin/text-scroller
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/rpi-rgb-led-matrix/fonts/
$(INSTALL) -m 0644 $(@D)/fonts/*.bdf $(TARGET_DIR)/usr/share/rpi-rgb-led-matrix/fonts/
endef
RPI_RGB_LED_MATRIX_POST_INSTALL_TARGET_HOOKS += RPI_RGB_LED_MATRIX_INSTALL_TEXT_SCROLLER_CMDS
endif
ifeq ($(BR2_PACKAGE_RPI_RGB_LED_MATRIX_VIDEO_VIEWER),y)
RPI_RGB_LED_MATRIX_DEPENDENCIES += ffmpeg
define RPI_RGB_LED_MATRIX_BUILD_VIDEO_VIEWER_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) \
AV_CXXFLAGS="$(shell $(HOST_DIR)/bin/pkg-config --cflags libavcodec libavformat libswscale libavutil)" \
AV_LDFLAGS="$(shell $(HOST_DIR)/bin/pkg-config --libs libavcodec libavformat libswscale libavutil)" \
-C $(@D)/utils video-viewer
endef
RPI_RGB_LED_MATRIX_POST_BUILD_HOOKS += RPI_RGB_LED_MATRIX_BUILD_VIDEO_VIEWER_CMDS
define RPI_RGB_LED_MATRIX_INSTALL_VIDEO_VIEWER_CMDS
$(INSTALL) -D -m 0755 $(@D)/utils/video-viewer $(TARGET_DIR)/usr/bin/video-viewer
endef
RPI_RGB_LED_MATRIX_POST_INSTALL_TARGET_HOOKS += RPI_RGB_LED_MATRIX_INSTALL_VIDEO_VIEWER_CMDS
endif
$(eval $(generic-package))