diff --git a/emulators/tic-80/Makefile b/emulators/tic-80/Makefile index b84bd35e3c34..9bf65216ab11 100644 --- a/emulators/tic-80/Makefile +++ b/emulators/tic-80/Makefile @@ -1,71 +1,78 @@ PORTNAME= TIC-80 DISTVERSIONPREFIX= v -DISTVERSION= 1.0.2164 -PORTREVISION= 3 +DISTVERSION= 1.1.2736 CATEGORIES= emulators games MAINTAINER= fuz@FreeBSD.org COMMENT= Fantasy game console WWW= https://tic80.com LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE +# only available as a static library +# bump TIC-80 when quickjs is updated! +BUILD_DEPENDS= quickjs>0:lang/quickjs LIB_DEPENDS= libasound.so:audio/alsa-lib \ + libcurl.so:ftp/curl \ libdbus-1.so:devel/dbus \ - libduktape.so:lang/duktape-lib \ libgif.so:graphics/giflib \ - libhttp_parser.so:www/http-parser \ libinotify.so:devel/libinotify \ + libjanet.so:lang/janet \ libpng16.so:graphics/png \ libsquirrel.so:lang/squirrel \ - libunwind.so:devel/libunwind \ - libuv.so:devel/libuv + libunwind.so:devel/libunwind # 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 GH_TUPLE= nesbox:blip-buf:330226d9b55ecbeea644e17b5e0f096a165ca07e:blip_buf/vendor/blip-buf \ tronkko:dirent:c885633e126a3a949ec0497273ec13e2c03e862c:dirent/vendor/dirent \ wren-lang:wren:4a18fc489f9ea3d253b20dd40f4cdad0d6bb40eb:wren/vendor/wren \ kuba--:zip:d7df626f3aa457e01669f65e61bf8f484e352941:zip/vendor/zip \ nesbox:moonscript:17179283012b392bff972ad66231d73bfeec6e90:moonscript/vendor/moonscript \ cofyc:argparse:0d5f5d0745df14a3f373f7eed85bf524714f4524:argparse/vendor/argparse \ - wasm3:wasm3:a3abb3f2d320994be59dfbe2cdafa8d0b6a8253e:wasm3/vendor/wasm3 + wasm3:wasm3:a3abb3f2d320994be59dfbe2cdafa8d0b6a8253e:wasm3/vendor/wasm3 \ + blueloveTH:pocketpy:v1.0.0:pocketpy/vendor/pocketpy \ + erkkah:naett:v0.3.1:naett/vendor/naett \ + notnullnotvoid:msf_gif:v2.2:msfgif/vendor/msf_gif USE_GL= gl glu glut USE_SDL= sdl2 +CFLAGS+= -I${LOCALBASE}/include/quickjs -pthread +LDFLAGS+= -L${LOCALBASE}/lib/quickjs +LDLIBS+= -lpthread + # unbundled succesfully # albertodemichelis:squirrel:9dcf74f99097898dd5a111c4a55b89d1c4d606c0:squirrel/vendor/squirrel -# svaarala:duktape-releases:28f915a5381ca3a7dfa22130d08fbc5a16ae5d2f:duktape/vendor/duktape # lua:lua:75ea9ccbea7c4886f30da147fb67b693b2624c26:lua/vendor/lua # madler:zlib:cacf7f1d4e3d44d871b605da3b647f07d718623f:zlib/vendor/zlib # nesbox:giflib:1aa11b06d0025eda77b56aec8254130654d4397b:giflib/vendor/giflib # libuv:libuv:9c3d692b3941a2a4171629fb52af2e1029c415e8:libuv/vendor/libuv # nodejs:http-parser:ec8b5ee63f0e51191ea43bb0c6eac7bfbff3141d:http_parser/vendor/http-parser # 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 +# janet-lang:janet:v1.29.1:janet/vendor/janet # not actually needed -# smuehlst:circle-stdlib:fdb3c4a948421d47fddab8042a92f980cba43915:circle_stdlib/vendor/circle-stdlib # floooh:sokol:487822d82ca79dba7b67718d962e1ba6beef01b2:sokol/vendor/sokol # mruby:mruby:0f45836b5954accf508f333f932741b925214471:mruby/vendor/mruby # the demo carts are built, but don't seem to end up being installed # mruby: to be decided later; not essential CMAKE_OFF= BUILD_DEMO_CARTS BUILD_WITH_MRUBY BUILD_LIBRETRO OPTIONS_DEFINE= PRO SDLGPU OPTIONS_DEFAULT= SDLGPU PRO_DESC= Build PRO Version SDLGPU_DESC= Support sdl-gpu through graphics/sdl2_gpu PRO_CMAKE_BOOL= BUILD_PRO SDLGPU_LIB_DEPENDS= libSDL2_gpu.so:graphics/sdl2_gpu SDLGPU_CMAKE_BOOL= BUILD_SDLGPU .include diff --git a/emulators/tic-80/distinfo b/emulators/tic-80/distinfo index 201a37eb4d7a..661624e53013 100644 --- a/emulators/tic-80/distinfo +++ b/emulators/tic-80/distinfo @@ -1,19 +1,23 @@ -TIMESTAMP = 1683662963 -SHA256 (nesbox-TIC-80-v1.0.2164_GH0.tar.gz) = 26d0bbb45f190179f37169a7c2a32382844bafaf9b927d63c951bdf2f68f3414 -SIZE (nesbox-TIC-80-v1.0.2164_GH0.tar.gz) = 829743 +TIMESTAMP = 1694199131 +SHA256 (nesbox-TIC-80-v1.1.2736_GH0.tar.gz) = cb9d1670471cad2920684eb8f479395232ea8fc78a1374559fd4b26c4821c999 +SIZE (nesbox-TIC-80-v1.1.2736_GH0.tar.gz) = 1810045 SHA256 (nesbox-blip-buf-330226d9b55ecbeea644e17b5e0f096a165ca07e_GH0.tar.gz) = e86870ecb4b7c3feac6afbf5ddd0aff809e14b2d16d9bde251b712fd4ecd6d99 SIZE (nesbox-blip-buf-330226d9b55ecbeea644e17b5e0f096a165ca07e_GH0.tar.gz) = 51181 SHA256 (tronkko-dirent-c885633e126a3a949ec0497273ec13e2c03e862c_GH0.tar.gz) = aab1f1d02c3148a3d49a18b8de878603263e62e4a48622121efec92e5b40710b 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 (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 SIZE (kuba---zip-d7df626f3aa457e01669f65e61bf8f484e352941_GH0.tar.gz) = 114635 SHA256 (nesbox-moonscript-17179283012b392bff972ad66231d73bfeec6e90_GH0.tar.gz) = 10f0ebf82ae92a1389d353b349bef25deea594aebb3a65d09f36cd1193d7de18 SIZE (nesbox-moonscript-17179283012b392bff972ad66231d73bfeec6e90_GH0.tar.gz) = 192909 SHA256 (cofyc-argparse-0d5f5d0745df14a3f373f7eed85bf524714f4524_GH0.tar.gz) = b14cfe4b95a4cd1cf148eeecf0dba94ebf5b4312de12f5f5254e7040017477f1 SIZE (cofyc-argparse-0d5f5d0745df14a3f373f7eed85bf524714f4524_GH0.tar.gz) = 10152 SHA256 (wasm3-wasm3-a3abb3f2d320994be59dfbe2cdafa8d0b6a8253e_GH0.tar.gz) = 6a6d988a60f37caa24b997a6510229c4e89fce07aa666413da6ed9814ac0463f SIZE (wasm3-wasm3-a3abb3f2d320994be59dfbe2cdafa8d0b6a8253e_GH0.tar.gz) = 2575346 +SHA256 (blueloveTH-pocketpy-v1.0.0_GH0.tar.gz) = 01b0d299b31f94056b66b1e140aad2ef9b75a14a7105bacd14283ea61b27e161 +SIZE (blueloveTH-pocketpy-v1.0.0_GH0.tar.gz) = 793267 +SHA256 (erkkah-naett-v0.3.1_GH0.tar.gz) = 572ceeb0a6cb86e809bb2c7e971b2a4d257b69f981507c4deaf65aadf22ff15b +SIZE (erkkah-naett-v0.3.1_GH0.tar.gz) = 87948 +SHA256 (notnullnotvoid-msf_gif-v2.2_GH0.tar.gz) = 96863cb0bf798af745e29cd258f1d004cdfcc47ef9991c04b4005e30b89f5ed4 +SIZE (notnullnotvoid-msf_gif-v2.2_GH0.tar.gz) = 362849165 diff --git a/emulators/tic-80/files/patch-CMakeLists.txt b/emulators/tic-80/files/patch-CMakeLists.txt index fb44b0a7c887..671ee2bc5d0f 100644 --- a/emulators/tic-80/files/patch-CMakeLists.txt +++ b/emulators/tic-80/files/patch-CMakeLists.txt @@ -1,502 +1,532 @@ ---- CMakeLists.txt.orig 2022-05-02 07:31:14 UTC +--- CMakeLists.txt.orig 2023-08-27 09:42:28 UTC +++ CMakeLists.txt @@ -14,7 +14,6 @@ if(CMAKE_BUILD_TYPE) string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE_UC) endif() -find_package(Git) if(Git_FOUND) execute_process( COMMAND ${GIT_EXECUTABLE} status -@@ -155,72 +154,18 @@ set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/vendor) +@@ -160,72 +159,18 @@ set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/vendor) include(ExternalProject) +find_package(PkgConfig) ################################ # LUA ################################ -set(LUA_DIR ${THIRDPARTY_DIR}/lua) -set(LUA_SRC - ${LUA_DIR}/lapi.c - ${LUA_DIR}/lcode.c - ${LUA_DIR}/lctype.c - ${LUA_DIR}/ldebug.c - ${LUA_DIR}/ldo.c - ${LUA_DIR}/ldump.c - ${LUA_DIR}/lfunc.c - ${LUA_DIR}/lgc.c - ${LUA_DIR}/llex.c - ${LUA_DIR}/lmem.c - ${LUA_DIR}/lobject.c - ${LUA_DIR}/lopcodes.c - ${LUA_DIR}/lparser.c - ${LUA_DIR}/lstate.c - ${LUA_DIR}/lstring.c - ${LUA_DIR}/ltable.c - ${LUA_DIR}/ltm.c - ${LUA_DIR}/lundump.c - ${LUA_DIR}/lvm.c - ${LUA_DIR}/lzio.c - ${LUA_DIR}/lauxlib.c - ${LUA_DIR}/lbaselib.c - ${LUA_DIR}/lcorolib.c - ${LUA_DIR}/ldblib.c - ${LUA_DIR}/liolib.c - ${LUA_DIR}/lmathlib.c - ${LUA_DIR}/loslib.c - ${LUA_DIR}/lstrlib.c - ${LUA_DIR}/ltablib.c - ${LUA_DIR}/lutf8lib.c - ${LUA_DIR}/loadlib.c - ${LUA_DIR}/linit.c -) +pkg_check_modules(LUA REQUIRED lua-5.3 IMPORTED_TARGET GLOBAL) -add_library(lua STATIC ${LUA_SRC}) - -target_compile_definitions(lua PRIVATE LUA_COMPAT_5_2) -target_include_directories(lua INTERFACE ${THIRDPARTY_DIR}/lua) - if(N3DS) target_compile_definitions(lua PUBLIC LUA_32BITS) endif() ################################ -# 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 +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) +@@ -362,41 +307,6 @@ if (BAREMETALPI) + endif() -- ################################ -# SQUIRREL -################################ - -set(SQUIRREL_DIR ${THIRDPARTY_DIR}/squirrel) -set(SQUIRREL_SRC - ${SQUIRREL_DIR}/squirrel/sqapi.cpp - ${SQUIRREL_DIR}/squirrel/sqbaselib.cpp - ${SQUIRREL_DIR}/squirrel/sqclass.cpp - ${SQUIRREL_DIR}/squirrel/sqcompiler.cpp - ${SQUIRREL_DIR}/squirrel/sqdebug.cpp - ${SQUIRREL_DIR}/squirrel/sqfuncstate.cpp - ${SQUIRREL_DIR}/squirrel/sqlexer.cpp - ${SQUIRREL_DIR}/squirrel/sqmem.cpp - ${SQUIRREL_DIR}/squirrel/sqobject.cpp - ${SQUIRREL_DIR}/squirrel/sqstate.cpp - ${SQUIRREL_DIR}/squirrel/sqtable.cpp - ${SQUIRREL_DIR}/squirrel/sqvm.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdaux.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdblob.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdio.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdmath.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdrex.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdstream.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdstring.cpp - ${SQUIRREL_DIR}/sqstdlib/sqstdsystem.cpp +- -) - -add_library(squirrel STATIC ${SQUIRREL_SRC}) -set_target_properties(squirrel PROPERTIES LINKER_LANGUAGE CXX) -target_include_directories(squirrel PUBLIC ${SQUIRREL_DIR}/include) -target_include_directories(squirrel PRIVATE ${SQUIRREL_DIR}/squirrel) -target_include_directories(squirrel PRIVATE ${SQUIRREL_DIR}/sqstdlib) - -################################ - # GIFLIB + # PocketPy (Python) ################################ +@@ -432,27 +342,8 @@ else() + target_compile_features(python PRIVATE cxx_std_17) + endif() + +-################################ +-# GIFLIB +-################################ ++find_package(GIF REQUIRED) + -set(GIFLIB_DIR ${THIRDPARTY_DIR}/giflib) -set(GIFLIB_SRC - ${GIFLIB_DIR}/dgif_lib.c - ${GIFLIB_DIR}/egif_lib.c - ${GIFLIB_DIR}/gif_err.c - ${GIFLIB_DIR}/gif_font.c - ${GIFLIB_DIR}/gif_hash.c - ${GIFLIB_DIR}/gifalloc.c - ${GIFLIB_DIR}/openbsd-reallocarray.c -) -add_library(giflib STATIC ${GIFLIB_SRC}) -target_include_directories(giflib - PRIVATE ${GIFLIB_DIR} -- INTERFACE ${THIRDPARTY_DIR}/giflib) -+find_package(GIF REQUIRED) - +- INTERFACE +- ${THIRDPARTY_DIR}/giflib +- ${THIRDPARTY_DIR}/msf_gif) +- ################################ # Blipbuf -@@ -397,13 +294,6 @@ add_library(blipbuf STATIC ${THIRDPARTY_DIR}/blip-buf/ + ################################ +@@ -461,36 +352,6 @@ add_library(blipbuf STATIC ${THIRDPARTY_DIR}/blip-buf/ target_include_directories(blipbuf INTERFACE ${THIRDPARTY_DIR}/blip-buf) ################################ --# Duktape +-# QuickJS -################################ - --add_library(duktape STATIC ${THIRDPARTY_DIR}/duktape/src/duktape.c) --target_include_directories(duktape INTERFACE ${THIRDPARTY_DIR}/duktape/src) +-set(QUICKJS_DIR ${THIRDPARTY_DIR}/quickjs) +- +-file(STRINGS ${QUICKJS_DIR}/VERSION CONFIG_VERSION) +- +-add_library(quickjs STATIC +- ${QUICKJS_DIR}/quickjs.c +- ${QUICKJS_DIR}/libregexp.c +- ${QUICKJS_DIR}/libunicode.c +- ${QUICKJS_DIR}/cutils.c) +- +-target_compile_definitions(quickjs PUBLIC CONFIG_VERSION="${CONFIG_VERSION}") +-target_include_directories(quickjs INTERFACE ${QUICKJS_DIR}) +- +-if(CMAKE_BUILD_TYPE STREQUAL "Debug") +- target_compile_definitions(quickjs PRIVATE DUMP_LEAKS) +-endif() +- +-if(BAREMETALPI OR N3DS) +- target_compile_definitions(quickjs PRIVATE POOR_CLIB) +-endif() +- +-if(LINUX) +- target_compile_definitions(quickjs PUBLIC _GNU_SOURCE _POSIX_C_SOURCE=200112) +- target_link_libraries(quickjs PUBLIC m dl pthread) +-endif() - -################################ - # TIC-80 core + # Janet ################################ -@@ -440,19 +330,20 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) +@@ -529,9 +390,7 @@ if(BUILD_WITH_JANET) + ) + endif() + +- add_library(janet ${THIRDPARTY_DIR}/janet/build/c/janet.c) +- target_include_directories(janet PUBLIC ${THIRDPARTY_DIR}/janet/src/include) +- target_include_directories(janet PUBLIC ${CMAKE_SOURCE_DIR}/build/janet/) ++ pkg_check_modules(JANET REQUIRED janet) + endif() + + ################################ +@@ -578,24 +437,26 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) + + target_include_directories(tic80core${SCRIPT} PRIVATE ++ ${THIRDPARTY_DIR}/msf_gif ${THIRDPARTY_DIR}/moonscript ${THIRDPARTY_DIR}/fennel + ${POCKETPY_DIR}/src + ${LUA_INCLUDE_DIRS} PUBLIC ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) target_link_libraries(tic80core${SCRIPT} -- lua -- lpeg -+ ${LUA_LIBRARIES} - wren - wasm -+ sqstdlib - squirrel - duktape - blipbuf +- lua +- lpeg ++ ${LUA_LIBRARIES} + wren + wasm + squirrel ++ sqstdlib + python + scheme + quickjs + blipbuf - zlib + z ) if(BUILD_WITH_MRUBY) -@@ -461,7 +352,7 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) +@@ -608,7 +469,7 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED) if(${BUILD_DEPRECATED}) target_compile_definitions(tic80core${SCRIPT} PRIVATE BUILD_DEPRECATED) - target_link_libraries(tic80core${SCRIPT} giflib) + target_link_libraries(tic80core${SCRIPT} ${GIF_LIBRARIES}) endif() if(LINUX) -@@ -498,6 +389,8 @@ endif() +@@ -656,6 +517,8 @@ endif() ################################ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI) + find_package(SDL2 REQUIRED) + if(WIN32) set(HAVE_LIBC TRUE) endif() -@@ -507,10 +400,6 @@ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI) +@@ -665,10 +528,6 @@ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI) set(SDL_STATIC_PIC ON CACHE BOOL "" FORCE) endif() - set(SDL_SHARED OFF CACHE BOOL "" FORCE) - - add_subdirectory(${THIRDPARTY_DIR}/sdl2) - endif() ################################ -@@ -531,7 +420,7 @@ if(BUILD_SDL AND BUILD_PLAYER AND NOT RPI) +@@ -694,7 +553,7 @@ if(BUILD_SDL AND BUILD_PLAYER AND NOT RPI) target_link_options(player-sdl PRIVATE -static) endif() - target_link_libraries(player-sdl tic80core SDL2-static SDL2main) + target_link_libraries(player-sdl tic80core ${SDL2_LIBRARIES}) endif() ################################ -@@ -657,34 +546,8 @@ endif() +@@ -835,34 +694,8 @@ endif() # ZLIB ################################ -if (NOT N3DS) +find_package(ZLIB) -set(ZLIB_DIR ${THIRDPARTY_DIR}/zlib) -set(ZLIB_SRC - ${ZLIB_DIR}/adler32.c - ${ZLIB_DIR}/compress.c - ${ZLIB_DIR}/crc32.c - ${ZLIB_DIR}/deflate.c - ${ZLIB_DIR}/inflate.c - ${ZLIB_DIR}/infback.c - ${ZLIB_DIR}/inftrees.c - ${ZLIB_DIR}/inffast.c - ${ZLIB_DIR}/trees.c - ${ZLIB_DIR}/uncompr.c - ${ZLIB_DIR}/zutil.c -) - -add_library(zlib STATIC ${ZLIB_SRC}) -target_include_directories(zlib INTERFACE ${THIRDPARTY_DIR}/zlib) - -else () - -add_library(zlib STATIC IMPORTED) -set_target_properties( zlib PROPERTIES IMPORTED_LOCATION ${DEVKITPRO}/portlibs/3ds/lib/libz.a ) -target_include_directories(zlib INTERFACE ${DEVKITPRO}/portlibs/3ds/include) - -endif () - ################################ # ZIP ################################ -@@ -693,6 +556,12 @@ set(CMAKE_DISABLE_TESTING ON CACHE BOOL "" FORCE) +@@ -871,6 +704,12 @@ set(CMAKE_DISABLE_TESTING ON CACHE BOOL "" FORCE) add_subdirectory(${THIRDPARTY_DIR}/zip) ################################ +# PNG +################################ + +find_package(PNG REQUIRED) + +################################ # bin2txt cart2prj prj2cart xplode wasmp2cart ################################ -@@ -713,7 +582,7 @@ if(BUILD_DEMO_CARTS) +@@ -891,7 +730,7 @@ if(BUILD_DEMO_CARTS) target_link_libraries(wasmp2cart tic80core) add_executable(bin2txt ${TOOLS_DIR}/bin2txt.c) - target_link_libraries(bin2txt zlib) + target_link_libraries(bin2txt z) add_executable(xplode ${TOOLS_DIR}/xplode.c -@@ -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) -- target_link_libraries(xplode tic80core png giflib) -+ target_link_libraries(xplode tic80core PNG::PNG ${GIF_LIBRARIES}) - - if(LINUX) - target_link_libraries(xplode m) -@@ -803,54 +672,9 @@ target_include_directories(argparse INTERFACE ${THIRDP - # libuv - ################################ +@@ -997,7 +836,7 @@ if(USE_NAETT) --if(USE_LIBUV) -- add_subdirectory(${THIRDPARTY_DIR}/libuv) --endif() -+pkg_check_modules(LIBUV REQUIRED libuv) + if(WIN32) + target_link_libraries(naett INTERFACE winhttp) +- elseif(LINUX) ++ elseif(LINUX OR FREEBSD) + find_package(CURL REQUIRED) + target_include_directories(naett PRIVATE ${CURL_INCLUDE_DIRS}) + target_link_libraries(naett ${CURL_LIBRARIES}) +@@ -1005,40 +844,6 @@ if(USE_NAETT) + endif() ################################ --# HTTP parser --################################ -- --if(USE_LIBUV) -- add_library(http_parser STATIC ${THIRDPARTY_DIR}/http-parser/http_parser.c) -- target_include_directories(http_parser INTERFACE ${THIRDPARTY_DIR}/http-parser) --endif() -- --################################ -# PNG -################################ - -set(LIBPNG_DIR ${THIRDPARTY_DIR}/libpng) -set(LIBPNG_SRC - ${LIBPNG_DIR}/png.c - ${LIBPNG_DIR}/pngerror.c - ${LIBPNG_DIR}/pngget.c - ${LIBPNG_DIR}/pngmem.c - ${LIBPNG_DIR}/pngpread.c - ${LIBPNG_DIR}/pngread.c - ${LIBPNG_DIR}/pngrio.c - ${LIBPNG_DIR}/pngrtran.c - ${LIBPNG_DIR}/pngrutil.c - ${LIBPNG_DIR}/pngset.c - ${LIBPNG_DIR}/pngtrans.c - ${LIBPNG_DIR}/pngwio.c - ${LIBPNG_DIR}/pngwrite.c - ${LIBPNG_DIR}/pngwtran.c - ${LIBPNG_DIR}/pngwutil.c -) - -configure_file(${LIBPNG_DIR}/scripts/pnglibconf.h.prebuilt ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h) - -add_library(png STATIC ${LIBPNG_SRC}) - -target_compile_definitions(png PRIVATE PNG_ARM_NEON_OPT=0) - -target_include_directories(png - PUBLIC ${CMAKE_CURRENT_BINARY_DIR} - PRIVATE ${THIRDPARTY_DIR}/zlib - INTERFACE ${THIRDPARTY_DIR}/libpng) - -################################ # TIC-80 studio ################################ -@@ -894,13 +718,13 @@ if(WIN32) +@@ -1082,9 +887,9 @@ if(WIN32) target_include_directories(tic80studio PRIVATE ${THIRDPARTY_DIR}/dirent/include) endif() -target_include_directories(tic80studio PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -+target_include_directories(tic80studio PUBLIC ${CMAKE_CURRENT_BINARY_DIR} PRIVATE ${LUA_INCLUDE_DIRS}) ++target_include_directories(tic80studio PUBLIC ${CMAKE_CURRENT_BINARY_DIR} PRIVATE ${LUA_INCLUDE_DIRS} ${THIRDPARTY_DIR}/msf_gif) -target_link_libraries(tic80studio tic80core zip wave_writer argparse giflib png) -+target_link_libraries(tic80studio tic80core zip wave_writer argparse ${GIF_LIBRARIES} PNG::PNG) - - if(USE_LIBUV) - target_compile_definitions(tic80studio PRIVATE USE_LIBUV) -- target_link_libraries(tic80studio uv_a http_parser) -+ target_link_libraries(tic80studio ${LIBUV_LIBRARIES} http_parser) - endif() ++target_link_libraries(tic80studio tic80core zip wave_writer argparse ${GIF_LIBRARIES} png) - if(BUILD_PRO) -@@ -914,80 +738,6 @@ endif() + if(USE_NAETT) + target_compile_definitions(tic80studio PRIVATE USE_NAETT) +@@ -1102,80 +907,6 @@ endif() target_compile_definitions(tic80studio PUBLIC BUILD_EDITORS) ################################ -# SDL GPU -################################ - -if(BUILD_SDLGPU) - -set(SDLGPU_DIR ${THIRDPARTY_DIR}/sdl-gpu/src) -set(SDLGPU_SRC - ${SDLGPU_DIR}/renderer_GLES_2.c - ${SDLGPU_DIR}/SDL_gpu.c - ${SDLGPU_DIR}/SDL_gpu_matrix.c - ${SDLGPU_DIR}/SDL_gpu_renderer.c - ${SDLGPU_DIR}/externals/stb_image/stb_image.c - ${SDLGPU_DIR}/externals/stb_image_write/stb_image_write.c -) - -if(NOT ANDROID) - list(APPEND SDLGPU_SRC - ${SDLGPU_DIR}/renderer_GLES_1.c - ${SDLGPU_DIR}/renderer_GLES_3.c - ${SDLGPU_DIR}/renderer_OpenGL_1.c - ${SDLGPU_DIR}/renderer_OpenGL_1_BASE.c - ${SDLGPU_DIR}/renderer_OpenGL_2.c - ${SDLGPU_DIR}/renderer_OpenGL_3.c - ${SDLGPU_DIR}/renderer_OpenGL_4.c - ${SDLGPU_DIR}/SDL_gpu_shapes.c - ${SDLGPU_DIR}/externals/glew/glew.c - ) -endif() - -add_library(sdlgpu STATIC ${SDLGPU_SRC}) - -if(EMSCRIPTEN OR ANDROID) - target_compile_definitions(sdlgpu PRIVATE GLEW_STATIC SDL_GPU_DISABLE_GLES_1 SDL_GPU_DISABLE_GLES_3 SDL_GPU_DISABLE_OPENGL) -else() - target_compile_definitions(sdlgpu PRIVATE GLEW_STATIC SDL_GPU_DISABLE_GLES SDL_GPU_DISABLE_OPENGL_3 SDL_GPU_DISABLE_OPENGL_4) -endif() - -target_include_directories(sdlgpu PUBLIC ${THIRDPARTY_DIR}/sdl-gpu/include) -target_include_directories(sdlgpu PRIVATE ${THIRDPARTY_DIR}/sdl-gpu/src/externals/glew) -target_include_directories(sdlgpu PRIVATE ${THIRDPARTY_DIR}/sdl-gpu/src/externals/glew/GL) -target_include_directories(sdlgpu PRIVATE ${THIRDPARTY_DIR}/sdl-gpu/src/externals/stb_image) -target_include_directories(sdlgpu PRIVATE ${THIRDPARTY_DIR}/sdl-gpu/src/externals/stb_image_write) - -if(WIN32) - target_link_libraries(sdlgpu opengl32) -endif() - -if(LINUX) - target_link_libraries(sdlgpu GL) -endif() - -if(APPLE) - find_library(OPENGL_LIBRARY OpenGL) - target_link_libraries(sdlgpu ${OPENGL_LIBRARY}) -endif() - -if(ANDROID) - find_library( ANDROID_LOG_LIBRARY log ) - find_library( ANDROID_GLES2_LIBRARY GLESv2 ) - find_library( ANDROID_GLES1_LIBRARY GLESv1_CM ) - target_link_libraries(sdlgpu - ${ANDROID_LOG_LIBRARY} - ${ANDROID_GLES2_LIBRARY} - ${ANDROID_GLES1_LIBRARY} - ) -endif() - -if(NOT EMSCRIPTEN) - target_link_libraries(sdlgpu SDL2-static) -endif() - -endif() - -################################ # TIC-80 app ################################ -@@ -1028,7 +778,7 @@ if(BUILD_SDL) +@@ -1216,7 +947,7 @@ if(BUILD_SDL) endif() elseif(NOT ANDROID) - target_link_libraries(tic80 SDL2main) + target_link_libraries(tic80 ${SDL2_LIBRARIES}) endif() target_link_libraries(tic80 tic80studio) -@@ -1044,13 +794,13 @@ if(BUILD_SDL) +@@ -1237,13 +968,13 @@ if(BUILD_SDL) endif() if(BUILD_SDLGPU) - target_link_libraries(tic80 sdlgpu) + target_link_libraries(tic80 SDL2_gpu) else() if(EMSCRIPTEN) elseif(RPI) target_link_libraries(tic80 libSDL2.a bcm_host) else() - target_link_libraries(tic80 SDL2-static) + target_link_libraries(tic80 ${SDL2_LIBRARIES}) endif() endif() -@@ -1121,7 +871,7 @@ if(N3DS) +@@ -1314,7 +1045,7 @@ if(N3DS) ${CMAKE_SOURCE_DIR}/src) target_link_directories(tic80_n3ds PRIVATE ${DEVKITPRO}/libctru/lib ${DEVKITPRO}/portlibs/3ds/lib) - target_link_libraries(tic80_n3ds tic80studio png citro3d) + target_link_libraries(tic80_n3ds tic80studio PNG::PNG citro3d) add_custom_command(TARGET tic80_n3ds POST_BUILD -@@ -1181,7 +931,7 @@ if(BUILD_STUB) +@@ -1374,7 +1105,7 @@ if(BUILD_STUB) endif() else() - target_link_libraries(tic80${SCRIPT} SDL2main) + target_link_libraries(tic80${SCRIPT} ${SDL2_LIBRARIES}) endif() target_link_libraries(tic80${SCRIPT} tic80core${SCRIPT} argparse) -@@ -1193,13 +943,13 @@ if(BUILD_STUB) +@@ -1386,13 +1117,13 @@ if(BUILD_STUB) endif() if(BUILD_SDLGPU) - target_link_libraries(tic80${SCRIPT} sdlgpu) + target_link_libraries(tic80${SCRIPT} SDL2_gpu) else() if(EMSCRIPTEN) elseif(RPI) target_link_libraries(tic80${SCRIPT} libSDL2.a bcm_host pthread dl) else() - target_link_libraries(tic80${SCRIPT} SDL2-static) + target_link_libraries(tic80${SCRIPT} ${SDL2_LIBRARIES}) endif() endif() diff --git a/emulators/tic-80/files/patch-vendor_naett_naett.c b/emulators/tic-80/files/patch-vendor_naett_naett.c new file mode 100644 index 000000000000..47b37ffe4b40 --- /dev/null +++ b/emulators/tic-80/files/patch-vendor_naett_naett.c @@ -0,0 +1,20 @@ +--- vendor/naett/naett.c.orig 2023-09-08 19:55:43 UTC ++++ vendor/naett/naett.c +@@ -22,7 +22,7 @@ + #define __WINDOWS__ 1 + #endif + +-#if __linux__ && !__ANDROID__ ++#if __linux__ && !__ANDROID__ || __FreeBSD__ + #define __LINUX__ 1 + #include + #endif +@@ -782,7 +782,7 @@ void naettPlatformCloseResponse(InternalResponse* res) + // Inlined naett_linux.c: // + //#include "naett_internal.h" + +-#if __linux__ && !__ANDROID__ ++#if __linux__ && !__ANDROID__ || __FreeBSD__ + + #include + #include