diff mbox series

[[meta-swupdate] 2/7] lua: add tekui

Message ID 1531042617-6503-2-git-send-email-sbabic@denx.de
State Accepted
Headers show
Series [[meta-swupdate] 2/7] lua: add tekui | expand

Commit Message

Stefano Babic July 8, 2018, 9:36 a.m. UTC
TekUI is a small, freestanding and portable graphical user interface (GUI)
toolkit written in Lua and C. Due to its small footprint, it is
a good choice to build a GUI for the rescue system.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 .../tekui/files/0001-Fix-config-for-OE.patch       | 101 +++++++++++++++++++++
 recipes-lua/tekui/tekui_1.12.bb                    |  50 ++++++++++
 2 files changed, 151 insertions(+)
 create mode 100644 recipes-lua/tekui/files/0001-Fix-config-for-OE.patch
 create mode 100644 recipes-lua/tekui/tekui_1.12.bb
diff mbox series

Patch

diff --git a/recipes-lua/tekui/files/0001-Fix-config-for-OE.patch b/recipes-lua/tekui/files/0001-Fix-config-for-OE.patch
new file mode 100644
index 0000000..5e92064
--- /dev/null
+++ b/recipes-lua/tekui/files/0001-Fix-config-for-OE.patch
@@ -0,0 +1,101 @@ 
+From 54b0fc6c15cd4b9dcc9a5a9a39e6be2398128eb8 Mon Sep 17 00:00:00 2001
+From: Kas User <kas@example.com>
+Date: Mon, 7 May 2018 10:51:03 +0200
+Subject: [PATCH] Fix config for OE
+
+Signed-off-by: Kas User <kas@example.com>
+---
+ config | 31 +++++++++++++++++--------------
+ 1 file changed, 17 insertions(+), 14 deletions(-)
+
+diff --git a/config b/config
+index 8664568..31e65a2 100644
+--- a/config
++++ b/config
+@@ -27,7 +27,7 @@ DISPLAY_DRIVER ?= x11
+ # Uncomment TSYS_POSIX if your platform is not listed in include/tek/config.h
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 
+-CC = $(CROSS_COMPILE)gcc -fpic # -DTSYS_POSIX
++CC ?= $(CROSS_COMPILE)gcc -fpic # -DTSYS_POSIX
+ 
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # For Windows using MinGW:
+@@ -117,8 +117,8 @@ TEKUI_LIBS =
+ PNG_DIR = $(PREFIX)
+ PNG_INCDIR = $(PNG_DIR)/include
+ PNG_LIBDIR = $(PNG_DIR)/lib
+-# TEKUI_DEFS += -DENABLE_PNG -I$(PNG_INCDIR)
+-# TEKUI_LIBS += -L$(PNG_LIBDIR) -lpng # $(CC_LD_RT)$(PNG_LIBDIR)
++TEKUI_DEFS += -DENABLE_PNG -I$(PNG_INCDIR)
++TEKUI_LIBS += -L$(PNG_LIBDIR) -lpng # $(CC_LD_RT)$(PNG_LIBDIR)
+ 
+ TEKLIB_DEFS = -DENABLE_LAZY_SINGLETON
+ 
+@@ -129,13 +129,14 @@ TEKLIB_DEFS = -DENABLE_LAZY_SINGLETON
+ #------------------------------------------------------------------------------
+ 
+ PREFIX ?= /usr/local
+-LUAVER ?= 5.1
++LUAVER ?= `pkg-config --modversion lua | cut -d'.' -f1,2`
+ 
+ LUA_DIR = $(PREFIX)
+ LUA_INCDIR = $(LUA_DIR)/include
+-LUA_DEFS = -I$(LUA_INCDIR) -I/usr/include/lua$(LUAVER)
++#LUA_DEFS = -I$(LUA_INCDIR) -I/usr/include/lua$(LUAVER)
++LUA_DEFS = `pkg-config --cflags lua` #$(LUA_DIR)/include
+ # some known paths in distributions and toolchains:
+-LUA_DEFS += -I/usr/local/include/lua51 -I/usr/include/lua5.1
++#LUA_DEFS += -I/usr/local/include/lua51 -I/usr/include/lua5.1
+ 
+ LUA_LIB = $(PREFIX)/lib/lua/$(LUAVER)
+ LUA_SHARE = $(PREFIX)/share/lua/$(LUAVER)
+@@ -146,11 +147,13 @@ SYS_LUA_SHARE = $(PREFIX)/share/lua/$(LUAVER)
+ # Libraries:
+ #------------------------------------------------------------------------------
+ 
+-FREETYPE_DIR = $(PREFIX)
+-FREETYPE_INCDIR = $(FREETYPE_DIR)/include
+-FREETYPE_LIBDIR = $(FREETYPE_DIR)/lib
+-FREETYPE_LIBS = -L$(FREETYPE_LIBDIR) -lfreetype # $(CC_LD_RT)$(FREETYPE_LIBDIR)
+-FREETYPE_DEFS = -I$(FREETYPE_INCDIR)/freetype2 `freetype-config --cflags`
++#FREETYPE_DIR = $(PREFIX)
++#FREETYPE_INCDIR = $(FREETYPE_DIR)/include
++#FREETYPE_LIBDIR = $(FREETYPE_DIR)/lib
++FREETYPE_INCDIR = `pkg-config --cflags freetype2`
++#FREETYPE_LIBS = -L$(FREETYPE_LIBDIR) -lfreetype # $(CC_LD_RT)$(FREETYPE_LIBDIR)
++FREETYPE_LIBS = `pkg-config --libs freetype2`
++FREETYPE_DEFS = $(FREETYPE_INCDIR)
+ 
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # X11 defines and libraries:
+@@ -170,7 +173,7 @@ XFT_DIR = $(X11_DIR)
+ XFT_INCDIR = $(XFT_DIR)/include
+ XFT_LIBDIR = $(XFT_DIR)/lib
+ XFT_LIBS = -L$(XFT_LIBDIR) -lXft # $(CC_LD_RT)$(XFT_LIBDIR)
+-XFT_DEFS = -I$(XFT_INCDIR) -DENABLE_XFT
++XFT_DEFS = -I$(XFT_INCDIR) # -DENABLE_XFT
+ 
+ FONTCONFIG_DIR = $(PREFIX)
+ FONTCONFIG_INCDIR = $(FONTCONFIG_DIR)/include
+@@ -254,7 +257,7 @@ LUAARCH = -m64 # -m32 for 32bit, -m64 for 64bit architecture
+ # Build tools:
+ #------------------------------------------------------------------------------
+ 
+-AR = $(CROSS_COMPILE)ar rcu
++AR = ar rcu
+ RM = rm -f
+ RMDIR = rm -rf
+ MKDIR = mkdir -p
+@@ -262,7 +265,7 @@ ECHO = echo
+ INSTALL_B = install
+ INSTALL_F = install
+ INSTALL_D = install -d
+-INSTALL_S = install -s
++INSTALL_S = install 
+ 
+ #------------------------------------------------------------------------------
+ # Predefined targets:
+-- 
+2.7.4
+
diff --git a/recipes-lua/tekui/tekui_1.12.bb b/recipes-lua/tekui/tekui_1.12.bb
new file mode 100644
index 0000000..ff00991
--- /dev/null
+++ b/recipes-lua/tekui/tekui_1.12.bb
@@ -0,0 +1,50 @@ 
+# Recipe created by recipetool
+# This is the basis of a recipe and may need further editing in order to be fully functional.
+# (Feel free to remove these comments when editing.)
+
+# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
+# your responsibility to verify that the values are complete and correct.
+#
+# The following license files were not able to be identified and are
+# represented as "Unknown" below, you will need to check them yourself:
+#   COPYRIGHT
+#   tek/ui/font/COPYRIGHT.TXT
+#   doc/copyright.html
+#   src/display_rawfb/vnc/COPYING
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f8640872a50cd4ee663b8fb2f603b854 \
+                    file://tek/ui/font/COPYRIGHT.TXT;md5=27d7484b1e18d0ee4ce538644a3f04be \
+                    file://doc/copyright.html;md5=e0ef847c1e1b62ee80317a79b7cd99de \
+                    file://src/display_rawfb/vnc/COPYING;md5=361b6b837cad26c6900a926b62aada5f"
+
+SRC_URI = "http://tekui.neoscientists.org/releases/tekui-1.12-r1.tgz \
+           file://0001-Fix-config-for-OE.patch \
+	"
+SRC_URI[md5sum] = "cf67e1aa5583ee22e5f63ad2b297e2c9"
+SRC_URI[sha256sum] = "d3130a9403e05b8322e47b5e8c0716f5ccf2956ecae6e1268b05085a774b0894"
+
+PR = "r1"
+
+S = "${WORKDIR}/${PN}-${PV}-${PR}"
+
+PACKAGES += "${PN}-examples"
+FILES_${PN} = "${libdir} ${datadir}/lua" 
+
+inherit pkgconfig
+
+# NOTE: the following library dependencies are unknown, ignoring: imgload display_directfb tekc tek region imgcache tekdebug utf8 display_win visual exec hal display_rawfb cachemanager display_x11 pixconv
+#       (this is based on recipes that have previously been built and packaged)
+# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation
+DEPENDS = "libx11 readline lua freetype libpng fontconfig"
+DEPENDS = "lua freetype libpng fontconfig"
+RDEPENDS_${PN} += "lua"
+
+EXTRA_OEMAKE = 'PREFIX=${D}/usr DISPLAY_DRIVER=rawfb CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} -fpic"'
+
+do_compile () {
+	oe_runmake all
+}
+
+do_install () {
+	oe_runmake install
+}