From 4cde7f7013b0cc1eb1ddda5abb80483d3eedec42 Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Mon, 22 May 2023 12:40:48 +0200 Subject: emulators/tic-80: unbundle devel/lua-lpeg This one is needed for the moonscript dependency. Once moonscript is unbundled, the dependency can be removed entirely. --- emulators/tic-80/Makefile | 9 ++- emulators/tic-80/distinfo | 2 - emulators/tic-80/files/patch-CMakeLists.txt | 66 +++++++++++++--------- emulators/tic-80/files/patch-src_api_moonscript.c | 12 ++++ .../files/patch-vendor_moonscript_moonscript.c | 12 ++++ 5 files changed, 69 insertions(+), 32 deletions(-) create mode 100644 emulators/tic-80/files/patch-src_api_moonscript.c create mode 100644 emulators/tic-80/files/patch-vendor_moonscript_moonscript.c diff --git a/emulators/tic-80/Makefile b/emulators/tic-80/Makefile index 152ad29b2e60..1aa5ccf5583c 100644 --- a/emulators/tic-80/Makefile +++ b/emulators/tic-80/Makefile @@ -1,7 +1,7 @@ PORTNAME= TIC-80 DISTVERSIONPREFIX= v DISTVERSION= 1.0.2164 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= emulators games MAINTAINER= fuz@FreeBSD.org @@ -22,6 +22,9 @@ LIB_DEPENDS= libasound.so:audio/alsa-lib \ libunwind.so:devel/libunwind \ libuv.so:devel/libuv +# for moonscript +RUN_DEPENDS= ${LUA_REFMODLIBDIR}/lpeg.so:devel/lua-lpeg@${LUA_FLAVOR} + USES= cmake desktop-file-utils gl localbase:ldflags lua:53 pkgconfig sdl USE_GITHUB= yes GH_ACCOUNT= nesbox @@ -31,8 +34,7 @@ GH_TUPLE= nesbox:blip-buf:330226d9b55ecbeea644e17b5e0f096a165ca07e:blip_buf/vend kuba--:zip:d7df626f3aa457e01669f65e61bf8f484e352941:zip/vendor/zip \ nesbox:moonscript:17179283012b392bff972ad66231d73bfeec6e90:moonscript/vendor/moonscript \ cofyc:argparse:0d5f5d0745df14a3f373f7eed85bf524714f4524:argparse/vendor/argparse \ - wasm3:wasm3:a3abb3f2d320994be59dfbe2cdafa8d0b6a8253e:wasm3/vendor/wasm3 \ - nesbox:lpeg:73d8614a8dea404cf7bfe25a6e4cea7183dc9fb7:lpeg/vendor/lpeg + wasm3:wasm3:a3abb3f2d320994be59dfbe2cdafa8d0b6a8253e:wasm3/vendor/wasm3 USE_GL= gl glu glut USE_SDL= sdl2 @@ -47,6 +49,7 @@ USE_SDL= sdl2 # glennrp:libpng:dbe3e0c43e549a1602286144d94b0666549b18e6:libpng/vendor/libpng # libsdl-org:SDL:b424665e0899769b200231ba943353a5fee1b6b6:sdl2/vendor/sdl2 # grimfang4:sdl-gpu:e3d350b325a0e0d0b3007f69ede62313df46c6ef:sdl_gpu/vendor/sdl-gpu +# nesbox:lpeg:73d8614a8dea404cf7bfe25a6e4cea7183dc9fb7:lpeg/vendor/lpeg # not actually needed # smuehlst:circle-stdlib:fdb3c4a948421d47fddab8042a92f980cba43915:circle_stdlib/vendor/circle-stdlib diff --git a/emulators/tic-80/distinfo b/emulators/tic-80/distinfo index e098f685e1b6..201a37eb4d7a 100644 --- a/emulators/tic-80/distinfo +++ b/emulators/tic-80/distinfo @@ -7,8 +7,6 @@ SHA256 (tronkko-dirent-c885633e126a3a949ec0497273ec13e2c03e862c_GH0.tar.gz) = aa SIZE (tronkko-dirent-c885633e126a3a949ec0497273ec13e2c03e862c_GH0.tar.gz) = 21182 SHA256 (nesbox-giflib-1aa11b06d0025eda77b56aec8254130654d4397b_GH0.tar.gz) = 0061d8b362e1edce6d47c2cf6df218c3d7d4494bacae98d2f0552b8bb1ebc319 SIZE (nesbox-giflib-1aa11b06d0025eda77b56aec8254130654d4397b_GH0.tar.gz) = 411816 -SHA256 (nesbox-lpeg-73d8614a8dea404cf7bfe25a6e4cea7183dc9fb7_GH0.tar.gz) = 600d8644b51e5cb4d628627cd430d7beccf1d5af72a2844270983c85563de3a4 -SIZE (nesbox-lpeg-73d8614a8dea404cf7bfe25a6e4cea7183dc9fb7_GH0.tar.gz) = 71088 SHA256 (wren-lang-wren-4a18fc489f9ea3d253b20dd40f4cdad0d6bb40eb_GH0.tar.gz) = fb885f12767ea8b1101145b9d86735995e28c5298b712c1c3f71ed9bbf17f567 SIZE (wren-lang-wren-4a18fc489f9ea3d253b20dd40f4cdad0d6bb40eb_GH0.tar.gz) = 1810731 SHA256 (kuba---zip-d7df626f3aa457e01669f65e61bf8f484e352941_GH0.tar.gz) = f121ff9a6df3414afe958c341c0e3f05d638e43e3be735a9dad8d05ce9322c49 diff --git a/emulators/tic-80/files/patch-CMakeLists.txt b/emulators/tic-80/files/patch-CMakeLists.txt index 3ae76ab51d8e..fb44b0a7c887 100644 --- a/emulators/tic-80/files/patch-CMakeLists.txt +++ b/emulators/tic-80/files/patch-CMakeLists.txt @@ -8,7 +8,7 @@ if(Git_FOUND) execute_process( COMMAND ${GIT_EXECUTABLE} status -@@ -155,51 +154,13 @@ set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/vendor) +@@ -155,72 +154,18 @@ set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/vendor) include(ExternalProject) @@ -62,16 +62,28 @@ if(N3DS) target_compile_definitions(lua PUBLIC LUA_32BITS) endif() -@@ -218,7 +179,7 @@ set(LPEG_SRC - ) - - add_library(lpeg STATIC ${LPEG_SRC}) --target_include_directories(lpeg PRIVATE ${LUA_DIR}) -+target_include_directories(lpeg PRIVATE ${LUA_INCLUDE_DIRS}) ################################ +-# LPEG +-################################ +- +-set(LPEG_DIR ${THIRDPARTY_DIR}/lpeg) +-set(LPEG_SRC +- ${LPEG_DIR}/lpcap.c +- ${LPEG_DIR}/lpcode.c +- ${LPEG_DIR}/lpprint.c +- ${LPEG_DIR}/lptree.c +- ${LPEG_DIR}/lpvm.c +-) +- +-add_library(lpeg STATIC ${LPEG_SRC}) +-target_include_directories(lpeg PRIVATE ${LUA_DIR}) +- +-################################ # WREN -@@ -335,59 +296,11 @@ target_include_directories(wasm PUBLIC ${THIRDPARTY_DI + ################################ + +@@ -335,59 +280,11 @@ target_include_directories(wasm PUBLIC ${THIRDPARTY_DI #target_include_directories(wasm PRIVATE ${THIRDPARTY_DIR}/wasm3/src/optional) #target_include_directories(wasm PRIVATE ${THIRDPARTY_DIR}/wasm3/src/vm) @@ -132,7 +144,7 @@ ################################ # Blipbuf -@@ -397,13 +310,6 @@ add_library(blipbuf STATIC ${THIRDPARTY_DIR}/blip-buf/ +@@ -397,13 +294,6 @@ add_library(blipbuf STATIC ${THIRDPARTY_DIR}/blip-buf/ target_include_directories(blipbuf INTERFACE ${THIRDPARTY_DIR}/blip-buf) ################################ @@ -146,7 +158,7 @@ # TIC-80 core ################################ -@@ -440,19 +346,21 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) +@@ -440,19 +330,20 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) PRIVATE ${THIRDPARTY_DIR}/moonscript ${THIRDPARTY_DIR}/fennel @@ -157,7 +169,7 @@ target_link_libraries(tic80core${SCRIPT} - lua - lpeg +- lpeg + ${LUA_LIBRARIES} wren wasm @@ -170,7 +182,7 @@ ) if(BUILD_WITH_MRUBY) -@@ -461,7 +369,7 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) +@@ -461,7 +352,7 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) if(${BUILD_DEPRECATED}) target_compile_definitions(tic80core${SCRIPT} PRIVATE BUILD_DEPRECATED) @@ -179,7 +191,7 @@ endif() if(LINUX) -@@ -498,6 +406,8 @@ endif() +@@ -498,6 +389,8 @@ endif() ################################ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI) @@ -188,7 +200,7 @@ if(WIN32) set(HAVE_LIBC TRUE) endif() -@@ -507,10 +417,6 @@ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI) +@@ -507,10 +400,6 @@ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI) set(SDL_STATIC_PIC ON CACHE BOOL "" FORCE) endif() @@ -199,7 +211,7 @@ endif() ################################ -@@ -531,7 +437,7 @@ if(BUILD_SDL AND BUILD_PLAYER AND NOT RPI) +@@ -531,7 +420,7 @@ if(BUILD_SDL AND BUILD_PLAYER AND NOT RPI) target_link_options(player-sdl PRIVATE -static) endif() @@ -208,7 +220,7 @@ endif() ################################ -@@ -657,34 +563,8 @@ endif() +@@ -657,34 +546,8 @@ endif() # ZLIB ################################ @@ -244,7 +256,7 @@ ################################ # ZIP ################################ -@@ -693,6 +573,12 @@ set(CMAKE_DISABLE_TESTING ON CACHE BOOL "" FORCE) +@@ -693,6 +556,12 @@ set(CMAKE_DISABLE_TESTING ON CACHE BOOL "" FORCE) add_subdirectory(${THIRDPARTY_DIR}/zip) ################################ @@ -257,7 +269,7 @@ # bin2txt cart2prj prj2cart xplode wasmp2cart ################################ -@@ -713,7 +599,7 @@ if(BUILD_DEMO_CARTS) +@@ -713,7 +582,7 @@ if(BUILD_DEMO_CARTS) target_link_libraries(wasmp2cart tic80core) add_executable(bin2txt ${TOOLS_DIR}/bin2txt.c) @@ -266,7 +278,7 @@ add_executable(xplode ${TOOLS_DIR}/xplode.c -@@ -722,7 +608,7 @@ if(BUILD_DEMO_CARTS) +@@ -722,7 +591,7 @@ if(BUILD_DEMO_CARTS) ${CMAKE_SOURCE_DIR}/src/studio/project.c) target_include_directories(xplode PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/include) @@ -275,7 +287,7 @@ if(LINUX) target_link_libraries(xplode m) -@@ -803,54 +689,9 @@ target_include_directories(argparse INTERFACE ${THIRDP +@@ -803,54 +672,9 @@ target_include_directories(argparse INTERFACE ${THIRDP # libuv ################################ @@ -331,7 +343,7 @@ # TIC-80 studio ################################ -@@ -894,13 +735,13 @@ if(WIN32) +@@ -894,13 +718,13 @@ if(WIN32) target_include_directories(tic80studio PRIVATE ${THIRDPARTY_DIR}/dirent/include) endif() @@ -348,7 +360,7 @@ endif() if(BUILD_PRO) -@@ -914,80 +755,6 @@ endif() +@@ -914,80 +738,6 @@ endif() target_compile_definitions(tic80studio PUBLIC BUILD_EDITORS) ################################ @@ -429,7 +441,7 @@ # TIC-80 app ################################ -@@ -1028,7 +795,7 @@ if(BUILD_SDL) +@@ -1028,7 +778,7 @@ if(BUILD_SDL) endif() elseif(NOT ANDROID) @@ -438,7 +450,7 @@ endif() target_link_libraries(tic80 tic80studio) -@@ -1044,13 +811,13 @@ if(BUILD_SDL) +@@ -1044,13 +794,13 @@ if(BUILD_SDL) endif() if(BUILD_SDLGPU) @@ -454,7 +466,7 @@ endif() endif() -@@ -1121,7 +888,7 @@ if(N3DS) +@@ -1121,7 +871,7 @@ if(N3DS) ${CMAKE_SOURCE_DIR}/src) target_link_directories(tic80_n3ds PRIVATE ${DEVKITPRO}/libctru/lib ${DEVKITPRO}/portlibs/3ds/lib) @@ -463,7 +475,7 @@ add_custom_command(TARGET tic80_n3ds POST_BUILD -@@ -1181,7 +948,7 @@ if(BUILD_STUB) +@@ -1181,7 +931,7 @@ if(BUILD_STUB) endif() else() @@ -472,7 +484,7 @@ endif() target_link_libraries(tic80${SCRIPT} tic80core${SCRIPT} argparse) -@@ -1193,13 +960,13 @@ if(BUILD_STUB) +@@ -1193,13 +943,13 @@ if(BUILD_STUB) endif() if(BUILD_SDLGPU) diff --git a/emulators/tic-80/files/patch-src_api_moonscript.c b/emulators/tic-80/files/patch-src_api_moonscript.c new file mode 100644 index 000000000000..15f0f1abbb37 --- /dev/null +++ b/emulators/tic-80/files/patch-src_api_moonscript.c @@ -0,0 +1,12 @@ +--- src/api/moonscript.c.orig 2023-05-22 10:36:00 UTC ++++ src/api/moonscript.c +@@ -86,9 +86,6 @@ static bool initMoonscript(tic_mem* tic, const char* c + lua_State* lua = core->currentVM = luaL_newstate(); + lua_open_builtins(lua); + +- luaopen_lpeg(lua); +- setloaded(lua, "lpeg"); +- + initLuaAPI(core); + + { diff --git a/emulators/tic-80/files/patch-vendor_moonscript_moonscript.c b/emulators/tic-80/files/patch-vendor_moonscript_moonscript.c new file mode 100644 index 000000000000..cf646cfbcbbf --- /dev/null +++ b/emulators/tic-80/files/patch-vendor_moonscript_moonscript.c @@ -0,0 +1,12 @@ +--- vendor/moonscript/moonscript.c.orig 2020-10-28 13:03:23 UTC ++++ vendor/moonscript/moonscript.c +@@ -27,9 +27,6 @@ void setloaded(lua_State* l, char* name) { + extern int luaopen_lpeg(lua_State *l); + + LUALIB_API int luaopen_moonscript(lua_State *l) { +- luaopen_lpeg(l); +- setloaded(l, "lpeg"); +- + if (luaL_loadbuffer(l, (const char *)moonscript_lua, moonscript_lua_len, "moonscript.lua") == 0) { + lua_call(l, 0, 1); + return 1; -- cgit v1.2.3