Re: [hatari-devel] How to include EmuTOS in Hatari.app when building it yourself on macOS?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Fri, 27 Jun 2025 20:08:32 +0200
schrieb Frank Danapfel <frank.danapfel@xxxxxxxxxxxxxx>:

> Hi all,
> 
> I’ve now managed to figure this out myself. 
> 
> All that is needed is one small change in the src/CMakeLists.txt file to include tos.img in the list of files that should be included in the app bundle:
> 
> --- CMakeLists.txt.orig 2025-06-27 19:52:06
> +++ CMakeLists.txt 2025-06-27 19:52:26
> @@ -25,7 +25,7 @@
>       gui-osx/CreateFloppyController.m gui-osx/SDLMain.m gui-osx/paths.m)
>   set_source_files_properties(${GUIOSX_SOURCES} PROPERTIES LANGUAGE C)
>   set(GUIOSX_RSRCS
> -     Hatari.icns gui-osx/stdisk.png gui-osx/en.lproj gui-osx/fr.lproj)
> +     Hatari.icns tos.img gui-osx/stdisk.png gui-osx/en.lproj gui-osx/fr.lproj)
>   set(GUIOSX_DOCS
>       ${CMAKE_SOURCE_DIR}/doc/manual.html ${CMAKE_SOURCE_DIR}/doc/images
>       ${CMAKE_SOURCE_DIR}/doc/compatibility.html ${CMAKE_SOURCE_DIR}/doc/toc.js )
> 
> And the tos.img file has to be copied to the main src directory from which Hatari is built.
> 
> Maybe somebody can include this change in the official repo, so that others who want to built Hatari on macOS themselves can also get a version of the Hatari.app that inclused the tos.img.

 Hi Frank,

since tos.img is optional, I think we'd rather need something like this:

diff a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,8 @@ endif()
 # Disk image code is shared with the hmsa tool, so we put it into a library:
 add_library(Floppy createBlankImage.c dim.c msa.c st.c zip.c utils.c)
 
+file(GLOB TOS_IMG_FILE tos.img LIST_DIRECTORIES false)
+
 # When building for macOS, define specific sources for gui and resources
 if(ENABLE_OSX_BUNDLE)
 	set(GUIOSX_SOURCES
@@ -25,7 +27,8 @@ if(ENABLE_OSX_BUNDLE)
 	    gui-osx/CreateFloppyController.m gui-osx/SDLMain.m gui-osx/paths.m)
 	set_source_files_properties(${GUIOSX_SOURCES} PROPERTIES LANGUAGE C)
 	set(GUIOSX_RSRCS
-	    Hatari.icns gui-osx/stdisk.png gui-osx/en.lproj gui-osx/fr.lproj)
+	    Hatari.icns gui-osx/stdisk.png gui-osx/en.lproj gui-osx/fr.lproj
+	    ${TOS_IMG_FILE})
 	set(GUIOSX_DOCS
 	    ${CMAKE_SOURCE_DIR}/doc/manual.html ${CMAKE_SOURCE_DIR}/doc/images
 	    ${CMAKE_SOURCE_DIR}/doc/compatibility.html ${CMAKE_SOURCE_DIR}/doc/toc.js )
@@ -271,8 +274,7 @@ if(ENABLE_OSX_BUNDLE)
 else()
 	install(TARGETS ${APP_NAME} RUNTIME DESTINATION ${BINDIR})
 	install(FILES hatari-icon.bmp DESTINATION ${DATADIR})
-	file(GLOB TOS_IMG_FILE tos.img)
 	if(TOS_IMG_FILE)
-		install(FILES tos.img DESTINATION ${DATADIR})
+		install(FILES ${TOS_IMG_FILE} DESTINATION ${DATADIR})
 	endif(TOS_IMG_FILE)
 endif(ENABLE_OSX_BUNDLE)

Could you please check whether that works on macOS, too?

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/