diff --git a/emulators/Makefile b/emulators/Makefile index cd47e3d38bea..66c05dcf80c5 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -1,211 +1,212 @@ COMMENT = Emulators for other operating systems SUBDIR += 86Box SUBDIR += Ymir SUBDIR += adamem SUBDIR += almostti SUBDIR += amiberry SUBDIR += anese SUBDIR += aqemu SUBDIR += aranym SUBDIR += ares SUBDIR += atari800 SUBDIR += bfe SUBDIR += bochs SUBDIR += bsvc SUBDIR += cannonball SUBDIR += catapult SUBDIR += cemu SUBDIR += cingb SUBDIR += cpmtools SUBDIR += cpmtools2 SUBDIR += darcnes SUBDIR += dgen-sdl SUBDIR += dolphin-emu SUBDIR += dosbox SUBDIR += dosbox-staging SUBDIR += dosbox-x SUBDIR += dps8m SUBDIR += dynamips-community SUBDIR += edumips64 + SUBDIR += einstein-newton SUBDIR += elliott-803 SUBDIR += emu64 SUBDIR += emulationstation SUBDIR += emutos SUBDIR += es-de SUBDIR += fbneo SUBDIR += fbsd-duckstation SUBDIR += fceux SUBDIR += firebird SUBDIR += flexemu SUBDIR += flycast SUBDIR += fmsx SUBDIR += frodo SUBDIR += fs-uae SUBDIR += fs-uae-launcher SUBDIR += fuse SUBDIR += fuse-roms SUBDIR += fuse-utils SUBDIR += gbe SUBDIR += gens SUBDIR += gngb SUBDIR += gxemul SUBDIR += hatari SUBDIR += hercules SUBDIR += higan SUBDIR += hv_kvp_cmd SUBDIR += javatari SUBDIR += joytran SUBDIR += jzintv SUBDIR += klh10 SUBDIR += lib765 SUBDIR += libc6-shim SUBDIR += libdsk SUBDIR += libretro-bsnes SUBDIR += libretro-flycast SUBDIR += libretro-kronos SUBDIR += libretro-pcsx2 SUBDIR += libretro-ppsspp SUBDIR += libretro-reicast SUBDIR += libretro-vice SUBDIR += libspectrum SUBDIR += linux-c7 SUBDIR += linux-power10-functional-sim SUBDIR += linux-power9-functional-sim SUBDIR += linux-rl9 SUBDIR += linux_base-c7 SUBDIR += linux_base-rl9 SUBDIR += magia SUBDIR += mame SUBDIR += mastergear SUBDIR += mednafen SUBDIR += mesen SUBDIR += mgba SUBDIR += mupen64plus SUBDIR += mupen64plus-audio-sdl SUBDIR += mupen64plus-core SUBDIR += mupen64plus-input-sdl SUBDIR += mupen64plus-plugins SUBDIR += mupen64plus-qt SUBDIR += mupen64plus-rsp-cxd4 SUBDIR += mupen64plus-rsp-hle SUBDIR += mupen64plus-rsp-z64 SUBDIR += mupen64plus-ui-console SUBDIR += mupen64plus-video-arachnoid SUBDIR += mupen64plus-video-glide64 SUBDIR += mupen64plus-video-glide64mk2 SUBDIR += mupen64plus-video-rice SUBDIR += mupen64plus-video-z64 SUBDIR += nemu SUBDIR += nestopia SUBDIR += o2em SUBDIR += ods2reader SUBDIR += open-simh SUBDIR += open-vm-kmod SUBDIR += open-vm-tools SUBDIR += openmsx SUBDIR += p5-Acme-6502 SUBDIR += parallels-tools SUBDIR += pcem SUBDIR += pcemu SUBDIR += pcsx2 SUBDIR += playonbsd SUBDIR += ppsspp SUBDIR += py-gns3-converter SUBDIR += py-m64py SUBDIR += py-unicorn SUBDIR += qemu SUBDIR += qemu-cheri SUBDIR += qemu-devel SUBDIR += qemu-powernv SUBDIR += qemu-user-static SUBDIR += qemu-user-static-devel SUBDIR += qmc2 SUBDIR += quasi88 SUBDIR += reicast SUBDIR += ripes SUBDIR += riscv-isa-sim SUBDIR += rpcs3 SUBDIR += rubygem-fission SUBDIR += rvvm SUBDIR += rvvm-devel SUBDIR += sameboy SUBDIR += simh SUBDIR += simh-hp2100 SUBDIR += simh-hp3000 SUBDIR += simh-hpdoc SUBDIR += snes9x-gtk SUBDIR += spim SUBDIR += stella SUBDIR += stonx SUBDIR += teo SUBDIR += tic-80 SUBDIR += tiemu3 SUBDIR += tilem SUBDIR += tme SUBDIR += tnylpo SUBDIR += tpm-emulator SUBDIR += uae SUBDIR += ucon64 SUBDIR += uconvert SUBDIR += ukncbtl SUBDIR += unicorn SUBDIR += vba SUBDIR += vboxtool SUBDIR += vgb-bin SUBDIR += vgba-bin SUBDIR += vice SUBDIR += virtualbox-ose SUBDIR += virtualbox-ose-70 SUBDIR += virtualbox-ose-71 SUBDIR += virtualbox-ose-72 SUBDIR += virtualbox-ose-additions SUBDIR += virtualbox-ose-additions-70 SUBDIR += virtualbox-ose-additions-71 SUBDIR += virtualbox-ose-additions-72 SUBDIR += virtualbox-ose-additions-legacy SUBDIR += virtualbox-ose-additions-nox11 SUBDIR += virtualbox-ose-additions-nox11-70 SUBDIR += virtualbox-ose-additions-nox11-71 SUBDIR += virtualbox-ose-additions-nox11-72 SUBDIR += virtualbox-ose-additions-nox11-legacy SUBDIR += virtualbox-ose-kmod SUBDIR += virtualbox-ose-kmod-70 SUBDIR += virtualbox-ose-kmod-71 SUBDIR += virtualbox-ose-kmod-72 SUBDIR += virtualbox-ose-kmod-legacy SUBDIR += virtualbox-ose-legacy SUBDIR += virtualbox-ose-nox11 SUBDIR += virtualbox-ose-nox11-70 SUBDIR += virtualbox-ose-nox11-71 SUBDIR += virtualbox-ose-nox11-72 SUBDIR += virtualbox-ose-nox11-legacy SUBDIR += visualboyadvance-m SUBDIR += vmips SUBDIR += vmsbackup SUBDIR += vmw SUBDIR += vt100 SUBDIR += wine SUBDIR += wine-devel SUBDIR += wine-gecko SUBDIR += wine-gecko-devel SUBDIR += wine-mono SUBDIR += wine-mono-devel SUBDIR += wine-proton SUBDIR += winetricks SUBDIR += x16-emulator SUBDIR += x16-rom SUBDIR += x48 SUBDIR += x49gp SUBDIR += xbraitenberg SUBDIR += xcpc SUBDIR += xen-kernel SUBDIR += xhomer SUBDIR += xsystem35 SUBDIR += xzx SUBDIR += yaze-ag SUBDIR += yuzu SUBDIR += z80pack SUBDIR += zsnes .include diff --git a/emulators/einstein-newton/Makefile b/emulators/einstein-newton/Makefile new file mode 100644 index 000000000000..5018f8b00029 --- /dev/null +++ b/emulators/einstein-newton/Makefile @@ -0,0 +1,75 @@ +PORTNAME= einstein-newton +DISTVERSIONPREFIX= v +DISTVERSION= 2025.12.19 +CATEGORIES= emulators + +MAINTAINER= laurent@FreeBSD.org +COMMENT= Apple Newton Emulator +WWW= https://github.com/pguyot/Einstein + +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto +LIB_DEPENDS= libffi.so:devel/libffi \ + libfontconfig.so:x11-fonts/fontconfig \ + libpulse.so:audio/pulseaudio +TEST_DEPENDS= googletest>=0:devel/googletest + +USES= bison cmake:testing compiler:c++17-lang llvm:build xorg + +USE_GITHUB= yes +GH_ACCOUNT= pguyot +GH_PROJECT= Einstein +GH_TUPLE= fltk:fltk:release-1.4.4:fltk/fltk-src \ + MatthiasWM:NEWT64:d1a1aa1:newt64/newt64-src +USE_XORG= ice sm x11 xcursor xext xfixes xinerama xft xrender + +CMAKE_ARGS= -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen:BOOL=TRUE \ + -DCMAKE_DISABLE_FIND_PACKAGE_LATEX:BOOL=TRUE \ + -DCMAKE_DISABLE_FIND_PACKAGE_SDL3:BOOL=TRUE \ + -DFLTK_BACKEND_WAYLAND:BOOL=OFF \ + -DFLTK_GRAPHICS_CAIRO:BOOL=OFF \ + -DFLTK_OPTION_CAIRO_EXT:BOOL=OFF \ + -DFLTK_OPTION_CAIRO_WINDOW:BOOL=OFF \ + -DFLTK_USE_DBUS:BOOL=OFF \ + -DFLTK_USE_LIBDECOR_GTK:BOOL=OFF \ + -DFLTK_USE_PANGO:BOOL=OFF \ + -DFLTK_USE_SYSTEM_LIBJPEG:BOOL=TRUE \ + -DFLTK_USE_SYSTEM_LIBDECOR:BOOL=OFF \ + -DFLTK_USE_SYSTEM_LIBPNG:BOOL=TRUE \ + -DFLTK_USE_SYSTEM_ZLIB:BOOL=TRUE +CMAKE_OFF= BUILD_TESTING EINSTEIN_FETCH_GTEST + +ALL_TARGET= Einstein + +BINARY_ALIAS= clang-format=clang-format${LLVM_DEFAULT} + +EXTRACT_AFTER_ARGS= --exclude ${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT}/libffi* \ + --exclude ${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT}/portaudio + +PLIST_FILES= bin/Einstein + +PORTDOCS= * +OPTIONS_DEFINE= DOCS + +post-extract: + ${MKDIR} ${BUILD_WRKSRC}/_deps + ${RLN} ${WRKSRC_fltk} ${BUILD_WRKSRC}/_deps/fltk-src + ${RLN} ${WRKSRC_newt64} ${BUILD_WRKSRC}/_deps/newt64-src + +do-install: + @${MKDIR} ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/Einstein ${STAGEDIR}${PREFIX}/bin/Einstein + +post-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + (cd ${WRKSRC}/Documentation && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) + +do-test: + @cd ${BUILD_WRKSRC} && \ + ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DBUILD_TESTING=ON ${CMAKE_SOURCE_PATH} && \ + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} EinsteinTests && \ + ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${MAKE_CMD} ${MAKE_ARGS} test + +.include diff --git a/emulators/einstein-newton/distinfo b/emulators/einstein-newton/distinfo new file mode 100644 index 000000000000..e0374206dbfd --- /dev/null +++ b/emulators/einstein-newton/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1771678463 +SHA256 (pguyot-Einstein-v2025.12.19_GH0.tar.gz) = e2bd3d6eb4d5a0c6bf600c5546845335abef2002fec8e2ec8081a2f40c9b3383 +SIZE (pguyot-Einstein-v2025.12.19_GH0.tar.gz) = 9409929 +SHA256 (fltk-fltk-release-1.4.4_GH0.tar.gz) = cbf5f7846af596206e8e4489e14c9981f98d7b37168110a00dcd26d8d479a669 +SIZE (fltk-fltk-release-1.4.4_GH0.tar.gz) = 9114031 +SHA256 (MatthiasWM-NEWT64-d1a1aa1_GH0.tar.gz) = e69de1706d42c8e9f25c8df14380daa725d2a2f40a2c53631e24738b2640603d +SIZE (MatthiasWM-NEWT64-d1a1aa1_GH0.tar.gz) = 506404 diff --git a/emulators/einstein-newton/files/patch-CMakeLists.txt b/emulators/einstein-newton/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..3dc9a142fdf4 --- /dev/null +++ b/emulators/einstein-newton/files/patch-CMakeLists.txt @@ -0,0 +1,369 @@ +--- CMakeLists.txt.orig 2025-12-19 16:57:53 UTC ++++ CMakeLists.txt +@@ -56,6 +56,10 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) + + # Linux: nothing to do here + ++elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD" ) ++ ++ # FreeBSD and NetBSD: nothing to do here ++ + elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) + + set_property ( GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1 ) +@@ -159,23 +163,37 @@ endif () + # ---- Setup Google Testing + # + ++include( CTest ) ++ + # For Windows: Prevent overriding the parent project's compiler/linker settings + set( gtest_force_shared_crt ON CACHE BOOL "" FORCE ) + +-# Check if population has already been performed +-FetchContent_GetProperties(googletest) +-if ( NOT googletest_POPULATED ) +- # Fetch the content using previously declared details +- FetchContent_MakeAvailable(googletest) ++option( EINSTEIN_FETCH_GTEST "Download googletest if not found" ON ) + +- # Bring the populated content into the build +- #add_subdirectory( ${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} ) +-endif () ++set( EINSTEIN_USE_GTEST OFF ) ++if ( BUILD_TESTING ) ++ # Try to find GTest installed on the system first. ++ find_package( GTest CONFIG QUIET ) + +-enable_testing() ++ # Check if population has already been performed ++ if ( NOT GTest_FOUND AND EINSTEIN_FETCH_GTEST ) ++ FetchContent_GetProperties(googletest) ++ if ( NOT googletest_POPULATED ) ++ # Fetch the content using previously declared details ++ FetchContent_MakeAvailable(googletest) + +-include( GoogleTest ) ++ # Bring the populated content into the build ++ #add_subdirectory( ${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} ) ++ endif () ++ endif () + ++ if ( TARGET GTest::gtest_main OR TARGET gtest_main ) ++ set( EINSTEIN_USE_GTEST ON ) ++ else () ++ message( STATUS "GoogleTest not available; tests disabled." ) ++ endif () ++endif () ++ + # + # ---- Newt/64 library --------------------------------------------------------- + # +@@ -322,11 +340,13 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + ${app_sources} + ${cmake_sources} + ) +- add_executable ( EinsteinTests +- ${common_sources} +- ${test_sources} +- ${cmake_sources} +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ add_executable ( EinsteinTests ++ ${common_sources} ++ ${test_sources} ++ ${cmake_sources} ++ ) ++ endif () + if ( EINSTEIN_FLTK_FRONTEND ) + add_library ( EinsteinFLGUI STATIC + ${fluid_sources} +@@ -337,9 +357,11 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + target_compile_options( Einstein PUBLIC + -Wall -Wextra -Wpedantic -Wno-missing-field-initializers -Werror + ) +- target_compile_options( EinsteinTests PUBLIC +- -Wall -Wextra -Wpedantic -Wno-missing-field-initializers -Werror +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_options( EinsteinTests PUBLIC ++ -Wall -Wextra -Wpedantic -Wno-missing-field-initializers -Werror ++ ) ++ endif () + if ( EINSTEIN_FLTK_FRONTEND ) + target_compile_options( EinsteinFLGUI PUBLIC + -Wall -Wextra -Wpedantic -Wno-missing-field-initializers -Werror +@@ -357,10 +379,12 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + TARGET_OS_MAC=1 NS_BLOCK_ASSERTIONS=1 + ) + endif () +- target_compile_definitions ( EinsteinTests PRIVATE +- TARGET_UI_FLTK=1 NO_PORT_AUDIO NO_X11 TARGET_OS_OPENSTEP=1 +- TARGET_OS_MAC=1 NS_BLOCK_ASSERTIONS=1 +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_definitions ( EinsteinTests PRIVATE ++ TARGET_UI_FLTK=1 NO_PORT_AUDIO NO_X11 TARGET_OS_OPENSTEP=1 ++ TARGET_OS_MAC=1 NS_BLOCK_ASSERTIONS=1 ++ ) ++ endif () + if ( EINSTEIN_FLTK_FRONTEND ) + target_compile_definitions ( EinsteinFLGUI PRIVATE + TARGET_UI_FLTK=1 NO_PORT_AUDIO NO_X11 TARGET_OS_OPENSTEP=1 +@@ -390,7 +414,7 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + $ENV{ANDROID_NDK_HOME}/sysroot/usr/include + ) + endif () +- if ( EINSTEIN_FLTK_FRONTEND ) ++ if ( EINSTEIN_USE_GTEST AND EINSTEIN_FLTK_FRONTEND ) + target_link_libraries ( EinsteinTests + ${system_libs} + fltk::fltk +@@ -423,7 +447,7 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + ) + endif () + +-elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) ++elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$" ) + + # create the application + add_executable ( Einstein +@@ -431,11 +455,13 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM + ${app_sources} + ${cmake_sources} + ) +- add_executable ( EinsteinTests +- ${common_sources} +- ${test_sources} +- ${cmake_sources} +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ add_executable ( EinsteinTests ++ ${common_sources} ++ ${test_sources} ++ ${cmake_sources} ++ ) ++ endif () + add_library ( EinsteinFLGUI STATIC + ${fluid_sources} + ) +@@ -443,23 +469,34 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM + # how to compile and link + target_compile_options ( Einstein PUBLIC + -Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result +- -Wno-missing-field-initializers -Wno-stringop-truncation # -Werror ++ -Wno-missing-field-initializers # -Werror + # Werror is disabled for testing purposes. Must reenable as soon as all Linux warnings are fixed. + ) +- target_compile_options ( EinsteinTests PUBLIC +- -Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result +- -Wno-missing-field-initializers -Wno-stringop-truncation -Werror +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_options ( EinsteinTests PUBLIC ++ -Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result ++ -Wno-missing-field-initializers -Werror ++ ) ++ endif () + target_compile_options ( EinsteinFLGUI PUBLIC + -Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result +- -Wno-missing-field-initializers -Wno-stringop-truncation -Werror ++ -Wno-missing-field-initializers -Werror + ) ++ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++ target_compile_options(Einstein PUBLIC -Wno-stringop-truncation) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_options(EinsteinTests PUBLIC -Wno-stringop-truncation) ++ endif () ++ target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation) ++ endif() + target_compile_definitions ( Einstein PRIVATE + TARGET_UI_FLTK=1 TARGET_OS_LINUX=1 + ) +- target_compile_definitions ( EinsteinTests PRIVATE +- TARGET_UI_FLTK=1 TARGET_OS_LINUX=1 +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_definitions ( EinsteinTests PRIVATE ++ TARGET_UI_FLTK=1 TARGET_OS_LINUX=1 ++ ) ++ endif () + target_compile_definitions ( EinsteinFLGUI PRIVATE + TARGET_UI_FLTK=1 TARGET_OS_LINUX=1 + ) +@@ -469,18 +506,20 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM + EinsteinFLGUI + pthread + ) +- target_link_libraries ( EinsteinTests +- ${system_libs} +- fltk::fltk +- EinsteinFLGUI +- pthread +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_link_libraries ( EinsteinTests ++ ${system_libs} ++ fltk::fltk ++ EinsteinFLGUI ++ pthread ++ ) ++ endif () + target_link_libraries ( EinsteinFLGUI + fltk::fltk fltk::images fltk::png fltk::z + ) + +- if ( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) +- # Under OpenBSD, libffi is in ports (i.e. /usr/local) not base (i.e. /usr) ++ if ( ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$" ) ++ # Under BSD, libffi is in ports (i.e. /usr/local) not base (i.e. /usr) + find_library ( ffi_lib NAMES ffi ) + find_file ( ffi_incl NAMES ffi.h ) + if ( ffi_lib MATCHES ".*NOTFOUND" OR ffi_incl MATCHES ".*NOTFOUND" ) +@@ -493,7 +532,7 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM + target_link_libraries ( Einstein ${ffi_lib} ) + endif () + +- # Under OpenBSD, pulseaudio is in ports (i.e. /usr/local) not base (i.e. /usr) ++ # Under BSD, pulseaudio is in ports (i.e. /usr/local) not base (i.e. /usr) + find_library ( pulse_lib NAMES pulse ) + if ( pulse_lib MATCHES ".*NOTFOUND" ) + message ( FATAL_ERROR "libpulse not found! " ) +@@ -503,7 +542,7 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM + target_link_libraries ( Einstein ${pulse_lib} ) + endif () + +- # Under OpenBSD, X11 is in /usr/X11R6 ++ # Under BSD, find X11 + include ( FindX11 ) + if ( X11_FOUND ) + target_include_directories ( Einstein SYSTEM PUBLIC ${X11_INCLUDE_DIR} ) +@@ -527,30 +566,38 @@ elseif ( WIN32 ) + ${common_sources} ${app_sources} ${cmake_sources} ${data} + ${CMAKE_CURRENT_BINARY_DIR}/Einstein.rc + ) +- add_executable ( EinsteinTests +- ${common_sources} ${test_sources} +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ add_executable ( EinsteinTests ++ ${common_sources} ${test_sources} ++ ) ++ endif () + add_library ( EinsteinFLGUI STATIC + ${fluid_sources} + ) + + # how to compile and link + target_compile_options( Einstein PUBLIC "/bigobj" ) +- target_compile_options( EinsteinTests PUBLIC "/bigobj" ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_options( EinsteinTests PUBLIC "/bigobj" ) ++ endif () + target_compile_options( EinsteinFLGUI PUBLIC "/bigobj" ) + if ( $ ) + target_compile_options( Einstein PUBLIC "/ZI" ) +- target_compile_options( EinsteinTests PUBLIC "/ZI" ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_options( EinsteinTests PUBLIC "/ZI" ) ++ endif () + target_compile_options( EinsteinFLGUI PUBLIC "/ZI" ) + endif () + target_compile_definitions ( Einstein PRIVATE + TARGET_UI_FLTK=1 TARGET_OS_WIN32=1 + WIN32_LEAN_AND_MEAN=1 _CRT_SECURE_NO_WARNINGS=1 + ) +- target_compile_definitions ( EinsteinTests PRIVATE +- TARGET_UI_FLTK=1 TARGET_OS_WIN32=1 +- WIN32_LEAN_AND_MEAN=1 _CRT_SECURE_NO_WARNINGS=1 +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_compile_definitions ( EinsteinTests PRIVATE ++ TARGET_UI_FLTK=1 TARGET_OS_WIN32=1 ++ WIN32_LEAN_AND_MEAN=1 _CRT_SECURE_NO_WARNINGS=1 ++ ) ++ endif () + target_compile_definitions ( EinsteinFLGUI PRIVATE + TARGET_UI_FLTK=1 TARGET_OS_WIN32=1 + WIN32_LEAN_AND_MEAN=1 _CRT_SECURE_NO_WARNINGS=1 +@@ -562,17 +609,19 @@ elseif ( WIN32 ) + winmm + gdiplus + ) +- target_link_libraries ( EinsteinTests +- ${system_libs} +- fltk::fltk +- EinsteinFLGUI +- gdiplus +- ) +- target_link_libraries ( EinsteinTests +- ${system_libs} +- fltk::fltk +- gdiplus +- ) ++ if ( EINSTEIN_USE_GTEST ) ++ target_link_libraries ( EinsteinTests ++ ${system_libs} ++ fltk::fltk ++ EinsteinFLGUI ++ gdiplus ++ ) ++ target_link_libraries ( EinsteinTests ++ ${system_libs} ++ fltk::fltk ++ gdiplus ++ ) ++ endif () + target_link_libraries ( EinsteinFLGUI + fltk::fltk fltk::images fltk::png fltk::z + ) +@@ -634,11 +683,13 @@ target_include_directories ( + ${CMAKE_SOURCE_DIR} + ${FLTK_INCLUDE_DIRS} + ) +-target_include_directories ( +- EinsteinTests PUBLIC +- ${CMAKE_SOURCE_DIR} +- ${FLTK_INCLUDE_DIRS} +-) ++if ( EINSTEIN_USE_GTEST ) ++ target_include_directories ( ++ EinsteinTests PUBLIC ++ ${CMAKE_SOURCE_DIR} ++ ${FLTK_INCLUDE_DIRS} ++ ) ++endif () + if ( EINSTEIN_FLTK_FRONTEND ) + target_include_directories ( + EinsteinFLGUI PUBLIC +@@ -648,14 +699,27 @@ target_compile_definitions ( Einstein PUBLIC "$<$:_DEBUG>" USE_CMAKE ) +-target_compile_definitions ( EinsteinTests PUBLIC "$<$:_DEBUG>" USE_CMAKE ) ++if ( EINSTEIN_USE_GTEST ) ++ target_compile_definitions ( EinsteinTests PUBLIC "$<$:_DEBUG>" USE_CMAKE ) ++endif () + if ( EINSTEIN_FLTK_FRONTEND ) + target_compile_definitions ( EinsteinFLGUI PUBLIC "$<$:_DEBUG>" USE_CMAKE ) + endif () + +-target_link_libraries ( EinsteinTests gtest_main ) ++if ( EINSTEIN_USE_GTEST ) ++ include( GoogleTest ) ++ if ( TARGET GTest::gtest_main ) ++ target_link_libraries ( EinsteinTests GTest::gtest_main ) ++ elseif ( TARGET gtest_main ) ++ target_link_libraries ( EinsteinTests gtest_main ) ++ else () ++ message ( STATUS "GoogleTest found without a gtest_main target; tests disabled." ) ++ endif () ++endif () + +-gtest_discover_tests ( EinsteinTests ) ++if ( EINSTEIN_USE_GTEST AND ( TARGET GTest::gtest_main OR TARGET gtest_main ) ) ++ gtest_discover_tests ( EinsteinTests ) ++endif () + + endif () + diff --git a/emulators/einstein-newton/files/patch-Emulator_NativeCalls_CMakeLists.txt b/emulators/einstein-newton/files/patch-Emulator_NativeCalls_CMakeLists.txt new file mode 100644 index 000000000000..9b1bf6fcbe95 --- /dev/null +++ b/emulators/einstein-newton/files/patch-Emulator_NativeCalls_CMakeLists.txt @@ -0,0 +1,11 @@ +--- Emulator/NativeCalls/CMakeLists.txt.orig 2025-11-07 12:31:53 UTC ++++ Emulator/NativeCalls/CMakeLists.txt +@@ -18,7 +18,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + Emulator/NativeCalls/TObjCBridgeCalls.mm + Emulator/NativeCalls/TObjCBridgeCalls.h + ) +-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") ++elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$") + list (APPEND common_sources + Emulator/NativeCalls/NativeCallsDefines.h + Emulator/NativeCalls/TNativeCalls.cpp diff --git a/emulators/einstein-newton/files/patch-Emulator_Serial_CMakeLists.txt b/emulators/einstein-newton/files/patch-Emulator_Serial_CMakeLists.txt new file mode 100644 index 000000000000..32af641f9cbe --- /dev/null +++ b/emulators/einstein-newton/files/patch-Emulator_Serial_CMakeLists.txt @@ -0,0 +1,11 @@ +--- Emulator/Serial/CMakeLists.txt.orig 2025-11-07 12:23:08 UTC ++++ Emulator/Serial/CMakeLists.txt +@@ -31,7 +31,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + Emulator/Serial/TPtySerialPortManager.cpp + Emulator/Serial/TPtySerialPortManager.h + ) +-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") ++elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$") + list (APPEND common_sources + Emulator/Serial/TSerialHostPort.h + Emulator/Serial/TSerialHostPortDirect.h diff --git a/emulators/einstein-newton/files/patch-Emulator_Sound_CMakeLists.txt b/emulators/einstein-newton/files/patch-Emulator_Sound_CMakeLists.txt new file mode 100644 index 000000000000..2c6e65c3054f --- /dev/null +++ b/emulators/einstein-newton/files/patch-Emulator_Sound_CMakeLists.txt @@ -0,0 +1,11 @@ +--- Emulator/Sound/CMakeLists.txt.orig 2025-11-07 12:55:19 UTC ++++ Emulator/Sound/CMakeLists.txt +@@ -20,7 +20,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + Emulator/Sound/TCoreAudioSoundManager.cpp + Emulator/Sound/TCoreAudioSoundManager.h + ) +-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") ++elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$") + list (APPEND app_sources + Emulator/Sound/TPulseAudioSoundManager.cpp + Emulator/Sound/TPulseAudioSoundManager.h diff --git a/emulators/einstein-newton/files/patch-newt64-src_CMakeLists.txt b/emulators/einstein-newton/files/patch-newt64-src_CMakeLists.txt new file mode 100644 index 000000000000..044454ef4e1b --- /dev/null +++ b/emulators/einstein-newton/files/patch-newt64-src_CMakeLists.txt @@ -0,0 +1,81 @@ +--- newt64-src/CMakeLists.txt.orig 2024-12-27 00:20:35 UTC ++++ newt64-src/CMakeLists.txt +@@ -1,6 +1,6 @@ + # + # Use a single CMake setup to compile Newt/64 on all supported platforms. +-# ++# + + cmake_minimum_required(VERSION 3.13) + +@@ -9,6 +9,7 @@ set (CMAKE_CXX_STANDARD 14) + set (CMAKE_CXX_STANDARD 14) + + # prepare for various platforms ++set (IS_BSD FALSE) + if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + + # MacOS +@@ -21,9 +22,10 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + # Linux + set (NEWT64_INSTALL_PREFIX "") + +-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") ++elseif (${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$") + +- # OpenBSD ++ # FreeBSD, NetBSD and OpenBSD ++ set (IS_BSD TRUE) + set (NEWT64_INSTALL_PREFIX "") + + elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +@@ -118,7 +120,7 @@ set (headers + src/newt_core/incs/platform.h + $<$: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> + $<$: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> +- $<$: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> ++ $<$: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> + $<$: src/newt_core/incs/win/config.h src/newt_core/incs/win/NewtConf.h> + ) + +@@ -164,21 +166,21 @@ target_include_directories (libnewt64 PUBLIC + src/ + $<$: src/newt_core/incs/darwin > + $<$: src/newt_core/incs/darwin > +- $<$: src/newt_core/incs/darwin > ++ $<$: src/newt_core/incs/darwin > + $<$: src/newt_core/incs/win > + ) + +-target_link_libraries(libnewt64 PUBLIC ++target_link_libraries(libnewt64 PUBLIC + $<$: > + $<$: > +- $<$: > ++ $<$: > + $<$: shlwapi > + ) + + target_compile_definitions(libnewt64 PRIVATE + $<$: TARGET_OS_DARWIN=1 > + $<$: TARGET_OS_LINUX=1 HAVE_ENDIAN_H=1> +- $<$: TARGET_OS_LINUX=1 HAVE_ENDIAN_H=1> ++ $<$: TARGET_OS_LINUX=1 HAVE_ENDIAN_H=1> + $<$: TARGET_OS_WINDOWS=1 > + ) + +@@ -209,12 +211,12 @@ target_include_directories (newt64 PUBLIC + src/ + $<$: src/newt_core/incs/darwin > + $<$: src/newt_core/incs/darwin > +- $<$: src/newt_core/incs/darwin > ++ $<$: src/newt_core/incs/darwin > + $<$: src/newt_core/incs/win > + ) + + target_link_libraries(newt64 +- PUBLIC ++ PUBLIC + libnewt64 + $<$:dl> + ) diff --git a/emulators/einstein-newton/pkg-descr b/emulators/einstein-newton/pkg-descr new file mode 100644 index 000000000000..8e39b2a7d160 --- /dev/null +++ b/emulators/einstein-newton/pkg-descr @@ -0,0 +1,3 @@ +Einstein is a NewtonOS emulator. A Newton ROM file is required to run Einstein. +If you own a Newton device, you may be able to dump your own ROM file from it. +See the documentation for more information.