diff --git a/.github/workflows/test_builds.yaml b/.github/workflows/test_builds.yaml index 10f1febad..a7ad6f47e 100644 --- a/.github/workflows/test_builds.yaml +++ b/.github/workflows/test_builds.yaml @@ -13,6 +13,10 @@ jobs: runs-on: ubuntu-latest container: image: ubuntu:26.04 + options: >- + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined steps: - name: Update Ubuntu run: | @@ -51,6 +55,10 @@ jobs: runs-on: ubuntu-latest container: image: fedora:latest + options: >- + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined steps: - name: Update Fedora run: | @@ -89,6 +97,10 @@ jobs: runs-on: ubuntu-latest container: image: archlinux:latest + options: >- + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined steps: - name: Update Arch run: | diff --git a/GNUmakefile b/GNUmakefile index 843f4edce..eb191d30d 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -108,6 +108,7 @@ else endif ifeq ($(COMPILER_TYPE),gcc) + ADDITIONAL_OBJCFLAGS += -std=gnu99 ADDITIONAL_LDFLAGS += -fuse-ld=bfd else ADDITIONAL_LDFLAGS += -fuse-ld=lld diff --git a/ShellScripts/Linux/install_freedesktop_fn.sh b/ShellScripts/Linux/install_freedesktop_fn.sh index 7638b3bfc..72519c493 100644 --- a/ShellScripts/Linux/install_freedesktop_fn.sh +++ b/ShellScripts/Linux/install_freedesktop_fn.sh @@ -35,7 +35,6 @@ install_freedesktop() { install -D "$PROGDIR/oolite.debug" "$1/$2/oolite.debug" || { echo "$err_msg install oolite debug symbols" >&2; return 1; } fi install -D "$PROGDIR/run_oolite.sh" "$APPBIN/run_oolite.sh" || { echo "$err_msg install run_oolite.sh" >&2; return 1; } - install -D "$PROGDIR/splash-launcher" "$APPBIN/splash-launcher" || { echo "$err_msg install splash-launcher" >&2; return 1; } # Resources copy mkdir -p "$APPBIN/Resources" diff --git a/ShellScripts/Linux/install_package_fn.sh b/ShellScripts/Linux/install_package_fn.sh index 9ce2cdb62..fb2830131 100644 --- a/ShellScripts/Linux/install_package_fn.sh +++ b/ShellScripts/Linux/install_package_fn.sh @@ -130,9 +130,9 @@ install_package() { "appimage") case "$CURRENT_DISTRO" in - debian) PKG_NAME="NONE" ;; - redhat) PKG_NAME="desktop-file-utils which zsync" ;; - arch) PKG_NAME="desktop-file-utils zsync" ;; + debian) PKG_NAME="file fuse3" ;; + redhat) PKG_NAME="file fuse3 desktop-file-utils which zsync" ;; + arch) PKG_NAME="file fuse3 desktop-file-utils zsync" ;; esac ;; "flatpak") PKG_NAME="flatpak flatpak-builder" ;; diff --git a/ShellScripts/Linux/run_oolite.sh b/ShellScripts/Linux/run_oolite.sh index f61574a28..8ced6fe2d 100755 --- a/ShellScripts/Linux/run_oolite.sh +++ b/ShellScripts/Linux/run_oolite.sh @@ -4,13 +4,9 @@ HERE="$(dirname "$(readlink -f "$0")")" DEBUG=false -SHOW_SPLASH=true # Loop through all arguments for arg in "$@"; do case "$arg" in - -nosplash|--nosplash|-help|--help) - SHOW_SPLASH=false - ;; debug) DEBUG=true shift @@ -55,13 +51,7 @@ launch_guarded() { if [[ "$DEBUG" == true ]]; then exec gdb --args "$OO_EXEDIR/oolite" "$@" -nosplash fi - if [[ "$SHOW_SPLASH" == true ]]; then - "$OO_EXEDIR/splash-launcher" "$OO_EXEDIR/Resources/Images/splash.bmp" & - "$OO_EXEDIR/oolite" "$@" -nosplash - else - # already has -nosplash - "$OO_EXEDIR/oolite" "$@" - fi + "$OO_EXEDIR/oolite" "$@" local EXIT_CODE=$? if [ $EXIT_CODE -eq 0 ]; then diff --git a/installers/appimage/create_appimage.sh b/installers/appimage/create_appimage.sh index dbdaf1880..e6305730e 100755 --- a/installers/appimage/create_appimage.sh +++ b/installers/appimage/create_appimage.sh @@ -59,6 +59,9 @@ run_script() { export DEPLOY_VULKAN local DEPLOY_LOCALE=0 export DEPLOY_LOCALE + local STRACE_MODE=0 + export STRACE_MODE + # install_metadatainfo_fn already put the files in the parameters below in the right place, # but no harm putting again here if ! $SHARUN_BIN "$APPBIN/oolite"; then @@ -82,8 +85,15 @@ run_script() { return 1 fi + APPIMAGETOOL_BIN="./appimagetool" + if [ ! -x "$APPIMAGETOOL_BIN" ]; then + echo "📥 appimagetool not found. Downloading..." + curl -o "$APPIMAGETOOL_BIN" -L https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage || { echo "❌ appimagetool download failed" >&2; exit 1; } + chmod +x "$APPIMAGETOOL_BIN" + fi + echo "Creating AppImage $OUTNAME..." - if ! $SHARUN_BIN --make-appimage; then + if ! $APPIMAGETOOL_BIN "$ABS_APPDIR" "$OUTNAME"; then echo "❌ AppImage creation failed!" >&2 return 1 fi diff --git a/installers/flatpak/create_flatpak.sh b/installers/flatpak/create_flatpak.sh index f22f7f804..94fed54d5 100755 --- a/installers/flatpak/create_flatpak.sh +++ b/installers/flatpak/create_flatpak.sh @@ -32,21 +32,35 @@ run_script() { fi # check manifest + LINT_EXCEPTIONS=$(mktemp /tmp/oolite-lint-XXXXXX.json) + cat < "$LINT_EXCEPTIONS" +{ + "space.oolite.Oolite": [ + "finish-args-has-dev-input" + ] +} +EOF + trap 'rm -f "$LINT_EXCEPTIONS"' RETURN EXIT + if command -v flatpak-builder-lint >/dev/null 2>&1; then - if ! flatpak-builder-lint manifest "$MANIFEST"; then + if ! flatpak-builder-lint manifest "$MANIFEST" --exceptions --user-exceptions="$LINT_EXCEPTIONS"; then echo "❌ Flatpak manifest lint failed!" >&2 - cat $MANIFEST + cat "$MANIFEST" echo "❌ Flatpak manifest lint failed!" >&2 return 1 fi else echo "Native linter not found. Falling back to Flatpak container..." - if ! flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest "$MANIFEST"; then + if ! flatpak run --filesystem="$LINT_EXCEPTIONS" --command=flatpak-builder-lint org.flatpak.Builder manifest "$MANIFEST" --exceptions --user-exceptions="$LINT_EXCEPTIONS"; then echo "❌ Flatpak manifest lint failed!" >&2 return 1 fi fi + # 3. Clean up + rm -f "$LINT_EXCEPTIONS" + trap - RETURN EXIT + echo "Creating Flatpak..." if ! flatpak remote-add \ --user \ diff --git a/installers/flatpak/space.oolite.Oolite.yaml b/installers/flatpak/space.oolite.Oolite.yaml index 9ae68c5da..33456d2ff 100644 --- a/installers/flatpak/space.oolite.Oolite.yaml +++ b/installers/flatpak/space.oolite.Oolite.yaml @@ -9,12 +9,14 @@ build-options: prepend-ld-library-path: /usr/lib/sdk/llvm22/lib command: run_oolite.sh finish-args: + - --require-version=1.16.0 - --socket=wayland - --socket=fallback-x11 - --share=ipc - --share=network - --socket=pulseaudio - --device=dri + - --device=input cleanup: - /include - /lib/pkgconfig diff --git a/src/SDL/MyOpenGLView.m b/src/SDL/MyOpenGLView.m index 54c7eaf72..925664a8a 100644 --- a/src/SDL/MyOpenGLView.m +++ b/src/SDL/MyOpenGLView.m @@ -192,8 +192,20 @@ - (void) createWindowWithSize: (NSSize) size } NSString *windowCaption = [self getWindowCaption]; - int windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY; - window = SDL_CreateWindow([windowCaption UTF8String], size.width, size.height, windowFlags); + Uint32 windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY; + + // Define modern SDL3 properties for window configuration + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, [windowCaption UTF8String]); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, size.width); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, size.height); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER, windowFlags); + + // Explicit centering properties setup for SDL3 + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, SDL_WINDOWPOS_CENTERED); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, SDL_WINDOWPOS_CENTERED); + + window = SDL_CreateWindowWithProperties(props); if (!window) { OOLog(@"display.initGL", @"%@", @"Trying 8-bpcc, 24-bit depth buffer"); @@ -203,7 +215,7 @@ - (void) createWindowWithSize: (NSSize) size SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); - window = SDL_CreateWindow([windowCaption UTF8String], size.width, size.height, windowFlags); + window = SDL_CreateWindowWithProperties(props); _hdrOutput = NO; } @@ -217,9 +229,12 @@ - (void) createWindowWithSize: (NSSize) size // and if it's this bad, forget even trying to multisample! SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); - window = SDL_CreateWindow([windowCaption UTF8String], size.width, size.height, windowFlags); + window = SDL_CreateWindowWithProperties(props); } + // Clean up properties block + SDL_DestroyProperties(props); + if (!window) { const char * errStr = SDL_GetError(); @@ -248,7 +263,7 @@ - (void) createWindowWithSize: (NSSize) size OOLog(@"sdl.window_handle", @"%@", @"Failed to retrieve window handle"); exit(1); } - + // This must be inited after windowHandle has been set - we need the main window handle in order to get monitor info if (![self getCurrentMonitorInfo:&monitorInfo]) { @@ -256,7 +271,7 @@ - (void) createWindowWithSize: (NSSize) size } atDesktopResolution = YES; - + #if USE_UNDOCUMENTED_DARKMODE_API // dark mode stuff - this is mainly for the winodw titlebar's context menu HMODULE hUxTheme = LoadLibraryExW(L"uxtheme.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); @@ -285,18 +300,18 @@ - (void) createWindowWithSize: (NSSize) size SDL_DestroySurface(icon); _colorSaturation = 1.0f; - + #if OOLITE_WINDOWS _hdrMaxBrightness = [prefs oo_floatForKey:@"hdr-max-brightness" defaultValue:1000.0f]; _hdrPaperWhiteBrightness = [prefs oo_floatForKey:@"hdr-paperwhite-brightness" defaultValue:200.0f]; _hdrToneMapper = OOHDRToneMapperFromString([prefs oo_stringForKey:@"hdr-tone-mapper" defaultValue:@"OOHDR_TONEMAPPER_ACES_APPROX"]); #endif - + _sdrToneMapper = OOSDRToneMapperFromString([prefs oo_stringForKey:@"sdr-tone-mapper" defaultValue:@"OOSDR_TONEMAPPER_ACES"]); - + SDL_SetWindowSurfaceVSync(window, vSyncPreference); OOLog(@"display.initGL", @"V-Sync %@requested.", vSyncPreference ? @"" : @"not "); - + int testAttrib = -1; OOLog(@"display.initGL", @"%@", @"Achieved color / depth buffer sizes (bits):"); SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &testAttrib); @@ -316,9 +331,9 @@ - (void) createWindowWithSize: (NSSize) size #if OOLITE_WINDOWS OOLog(@"display.initGL", @"Pixel format index: %d", GetPixelFormat(GetDC(windowHandle))); #endif - + // Verify V-sync successfully set - report it if not - + int hasVsync; if (vSyncPreference && (!SDL_GetWindowSurfaceVSync(window, &hasVsync) || !hasVsync)) { @@ -376,10 +391,10 @@ - (id) init { showSplashScreen = YES; } - + // if V-sync is disabled at the command line, override the defaults file if ([arg isEqual:@"-novsync"] || [arg isEqual:@"--novsync"]) vSyncPreference = NO; - + if ([arg isEqual: @"-hdr"]) bitsPerColorComponent = 16; // build the startup command string so that we can log it @@ -401,7 +416,6 @@ - (id) init } [self populateFullScreenModelist]; - SDL_SetEnvironmentVariable(SDL_GetEnvironment(), "SDL_VIDEO_WINDOW_POS", "center", YES); // Find what the full screen and windowed settings are. fullScreen = NO; @@ -440,7 +454,7 @@ - (id) init virtualJoystickPosition = NSMakePoint(0.0,0.0); mouseWarped = NO; - + _mouseVirtualStickSensitivityFactor = OOClamp_0_1_f([prefs oo_floatForKey:@"mouse-flight-sensitivity" defaultValue:0.95f]); // ensure no chance of a divide by zero later on if (_mouseVirtualStickSensitivityFactor < 0.005f) _mouseVirtualStickSensitivityFactor = 0.005f; @@ -450,7 +464,7 @@ - (id) init isAlphabetKeyDown = NO; timeIntervalAtLastClick = timeSinceLastMouseWheel = [NSDate timeIntervalSinceReferenceDate]; - + _mouseWheelDelta = 0.0f; m_glContextInitialized = NO; @@ -482,8 +496,10 @@ - (void) endSplashScreen #else if (!showSplashScreen) return; + SDL_HideWindow(window); SDL_SetWindowSize(window, firstScreen.width, firstScreen.height); SDL_SetWindowFullscreen(window, fullScreen); + SDL_ShowWindow(window); /* MKW 2011.11.11 * Eat all SDL events to gobble up any resize events while the