serdisplib: add package
authorDaniel Golle <daniel@makrotopia.org>
Sat, 21 Sep 2019 19:37:03 +0000 (21:37 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Sat, 21 Sep 2019 19:37:48 +0000 (21:37 +0200)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libs/serdisplib/Makefile [new file with mode: 0644]
libs/serdisplib/patches/001-fix-static-libary-build.patch [new file with mode: 0644]
libs/serdisplib/patches/002-allow-1bpp-framebuffer.patch [new file with mode: 0644]

diff --git a/libs/serdisplib/Makefile b/libs/serdisplib/Makefile
new file mode 100644 (file)
index 0000000..520b3bf
--- /dev/null
@@ -0,0 +1,76 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=serdisplib
+PKG_VERSION:=2.01
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/serdisplib
+PKG_HASH:=a0a4eb6339de33f694e8eec1731bbe31789493434f747998a8788c2d0e6c324b
+PKG_LICENSE:=GPL-2.0
+PLG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_ARGS += --enable-dynloading --disable-statictools
+
+define Package/serdisplib
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=serdisplib
+  URL:=http://serdisplib.sourceforge.net/
+endef
+
+define Package/serdisplib/description
+ serdisplib started as a library to drive serial displays with
+ built-in controllers. It can optionally dynamically link with
+ libusb-compat, libgd and libpthread, some features require having
+ those packages installed as well.
+endef
+
+define Package/serdisplib-tools
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=serdisplib tools
+  URL:=http://serdisplib.sourceforge.net/
+  DEPENDS:=+serdisplib +libgd
+endef
+
+define Package/serdisplib-tools/description
+ serdisplib started as a library to drive serial displays with
+ built-in controllers. This package contains tools for serdisplib:
+ * l4m132c_tool
+ * l4m320t_tool
+ * multidisplay
+ * sdcmegtron_tool
+ * touchscreen_tool
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/serdisplib
+       $(CP) $(PKG_BUILD_DIR)/include/serdisplib/*.h $(1)/usr/include/serdisplib
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/*.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/serdisplib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/*.so* $(1)/usr/lib/
+endef
+
+define Package/serdisplib-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/l4m132c_tool $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/l4m320t_tool $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/multidisplay $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/sdcmegtron_tool $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/touchscreen_tool $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,serdisplib))
+$(eval $(call BuildPackage,serdisplib-tools))
diff --git a/libs/serdisplib/patches/001-fix-static-libary-build.patch b/libs/serdisplib/patches/001-fix-static-libary-build.patch
new file mode 100644 (file)
index 0000000..5162b0e
--- /dev/null
@@ -0,0 +1,22 @@
+Index: serdisplib-2.01/src/Makefile.in
+===================================================================
+--- serdisplib-2.01.orig/src/Makefile.in
++++ serdisplib-2.01/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@
+@@ -180,7 +180,7 @@ programs: $(PROGRAMS)
+ $(LIB_DIR)/$(LIB_STATIC): $(LIB_OBJECTS)
+       $(top_srcdir)/mkinstalldirs $(top_srcdir)/lib
+-      $(AR) $(LIB_DIR)/$(LIB_STATIC) $(LIB_OBJECTS)
++      $(AR) -r -- $(LIB_DIR)/$(LIB_STATIC) $(LIB_OBJECTS)
+ $(LIB_DIR)/$(LIB_SHARED): $(LIB_OBJECTS)
+       $(top_srcdir)/mkinstalldirs $(top_srcdir)/lib
diff --git a/libs/serdisplib/patches/002-allow-1bpp-framebuffer.patch b/libs/serdisplib/patches/002-allow-1bpp-framebuffer.patch
new file mode 100644 (file)
index 0000000..7bc059e
--- /dev/null
@@ -0,0 +1,23 @@
+Index: serdisplib-2.01/src/serdisp_specific_framebuffer.c
+===================================================================
+--- serdisplib-2.01.orig/src/serdisp_specific_framebuffer.c
++++ serdisplib-2.01/src/serdisp_specific_framebuffer.c
+@@ -306,13 +306,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 */