Skip to content

Commit dde94af

Browse files
authored
Merge pull request #201 from Gemba/fb_lrvircon32_rpi4_buster_support_and_opengles
[lr-vircon32] Patch to allow Buster builds and OpenGLES usage
2 parents a80367f + 456ad40 commit dde94af

File tree

2 files changed

+67
-4
lines changed

2 files changed

+67
-4
lines changed

scriptmodules/libretrocores/lr-vircon32.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@ rp_module_help="ROM Extensions: .v32 .zip\n\nCopy your roms to $romdir/vircon32\
1515
rp_module_licence="3-Clause BSD https://raw.githubusercontent.com/vircon32/vircon32-libretro/main/LICENSE.md"
1616
rp_module_repo="git https://github.com/vircon32/vircon32-libretro.git main"
1717
rp_module_section="exp"
18-
rp_module_flags="!all 64bit"
18+
rp_module_flags="!all rpi3 rpi4 rpi5 x86"
1919

2020
function sources_lr-vircon32() {
2121
gitPullOrClone
22+
local cmake_ver
23+
cmake_ver=$(cmake --version | head -n 1 | cut -f 3 -d ' ')
24+
if dpkg --compare-versions "${cmake_ver}" lt 3.17 ; then
25+
# for OS with cmake less than 3.17 (missing: foreach(<loop_var>... IN ZIP_LISTS <lists>))
26+
applyPatch "$md_data/cmake_pre3.17.patch"
27+
fi
2228
}
2329

2430
function build_lr-vircon32() {
25-
cmake .
26-
make
31+
local defines=()
32+
isPlatform "gles" && defines+=("-DENABLE_OPENGLES2=1")
33+
cmake "${defines[@]}" .
34+
make -j$(nproc)
2735
md_ret_require="$md_build/vircon32_libretro.so"
2836
}
2937

@@ -42,4 +50,4 @@ function configure_lr-vircon32() {
4250
addSystem "vircon32" "Vircon32 game console" ".v32 .zip .V32 .ZIP"
4351

4452
[[ "$md_mode" == "remove" ]] && return
45-
}
53+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
diff --git a/embed-binaries/embed-binaries.cmake b/embed-binaries/embed-binaries.cmake
2+
index d46353e..1f54841 100644
3+
--- a/embed-binaries/embed-binaries.cmake
4+
+++ b/embed-binaries/embed-binaries.cmake
5+
@@ -1,7 +1,3 @@
6+
-cmake_minimum_required(VERSION
7+
- 3.17.5 # foreach(loop-var... IN ZIP_LISTS <lists>...)
8+
-)
9+
-
10+
include_guard()
11+
12+
function(generate_code_to_embed_binary asset_name asset_path byte_type constexpr null_terminate out_generated_header out_generated_implementation)
13+
@@ -145,12 +141,17 @@ function(embed_binaries target_name)
14+
list(APPEND asset_${param_name}s ${asset_${param_name}})
15+
endforeach()
16+
17+
- foreach(param_name default_value IN ZIP_LISTS asset_optional_args asset_optional_args_defaults)
18+
- if (NOT DEFINED asset_${param_name})
19+
- set(asset_${param_name} ${default_value})
20+
+ list(LENGTH asset_optional_args _alen)
21+
+ math(EXPR alen "${_alen} - 1")
22+
+
23+
+ foreach(i RANGE ${alen})
24+
+ list(GET asset_optional_args ${i} arg_key)
25+
+ list(GET asset_optional_args_defaults ${i} arg_dflt_val)
26+
+ if (NOT DEFINED asset_${arg_key})
27+
+ set(asset_${arg_key} ${arg_dflt_val})
28+
endif()
29+
30+
- list(APPEND asset_${param_name}s ${asset_${param_name}})
31+
+ list(APPEND asset_${arg_key}s ${asset_${arg_key}})
32+
endforeach()
33+
endwhile()
34+
35+
@@ -173,10 +174,16 @@ function(embed_binaries target_name)
36+
target_compile_features("${target_name}" INTERFACE cxx_constexpr)
37+
endif()
38+
39+
- foreach(
40+
- asset_NAME asset_PATH asset_CONSTEXPR asset_BYTE_TYPE asset_NULL_TERMINATE
41+
- IN ZIP_LISTS
42+
- asset_NAMEs asset_PATHs asset_CONSTEXPRs asset_BYTE_TYPEs asset_NULL_TERMINATEs)
43+
+ list(LENGTH asset_NAMEs _nlen)
44+
+ math(EXPR nlen "${_nlen} - 1")
45+
+
46+
+ foreach(i RANGE ${nlen})
47+
+ list(GET asset_NAMEs ${i} asset_NAME)
48+
+ list(GET asset_PATHs ${i} asset_PATH)
49+
+ list(GET asset_CONSTEXPRs ${i} asset_CONSTEXPR)
50+
+ list(GET asset_BYTE_TYPEs ${i} asset_BYTE_TYPE)
51+
+ list(GET asset_NULL_TERMINATEs ${i} asset_NULL_TERMINATE)
52+
+
53+
string(MAKE_C_IDENTIFIER "${asset_NAME}" asset_name_identifier)
54+
55+
get_filename_component(asset_PATH ${asset_PATH} ABSOLUTE)

0 commit comments

Comments
 (0)