From patchwork Mon Jan 22 19:31:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 38153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B443C47DAF for ; Mon, 22 Jan 2024 19:31:53 +0000 (UTC) Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) by mx.groups.io with SMTP id smtpd.web10.1702.1705951909096799085 for ; Mon, 22 Jan 2024 11:31:49 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: t-online.de, ip: 194.25.134.21, mailfrom: f_l_k@t-online.de) Received: from fwd75.aul.t-online.de (fwd75.aul.t-online.de [10.223.144.101]) by mailout10.t-online.de (Postfix) with SMTP id 8E9BE1EA79 for ; Mon, 22 Jan 2024 20:31:17 +0100 (CET) Received: from intel-corei7-64.fritz.box ([84.163.35.62]) by fwd75.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1rS00q-0XEiVl0; Mon, 22 Jan 2024 20:31:16 +0100 From: Markus Volk To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][PATCH 1/3] lua: add recipe for lua-5.2 Date: Mon, 22 Jan 2024 20:31:07 +0100 Message-ID: <20240122193109.3041355-1-f_l_k@t-online.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1705951876-0CA7E850-63DD6BAC/0/0 CLEAN NORMAL X-TOI-MSGID: 6f60f0d3-8ea1-4c64-a654-c27f617905a0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 22 Jan 2024 19:31:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/108374 mpv only supports lua-5.2 and luajit. Add lua-5.2 to unblock gui build for platforms that dont support luajit Signed-off-by: Markus Volk --- .../lua/lua-5.2/Makefile-build-so.patch | 82 +++++++++++++++++++ .../recipes-devtools/lua/lua-5.2/lua.pc.in | 10 +++ .../recipes-devtools/lua/lua-5.2/run-ptest | 19 +++++ meta-oe/recipes-devtools/lua/lua-5.2_5.2.3.bb | 67 +++++++++++++++ 4 files changed, 178 insertions(+) create mode 100644 meta-oe/recipes-devtools/lua/lua-5.2/Makefile-build-so.patch create mode 100644 meta-oe/recipes-devtools/lua/lua-5.2/lua.pc.in create mode 100644 meta-oe/recipes-devtools/lua/lua-5.2/run-ptest create mode 100644 meta-oe/recipes-devtools/lua/lua-5.2_5.2.3.bb diff --git a/meta-oe/recipes-devtools/lua/lua-5.2/Makefile-build-so.patch b/meta-oe/recipes-devtools/lua/lua-5.2/Makefile-build-so.patch new file mode 100644 index 000000000..343d1ddd6 --- /dev/null +++ b/meta-oe/recipes-devtools/lua/lua-5.2/Makefile-build-so.patch @@ -0,0 +1,82 @@ +Upstream-Status: Inappropriate [Upstream doesn't support so libs] + +diff -ru lua-5.2.1/Makefile lua-5.2.1.new/Makefile +--- a/Makefile 2012-05-17 16:05:54.000000000 +0200 ++++ b/Makefile 2012-09-12 22:39:07.162748096 +0200 +@@ -38,16 +38,16 @@ + # Convenience platforms targets. + PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris + ++# Lua version and release. ++V= 5.2 ++R= $V.3 ++ + # What to install. + TO_BIN= lua luac + TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp +-TO_LIB= liblua.a ++TO_LIB= liblua.a liblua.so.$(R) + TO_MAN= lua.1 luac.1 + +-# Lua version and release. +-V= 5.2 +-R= $V.3 +- + # Targets start here. + all: $(PLAT) + +@@ -63,7 +63,8 @@ + cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) + cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) +- ++ ln -sf ./liblua.so.$(R) $(INSTALL_LIB)/liblua.so.$(V) ++ ln -sf ./liblua.so.$(R) $(INSTALL_LIB)/liblua.so + uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) + cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC) +diff -ru lua-5.2.1/src/luaconf.h lua-5.2.1.new/src/luaconf.h +--- lua-5.2.1/src/luaconf.h 2012-05-11 16:14:42.000000000 +0200 ++++ lua-5.2.1.new/src/luaconf.h 2012-09-12 22:40:27.986622772 +0200 +@@ -100,7 +100,7 @@ + #else /* }{ */ + + #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/" +-#define LUA_ROOT "/usr/local/" ++#define LUA_ROOT "/usr" + #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR + #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR + #define LUA_PATH_DEFAULT \ +diff -ru lua-5.2.1/src/Makefile lua-5.2.1.new/src/Makefile +--- lua-5.2.1/src/Makefile 2012-03-09 17:32:16.000000000 +0100 ++++ lua-5.2.1.new/src/Makefile 2012-09-12 22:38:08.591386896 +0200 +@@ -29,6 +29,7 @@ + PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris + + LUA_A= liblua.a ++LUA_SO= liblua.so + CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ + lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ + ltm.o lundump.o lvm.o lzio.o +@@ -43,7 +44,7 @@ + LUAC_O= luac.o + + ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) +-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) ++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) + ALL_A= $(LUA_A) + + # Targets start here. +@@ -59,6 +60,12 @@ + $(AR) $@ $(BASE_O) + $(RANLIB) $@ + ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).5.2 -o $@.5.2.3 $? -lm $(MYLDFLAGS) ++ ++ ++ ++ + $(LUA_T): $(LUA_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + diff --git a/meta-oe/recipes-devtools/lua/lua-5.2/lua.pc.in b/meta-oe/recipes-devtools/lua/lua-5.2/lua.pc.in new file mode 100644 index 000000000..c26775fa7 --- /dev/null +++ b/meta-oe/recipes-devtools/lua/lua-5.2/lua.pc.in @@ -0,0 +1,10 @@ +libdir=@LIBDIR@ +includedir=@INCLUDEDIR@ + +Name: Lua +Description: Lua language engine +Version: @VERSION@ +Requires: +Libs: -L${libdir} -llua -lm -ldl +Cflags: -I${includedir} + diff --git a/meta-oe/recipes-devtools/lua/lua-5.2/run-ptest b/meta-oe/recipes-devtools/lua/lua-5.2/run-ptest new file mode 100644 index 000000000..8e085e1af --- /dev/null +++ b/meta-oe/recipes-devtools/lua/lua-5.2/run-ptest @@ -0,0 +1,19 @@ +#!/bin/sh + +cd test +lua -e"_U=true" all.lua > lua-test.tmp + +echo "--- test output ---" +cat lua-test.tmp +echo "" +echo "" +echo "--- ptest result ---" + +grep "final OK \!\!\!" lua-test.tmp > /dev/null +if [ $? -eq 0 ]; then + echo "PASS: lua" +else + echo "FAIL: lua" +fi + +rm -f lua-test.tmp diff --git a/meta-oe/recipes-devtools/lua/lua-5.2_5.2.3.bb b/meta-oe/recipes-devtools/lua/lua-5.2_5.2.3.bb new file mode 100644 index 000000000..58f716337 --- /dev/null +++ b/meta-oe/recipes-devtools/lua/lua-5.2_5.2.3.bb @@ -0,0 +1,67 @@ +SUMMARY = "Lua is a powerful light-weight programming language designed \ +for extending applications." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=381;endline=399;md5=07ddfddb01fa4ed9f2fb5e8eeae817a4" +HOMEPAGE = "http://www.lua.org/" + +SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \ + file://lua.pc.in \ + ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest file://run-ptest ', '', d)} \ + file://Makefile-build-so.patch \ + " + +# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release. +PV_testsuites = "5.2.2" + +SRC_URI[tarballsrc.sha256sum] = "13c2fb97961381f7d06d5b5cea55b743c163800896fd5c5e2356201d3619002d" +SRC_URI[tarballtest.sha256sum] = "07c1071c66d9cb4dc80200ed430fc21ebbbccf1f55148b87eb0b9522932e4eb6" + +S = "${WORKDIR}/lua-${PV}" + +DEPENDS = "readline" +inherit pkgconfig binconfig ptest + +TARGET_CC_ARCH += " -fPIC ${LDFLAGS}" +EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}'" + +do_configure:prepend() { + sed -i -e s:/usr/local:${prefix}:g src/luaconf.h + sed -i -e s:lib/lua/:${baselib}/lua/:g src/luaconf.h +} + +do_compile () { + oe_runmake linux +} + +do_install () { + oe_runmake \ + 'INSTALL_TOP=${D}${prefix}' \ + 'INSTALL_BIN=${D}${bindir}' \ + 'INSTALL_INC=${D}${includedir}/' \ + 'INSTALL_MAN=${D}${mandir}/man1' \ + 'INSTALL_SHARE=${D}${datadir}' \ + 'INSTALL_LIB=${D}${libdir}' \ + 'INSTALL_CMOD=${D}${libdir}' \ + install + install -d ${D}${libdir}/pkgconfig ${D}${datadir}/doc/lua + + sed -e s/@VERSION@/${PV}/ -e s#@LIBDIR@#${libdir}# -e s#@INCLUDEDIR@#${includedir}# ${WORKDIR}/lua.pc.in > ${WORKDIR}/lua.pc + install -m 0644 ${WORKDIR}/lua.pc ${D}${libdir}/pkgconfig/ + install -m 0644 doc/*.{gif,png,css,html} ${D}${datadir}/doc/lua + rm -rf ${D}${datadir}/lua +} + +do_install_ptest () { + cp -R --no-dereference --preserve=mode,links -v ${WORKDIR}/lua-${PV_testsuites}-tests ${D}${PTEST_PATH}/test +} + +do_install_ptest:append:libc-musl () { + # locale tests does not work on musl, due to limited locale implementation + # https://wiki.musl-libc.org/open-issues.html#Locale-limitations + sed -i -e 's|os.setlocale("pt_BR") or os.setlocale("ptb")|false|g' ${D}${PTEST_PATH}/test/literals.lua +} + +BBCLASSEXTEND = "native nativesdk" + +inherit multilib_script +MULTILIB_SCRIPTS = "${PN}-dev:${includedir}/luaconf.h" From patchwork Mon Jan 22 19:31:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 38152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0807C47DD3 for ; Mon, 22 Jan 2024 19:31:52 +0000 (UTC) Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) by mx.groups.io with SMTP id smtpd.web10.1703.1705951909201186286 for ; Mon, 22 Jan 2024 11:31:49 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: t-online.de, ip: 194.25.134.21, mailfrom: f_l_k@t-online.de) Received: from fwd75.aul.t-online.de (fwd75.aul.t-online.de [10.223.144.101]) by mailout10.t-online.de (Postfix) with SMTP id 906141EA7A for ; Mon, 22 Jan 2024 20:31:17 +0100 (CET) Received: from intel-corei7-64.fritz.box ([84.163.35.62]) by fwd75.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1rS00q-0XEiVm0; Mon, 22 Jan 2024 20:31:16 +0100 From: Markus Volk To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][PATCH 2/3] mpv: make buildable with lua-5.2 Date: Mon, 22 Jan 2024 20:31:08 +0100 Message-ID: <20240122193109.3041355-2-f_l_k@t-online.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122193109.3041355-1-f_l_k@t-online.de> References: <20240122193109.3041355-1-f_l_k@t-online.de> MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1705951876-0CA7E850-DFC7519B/0/0 CLEAN NORMAL X-TOI-MSGID: 3e59a659-d9c5-49d8-abdb-6f146ba1fa8e List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 22 Jan 2024 19:31:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/108375 mpv only supports lua-5.2, so it seems to primarily support luajit. luajit is amazing and its performance compared to lua is outstanding but since it uses specific asm code, there are some platforms that are unsupported. Add luajit for the buildable platforms and fallback to lua-5.2 to unblock gui build for platforms that can't use luajit. Add PACKAGECONFIG for luajit Add LUA_DISABLE_FLAG to avoid having lua constantly disabled Signed-off-by: Markus Volk --- .../recipes-multimedia/mplayer/mpv_0.35.1.bb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/meta-oe/recipes-multimedia/mplayer/mpv_0.35.1.bb b/meta-oe/recipes-multimedia/mplayer/mpv_0.35.1.bb index 0f50a6e8f..7ba6279aa 100644 --- a/meta-oe/recipes-multimedia/mplayer/mpv_0.35.1.bb +++ b/meta-oe/recipes-multimedia/mplayer/mpv_0.35.1.bb @@ -26,29 +26,29 @@ inherit waf pkgconfig mime-xdg LDFLAGS:append:riscv64 = " -latomic" -LUA ?= "lua" -LUA:mips64 = "" -LUA:powerpc64 = "" -LUA:powerpc64le = "" -LUA:riscv64 = "" -LUA:riscv32 = "" -LUA:powerpc = "" +LUA ?= "luajit" +LUA:powerpc64 = "lua" +LUA:powerpc64le = "lua" +LUA:riscv64 = "lua" +LUA:riscv32 = "lua" # Note: lua is required to get on-screen-display (controls) PACKAGECONFIG ??= " \ ${LUA} \ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'opengl x11', d)} \ " +LUA_DISABLE_FLAG = "${@bb.utils.contains_any('LUA', 'lua luajit', '', '--disable-lua', d)}" + PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 xsp libxv libxscrnsaver libxinerama libxpresent libxext" PACKAGECONFIG[xv] = "--enable-xv,--disable-xv,libxv" PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl" PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl" PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm" PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgbm" -PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit" +PACKAGECONFIG[lua] = "--enable-lua,${LUA_DISABLE_FLAG},lua-5.2" +PACKAGECONFIG[luajit] = "--enable-lua,${LUA_DISABLE_FLAG},luajit" PACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive" PACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack" PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" From patchwork Mon Jan 22 19:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 38151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F15AFC47DD9 for ; Mon, 22 Jan 2024 19:31:52 +0000 (UTC) Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) by mx.groups.io with SMTP id smtpd.web10.1701.1705951909025195275 for ; Mon, 22 Jan 2024 11:31:49 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: t-online.de, ip: 194.25.134.21, mailfrom: f_l_k@t-online.de) Received: from fwd75.aul.t-online.de (fwd75.aul.t-online.de [10.223.144.101]) by mailout10.t-online.de (Postfix) with SMTP id 922B01EA7B for ; Mon, 22 Jan 2024 20:31:17 +0100 (CET) Received: from intel-corei7-64.fritz.box ([84.163.35.62]) by fwd75.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1rS00q-0XEiVn0; Mon, 22 Jan 2024 20:31:16 +0100 From: Markus Volk To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][PATCH 3/3] luajit: allow to build on supported platforms Date: Mon, 22 Jan 2024 20:31:09 +0100 Message-ID: <20240122193109.3041355-3-f_l_k@t-online.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122193109.3041355-1-f_l_k@t-online.de> References: <20240122193109.3041355-1-f_l_k@t-online.de> MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1705951876-0CA7E850-DABA84EF/0/0 CLEAN NORMAL X-TOI-MSGID: e6e95c9b-533c-4544-a855-93951ce97cda List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 22 Jan 2024 19:31:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/108373 According to documentation mips,mips64 and powerpc are supported platforms. Adjust accordingly This was tested to work for mips64, where luajit compiled without issue. Signed-off-by: Markus Volk --- meta-oe/recipes-devtools/luajit/luajit_git.bb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/meta-oe/recipes-devtools/luajit/luajit_git.bb b/meta-oe/recipes-devtools/luajit/luajit_git.bb index cadc9843d..240271d41 100644 --- a/meta-oe/recipes-devtools/luajit/luajit_git.bb +++ b/meta-oe/recipes-devtools/luajit/luajit_git.bb @@ -91,10 +91,7 @@ FILES:${PN}-dev += "${libdir}/libluajit-5.1.a \ " FILES:luajit-common = "${datadir}/${BPN}-${PV}" -# mips64/ppc/ppc64/riscv64/riscv32 is not supported in this release -COMPATIBLE_HOST:mipsarchn32 = "null" -COMPATIBLE_HOST:mipsarchn64 = "null" -COMPATIBLE_HOST:powerpc = "null" +# ppc64/riscv64/riscv32 is not supported in this release COMPATIBLE_HOST:powerpc64 = "null" COMPATIBLE_HOST:powerpc64le = "null" COMPATIBLE_HOST:riscv64 = "null"