mruby-zest: upgrade to latest and fix build with python3

Yeah this was by far the most ugly hack and it got worse!

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2020-02-08 22:48:51 +01:00
parent bc41134bc3
commit ee50be3450
6 changed files with 66 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ SRC_URI += " \
file://0006-mruby-regexp-pcre-link-against-libpcre.patch \
file://0007-Load-schema-from-usr-share-zyn-fusion-schema.patch \
file://0008-Do-not-require-dummy-MainWindow.qml.patch \
file://0009-Avoid-glGenerateMipmap-for-GLES2-either.patch \
"
DEPENDS += " \
@@ -24,9 +25,9 @@ DEPENDS += " \
# autotools (don't forget git submodules) does not allow a cleaner approach.
# But we are lucky: there is only one autoconf target (yet). If that happens
# we need to try running autotoools multiple times in a dynamically
# linked forlder. Let's hope that will not be necessary...
# linked folder. Let's hope that will not be necessary...
AUTOTOOLS_SCRIPT_PATH = "${S}/mruby/build/mrbgems/mruby-file-stat"
AUTOTOOLS_SCRIPT_PATH = "${S}/deps/mruby-file-stat"
do_configure_prepend() {
# taken from https://github.com/zynaddsubfx/zyn-fusion-build/blob/master/build-rpi3.rb
@@ -40,7 +41,11 @@ do_configure_prepend() {
MRUBY_CONFIG=../build_config.rb ruby minirake --pull-gems || true
# ensure config.h is created at the right place...
cd build/mrbgems/mruby-file-stat/src
cd build/host/mrbgems/mruby-file-stat/src
}
do_configure_append() {
cp -f ${S}/mruby/build/host/mrbgems/mruby-file-stat/src/config.h ${S}/deps/mruby-file-stat/src/
}
do_install() {
@@ -54,7 +59,6 @@ do_install() {
install -d ${D}/opt/zyn-fusion
cp -r ${B}/package/{libzest.so,font} ${D}/opt/zyn-fusion/
}
FILES_${PN} += " \

View File

@@ -8,14 +8,30 @@ SRC_URI = " \
file://0002-mruby-zest-Align-build-to-our-needs.patch \
file://0003-src-osc-bridge-Align-build-to-our-needs.patch \
"
SRCREV = "014e96473bd08768b2e8a05f39ddb406563084b4"
PV = "3.0.5"
SRCREV = "3f8b82e4c56786ef6f4589640fcfed1fe8c9373a"
PV = "3.0.5+git${SRCPV}"
PE = "1"
S = "${WORKDIR}/git"
inherit python3native
DEPENDS += " \
ruby-native \
bison-native \
"
CLEANBROKEN = "1"
do_configure_prepend() {
# common
sed -i 's:/usr/bin/env python:/usr/bin/env python3:' `grep -rl '/usr/bin/env python$' ${S}`
sed -i 's:python2:python3:' `grep -rl 'python2' ${S}`
# pugl
# dummy call -> unpacks waf
${S}/deps/pugl/waf configure --prefix=${prefix} ${EXTRA_OECONF} || true
# hmmm
sed -i 's:^.*raise StopIteration::g' `find ${S}/deps/pugl/.waf3-* -name '*.py'`
# -> python3
2to3 -w -x import `find ${S}/deps/pugl/.waf3-* -name '*.py'`
}

View File

@@ -61,7 +61,7 @@ index f370c0ab..a2ab5ed4 100644
end
conf.linker do |linker|
- linker.command = ENV['LD'] || 'gcc'
- linker.command = ENV['LD'] || ENV['CXX'] || ENV['CC'] || 'gcc'
+ linker.command = ENV['CC']
linker.flags = [ENV['LDFLAGS'] || %w()]
linker.libraries = %w(m)

View File

@@ -10,14 +10,14 @@ Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
mruby/tasks/mruby_build_commands.rake | 2 +-
mruby/lib/mruby/build/command.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mruby/tasks/mruby_build_commands.rake b/mruby/tasks/mruby_build_commands.rake
index 694b4a24..a207ef76 100644
--- a/mruby/tasks/mruby_build_commands.rake
+++ b/mruby/tasks/mruby_build_commands.rake
@@ -286,7 +286,7 @@ module MRuby
diff --git a/mruby/lib/mruby/build/command.rb b/mruby/lib/mruby/build/command.rb
index d4354225e..e80a74c2b 100644
--- a/mruby/lib/mruby/build/command.rb
+++ b/mruby/lib/mruby/build/command.rb
@@ -313,7 +313,7 @@ module MRuby
end
def run(out, infiles, funcname)
@@ -27,5 +27,5 @@ index 694b4a24..a207ef76 100644
infiles.each do |f|
_pp "MRBC", f.relative_path, nil, :indent => 2
--
2.14.4
2.21.0

View File

@@ -18,7 +18,7 @@ index 6211152..c82cb86 100644
--- a/deps/mruby-regexp-pcre/mrbgem.rake
+++ b/deps/mruby-regexp-pcre/mrbgem.rake
@@ -3,7 +3,7 @@ MRuby::Gem::Specification.new('mruby-regexp-pcre') do |spec|
spec.authors = 'Internet Initiative Japan Inc.'
spec.add_dependency 'mruby-string-ext', :core => 'mruby-string-ext'
## For dynamic link
- #spec.linker.libraries << ['pcre']

View File

@@ -0,0 +1,31 @@
From 6bf18256d7ee9bd67266feac0836204af370afc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Mon, 3 Feb 2020 23:46:25 +0100
Subject: [PATCH] Avoid glGenerateMipmap for GLES2 either
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Pending
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
deps/nanovg/src/nanovg_gl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/deps/nanovg/src/nanovg_gl.h b/deps/nanovg/src/nanovg_gl.h
index 4ba87f3..66b5306 100644
--- a/deps/nanovg/src/nanovg_gl.h
+++ b/deps/nanovg/src/nanovg_gl.h
@@ -763,7 +763,7 @@ static int glnvg__renderCreateTexture(void* uptr, int type, int w, int h, int im
#endif
// The new way to build mipmaps on GLES and GL3
-#if !defined(NANOVG_GL2)
+#if !defined(NANOVG_GL2) && !defined(MRUBY_NANOVG_GLES2)
if (imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) {
glGenerateMipmap(GL_TEXTURE_2D);
}
--
2.21.0