Date: Wed, 15 Apr 2026 20:40:22 +0000 From: Laurent Chardon <laurent@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 0e53c9054836 - main - emulators/einstein-newton: Add new port Message-ID: <69dff7b6.1f9db.690996ab@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by laurent: URL: https://cgit.FreeBSD.org/ports/commit/?id=0e53c9054836194d1740ba0af1005b6881b17e80 commit 0e53c9054836194d1740ba0af1005b6881b17e80 Author: Laurent Chardon <laurent@FreeBSD.org> AuthorDate: 2026-04-03 14:42:10 +0000 Commit: Laurent Chardon <laurent@FreeBSD.org> CommitDate: 2026-04-15 20:40:01 +0000 emulators/einstein-newton: Add new port PR: 293507 Reviewed by: thierry (mentor), diizy Approved by: thierry (mentor) --- emulators/Makefile | 1 + emulators/einstein-newton/Makefile | 75 +++++ emulators/einstein-newton/distinfo | 7 + .../einstein-newton/files/patch-CMakeLists.txt | 369 +++++++++++++++++++++ .../patch-Emulator_NativeCalls_CMakeLists.txt | 11 + .../files/patch-Emulator_Serial_CMakeLists.txt | 11 + .../files/patch-Emulator_Sound_CMakeLists.txt | 11 + .../files/patch-newt64-src_CMakeLists.txt | 81 +++++ emulators/einstein-newton/pkg-descr | 3 + 9 files changed, 569 insertions(+) diff --git a/emulators/Makefile b/emulators/Makefile index cd47e3d38bea..66c05dcf80c5 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -28,6 +28,7 @@ SUBDIR += dps8m SUBDIR += dynamips-community SUBDIR += edumips64 + SUBDIR += einstein-newton SUBDIR += elliott-803 SUBDIR += emu64 SUBDIR += emulationstation 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 <bsd.port.mk> 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 ( $<CONFIG:Debug> ) + 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 "$<$<CONF + endif () + + target_compile_definitions ( Einstein PUBLIC "$<$<CONFIG:DEBUG>:_DEBUG>" USE_CMAKE ) +-target_compile_definitions ( EinsteinTests PUBLIC "$<$<CONFIG:DEBUG>:_DEBUG>" USE_CMAKE ) ++if ( EINSTEIN_USE_GTEST ) ++ target_compile_definitions ( EinsteinTests PUBLIC "$<$<CONFIG:DEBUG>:_DEBUG>" USE_CMAKE ) ++endif () + if ( EINSTEIN_FLTK_FRONTEND ) + target_compile_definitions ( EinsteinFLGUI PUBLIC "$<$<CONFIG:DEBUG>:_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 + $<$<PLATFORM_ID:Darwin>: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> + $<$<PLATFORM_ID:Linux>: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> +- $<$<PLATFORM_ID:OpenBSD>: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> ++ $<$<BOOL:${IS_BSD}>: src/newt_core/incs/darwin/config.h src/newt_core/incs/darwin/NewtConf.h> + $<$<PLATFORM_ID:Windows>: src/newt_core/incs/win/config.h src/newt_core/incs/win/NewtConf.h> + ) + +@@ -164,21 +166,21 @@ target_include_directories (libnewt64 PUBLIC + src/ + $<$<PLATFORM_ID:Darwin>: src/newt_core/incs/darwin > + $<$<PLATFORM_ID:Linux>: src/newt_core/incs/darwin > +- $<$<PLATFORM_ID:OpenBSD>: src/newt_core/incs/darwin > ++ $<$<BOOL:${IS_BSD}>: src/newt_core/incs/darwin > + $<$<PLATFORM_ID:Windows>: src/newt_core/incs/win > + ) + +-target_link_libraries(libnewt64 PUBLIC ++target_link_libraries(libnewt64 PUBLIC + $<$<PLATFORM_ID:Darwin>: > + $<$<PLATFORM_ID:Linux>: > +- $<$<PLATFORM_ID:OpenBSD>: > ++ $<$<BOOL:${IS_BSD}>: > + $<$<PLATFORM_ID:Windows>: shlwapi > + ) + + target_compile_definitions(libnewt64 PRIVATE + $<$<PLATFORM_ID:Darwin>: TARGET_OS_DARWIN=1 > + $<$<PLATFORM_ID:Linux>: TARGET_OS_LINUX=1 HAVE_ENDIAN_H=1> +- $<$<PLATFORM_ID:OpenBSD>: TARGET_OS_LINUX=1 HAVE_ENDIAN_H=1> ++ $<$<BOOL:${IS_BSD}>: TARGET_OS_LINUX=1 HAVE_ENDIAN_H=1> + $<$<PLATFORM_ID:Windows>: TARGET_OS_WINDOWS=1 > + ) + +@@ -209,12 +211,12 @@ target_include_directories (newt64 PUBLIC + src/ + $<$<PLATFORM_ID:Darwin>: src/newt_core/incs/darwin > + $<$<PLATFORM_ID:Linux>: src/newt_core/incs/darwin > +- $<$<PLATFORM_ID:OpenBSD>: src/newt_core/incs/darwin > ++ $<$<BOOL:${IS_BSD}>: src/newt_core/incs/darwin > + $<$<PLATFORM_ID:Windows>: src/newt_core/incs/win > + ) + + target_link_libraries(newt64 +- PUBLIC ++ PUBLIC + libnewt64 + $<$<PLATFORM_ID:Linux>: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.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69dff7b6.1f9db.690996ab>
