From 8ff3e5831d29bab09818e1d96f7f5f191828b021 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 29 Oct 2022 00:53:28 +0200 Subject: [PATCH] - add serdisplib --- package/neutrino/neutrino.mk | 1 + .../patches/0001-allow-1bpp-framebuffer.patch | 21 ++++ .../patches/0002-cross-compile.patch | 101 ++++++++++++++++++ package/serdisplib/serdisplib.mk | 22 ++++ 4 files changed, 145 insertions(+) create mode 100644 package/serdisplib/patches/0001-allow-1bpp-framebuffer.patch create mode 100644 package/serdisplib/patches/0002-cross-compile.patch create mode 100644 package/serdisplib/serdisplib.mk diff --git a/package/neutrino/neutrino.mk b/package/neutrino/neutrino.mk index 96a2f426..28ed645c 100644 --- a/package/neutrino/neutrino.mk +++ b/package/neutrino/neutrino.mk @@ -84,6 +84,7 @@ NEUTRINO_CONF_OPTS = \ --enable-mdev \ --enable-pip \ --enable-pugixml \ + --enable-lcd \ \ --with-omdb-api-key="$(BS_PACKAGE_NEUTRINO_OMDB_API_KEY)" \ --with-shoutcast-dev-key="$(BS_PACKAGE_NEUTRINO_SHOUTCAST_DEV_KEY)" \ diff --git a/package/serdisplib/patches/0001-allow-1bpp-framebuffer.patch b/package/serdisplib/patches/0001-allow-1bpp-framebuffer.patch new file mode 100644 index 00000000..ada4281e --- /dev/null +++ b/package/serdisplib/patches/0001-allow-1bpp-framebuffer.patch @@ -0,0 +1,21 @@ +--- a/src/serdisp_specific_framebuffer.c ++++ b/src/serdisp_specific_framebuffer.c +@@ -312,13 +312,15 @@ serdisp_t* serdisp_framebuffer_setup(con + + if (fb_success) { + /* check if colour mode is supported */ +- if (! (vinfo.bits_per_pixel == 16 || vinfo.bits_per_pixel == 24 || vinfo.bits_per_pixel == 32) ) { ++ if (! (vinfo.bits_per_pixel == 1 ||vinfo.bits_per_pixel == 16 || vinfo.bits_per_pixel == 24 || vinfo.bits_per_pixel == 32) ) { + sd_error(SERDISP_ERUNTIME, "unsupported colour depth (%d)", vinfo.bits_per_pixel); + fb_success = 0; + } + } +- +- dd->scrbuf_size = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8; ++ if (vinfo.bits_per_pixel == 1) ++ dd->scrbuf_size = (vinfo.xres * vinfo.yres) / 8; ++ else ++ dd->scrbuf_size = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8; + + if (fb_success) { + /* map framebuffer device to memory */ diff --git a/package/serdisplib/patches/0002-cross-compile.patch b/package/serdisplib/patches/0002-cross-compile.patch new file mode 100644 index 00000000..33932225 --- /dev/null +++ b/package/serdisplib/patches/0002-cross-compile.patch @@ -0,0 +1,101 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -44,8 +44,8 @@ all: + done && test -z "$$fail" + + install: +- $(top_srcdir)/mkinstalldirs $(libdir)/pkgconfig +- $(INSTALL_DATA) serdisplib.pc $(libdir)/pkgconfig/ ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig ++ $(INSTALL_DATA) serdisplib.pc $(DESTDIR)$(libdir)/pkgconfig/ + @for dir in ${subdirs}; do \ + (cd $(srcdir) && cd $$dir && $(MAKE) install) \ + || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ +--- a/server/Makefile.in ++++ b/server/Makefile.in +@@ -102,9 +102,9 @@ distclean: clean + + + install: $(PROGRAMS) +- $(top_srcdir)/mkinstalldirs $(bindir) +- $(top_srcdir)/mkinstalldirs $(sbindir) +- $(top_srcdir)/mkinstalldirs $(sysconfdir) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir) + list='$(PROGRAMS_SBIN)'; \ + for prog in $$list; do \ + $(INSTALL_PROGRAM) $$prog $(sbindir)/ ; \ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -28,7 +28,7 @@ includedir = @includedir@ + datarootdir = @datarootdir@ + + CC=@CC@ +-AR=@AR@ -r ++AR=@AR@ + LN_S=@LN_S@ + INSTALL=@INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -184,14 +184,14 @@ programs: $(PROGRAMS) + $(CC) $(CFLAGS) $(DEFINES) -c $< + + $(LIB_DIR)/$(LIB_STATIC): $(LIB_OBJECTS) +- $(top_srcdir)/mkinstalldirs $(top_srcdir)/lib +- $(AR) $(LIB_DIR)/$(LIB_STATIC) $(LIB_OBJECTS) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(top_srcdir)/lib ++ $(AR) -r -- $(LIB_DIR)/$(LIB_STATIC) $(LIB_OBJECTS) + + $(LIB_DIR)/$(LIB_SHARED): $(LIB_OBJECTS) +- $(top_srcdir)/mkinstalldirs $(top_srcdir)/lib ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(top_srcdir)/lib + $(CC) -fPIC -shared $(SONAME_FLAG) -o $(LIB_DIR)/$(LIB_SHARED) $(LIB_OBJECTS) $(LDFLAGS) $(EXTRA_LIBS) +- cd $(LIB_DIR) && $(LN_S) -f $(LIB_SHARED) lib$(LIB_NAME).so.$(VERSION_MAJOR) +- cd $(LIB_DIR) && $(LN_S) -f lib$(LIB_NAME).so.$(VERSION_MAJOR) lib$(LIB_NAME).so ++ cd $(DESTDIR)$(LIB_DIR) && $(LN_S) -f $(LIB_SHARED) lib$(LIB_NAME).so.$(VERSION_MAJOR) ++ cd $(DESTDIR)$(LIB_DIR) && $(LN_S) -f lib$(LIB_NAME).so.$(VERSION_MAJOR) lib$(LIB_NAME).so + + testserdisp: $(LIB_DIR)/$(LIB_STATIC) $(OBJECTS) + $(CC) -o testserdisp $(OBJECTS) $(LIB_SERDISP) $(EXTRA_LIBS_STATIC) +@@ -204,20 +204,20 @@ distclean: clean + /bin/rm -f Makefile + + install: $(LIB_DIR)/$(LIB_SHARED) $(LIB_DIR)/$(LIB_STATIC) +- $(top_srcdir)/mkinstalldirs $(bindir) +- $(top_srcdir)/mkinstalldirs $(libdir) +- $(top_srcdir)/mkinstalldirs $(includedir) +- $(top_srcdir)/mkinstalldirs $(includedir)/serdisplib ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(includedir) ++ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(includedir)/serdisplib + +- $(INSTALL_PROGRAM) $(PROGRAMS) $(bindir)/ +- $(INSTALL_PROGRAM) $(LIB_DIR)/$(LIB_SHARED) $(libdir)/ +- $(INSTALL_DATA) $(LIB_DIR)/$(LIB_STATIC) $(libdir)/ ++ $(INSTALL_PROGRAM) $(PROGRAMS) $(DESTDIR)$(bindir)/ ++ $(INSTALL_PROGRAM) $(LIB_DIR)/$(LIB_SHARED) $(DESTDIR)$(libdir)/ ++ $(INSTALL_DATA) $(LIB_DIR)/$(LIB_STATIC) $(DESTDIR)$(libdir)/ + list='$(LIB_HEADERFILES)'; \ + for headerfile in $$list; do \ +- $(INSTALL_DATA) ../include/serdisplib/$$headerfile $(includedir)/serdisplib/ ; \ ++ $(INSTALL_DATA) ../include/serdisplib/$$headerfile $(DESTDIR)$(includedir)/serdisplib/ ; \ + done +- cd $(libdir) && $(LN_S) -f $(LIB_SHARED) lib$(LIB_NAME).so.$(VERSION_MAJOR) +- cd $(libdir) && $(LN_S) -f lib$(LIB_NAME).so.$(VERSION_MAJOR) lib$(LIB_NAME).so ++ cd $(DESTDIR)$(libdir) && $(LN_S) -f $(LIB_SHARED) lib$(LIB_NAME).so.$(VERSION_MAJOR) ++ cd $(DESTDIR)$(libdir) && $(LN_S) -f lib$(LIB_NAME).so.$(VERSION_MAJOR) lib$(LIB_NAME).so + + uninstall: + -/bin/rm -f $(libdir)/libserdisp* +--- a/tools/Makefile.in ++++ b/tools/Makefile.in +@@ -151,7 +151,7 @@ distclean: clean + install: $(PROGRAMS) + list='$(PROGRAMS)'; \ + for prog in $$list; do \ +- $(INSTALL_PROGRAM) $$prog $(bindir)/ ; \ ++ $(INSTALL_PROGRAM) $$prog $(DESTDIR)$(bindir)/ ; \ + done + + uninstall: $(PROGRAMS) diff --git a/package/serdisplib/serdisplib.mk b/package/serdisplib/serdisplib.mk new file mode 100644 index 00000000..ef78e6e2 --- /dev/null +++ b/package/serdisplib/serdisplib.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# serdisplib +# +################################################################################ + +SERDISPLIB_VERSION = 2.02 +SERDISPLIB_DIR = serdisplib-$(SERDISPLIB_VERSION) +SERDISPLIB_SOURCE = serdisplib-$(SERDISPLIB_VERSION).tar.gz +SERDISPLIB_SITE = https://sourceforge.net/projects/serdisplib/files/serdisplib/$(SERDISPLIB_VERSION) + +SERDISPLIB_DEPENDS = libusb-compat + +SERDISPLIB_CONF_OPTS = \ + --bindir=$(REMOVE_bindir) \ + --disable-libSDL \ + --disable-libusb \ + --disable-libdlo \ + --with-drivers='framebuffer' + +serdisplib: | $(TARGET_DIR) + $(call autotools-package)