diff --git a/.github/workflows/build-all.yaml b/.github/workflows/build-all.yaml index 42429a25b..66e860658 100644 --- a/.github/workflows/build-all.yaml +++ b/.github/workflows/build-all.yaml @@ -46,7 +46,7 @@ jobs: with: name: oolite-linux-${{matrix.flavour}} path: | - oolite/build/Oolite_*.AppImage + oolite/build/oolite*.AppImage retention-days: 5 build-flatpak: @@ -158,7 +158,7 @@ jobs: cat build/OOLITE_VERSION.txt >> "$GITHUB_OUTPUT" - name: Remove old prereleases - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' || endsWith(github.ref, 'maintenance') uses: s00d/delete-older-releases@0.2.1 with: keep_latest: 7 @@ -169,7 +169,7 @@ jobs: # For changes on master branch, create a new release. # It should move the 'latest' tag automatically. - name: Create Release - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' || endsWith(github.ref, 'maintenance') id: create_release uses: "marvinpinto/action-automatic-releases@latest" with: @@ -188,7 +188,7 @@ jobs: artifacts/oolite-flatpak/*.flatpak - name: Remove old workflow runs - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' || endsWith(github.ref, 'maintenance') uses: Mattraks/delete-workflow-runs@v2 with: token: ${{ github.token }} diff --git a/.github/workflows/test_builds.yaml b/.github/workflows/test_builds.yaml index 7f5634683..34d7bedc3 100644 --- a/.github/workflows/test_builds.yaml +++ b/.github/workflows/test_builds.yaml @@ -38,10 +38,10 @@ jobs: run: | dnf -y update dnf -y install git - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - submodules: true + - name: Checkout Oolite + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git clone --recursive https://github.com/${{ github.repository }} . - name: Checkout dependencies run: | ShellScripts/Linux/checkout_deps.sh @@ -65,10 +65,10 @@ jobs: run: | pacman -Syu --noconfirm pacman -S --noconfirm --needed git - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - submodules: true + - name: Checkout Oolite + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git clone --recursive https://github.com/${{ github.repository }} . - name: Checkout dependencies run: | ShellScripts/Linux/checkout_deps.sh diff --git a/GNUmakefile b/GNUmakefile index 23e12a98c..28971bcad 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,19 +11,6 @@ ifeq ($(GNUSTEP_HOST_OS),mingw32) endif GNUSTEP_OBJ_DIR_BASENAME := $(GNUSTEP_OBJ_DIR_NAME) -VERSION := $(shell cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2) -VER_MAJ := $(shell echo $(VERSION) | cut -d. -f1) -VER_MIN := $(shell echo $(VERSION) | cut -d. -f2) -VER_REV := $(shell echo $(VERSION) | cut -d. -f3) -ifeq ($(VER_REV),) - VER_REV = 0 -endif -VER_DATE := $(shell date +%y%m%d) -VER_GITREV := $(shell git rev-list --count HEAD) -VER_GITHASH := $(shell git rev-parse --short=7 HEAD) -VER_FULL := $(VER_MAJ).$(VER_MIN).$(VER_REV).$(VER_GITREV)-$(VER_DATE)-$(VER_GITHASH) - - ifeq ($(GNUSTEP_HOST_OS),mingw32) vpath %.rc src/SDL/OOResourcesWin @@ -57,11 +44,11 @@ ifeq ($(GNUSTEP_HOST_OS),mingw32) LIBPNG_LIBRARY_NAME = png14 endif - ADDITIONAL_INCLUDE_DIRS = -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables -Isrc/Core/MiniZip -Isrc/SDL/EXRSnapshotSupport - ADDITIONAL_OBJC_LIBS = -lglu32 -lopengl32 -l$(OPENAL_LIBRARY_NAME).dll -l$(LIBPNG_LIBRARY_NAME).dll -lmingw32 -lSDLmain -lSDL -lvorbisfile.dll -lvorbis.dll -lz -lgnustep-base -l$(JS_IMPORT_LIBRARY) -lnspr4 -lshlwapi -ldwmapi -lwinmm -mwindows - ADDITIONAL_CFLAGS = -DWIN32 -DNEED_STRLCPY `sdl-config --cflags` -mtune=generic -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DNTDDI_VERSION=0x0A00000F + ADDITIONAL_INCLUDE_DIRS += -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables -Isrc/Core/MiniZip -Isrc/SDL/EXRSnapshotSupport + ADDITIONAL_OBJC_LIBS += -lglu32 -lopengl32 -l$(OPENAL_LIBRARY_NAME).dll -l$(LIBPNG_LIBRARY_NAME).dll -lmingw32 -lSDLmain -lSDL -lvorbisfile.dll -lvorbis.dll -lz -lgnustep-base -l$(JS_IMPORT_LIBRARY) -lnspr4 -lshlwapi -ldwmapi -lwinmm -mwindows + ADDITIONAL_CFLAGS += -DWIN32 -DNEED_STRLCPY `sdl-config --cflags` -mtune=generic -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DNTDDI_VERSION=0x0A00000F # note the vpath stuff above isn't working for me, so adding src/SDL and src/Core explicitly - ADDITIONAL_OBJCFLAGS = -DLOADSAVEGUI -DWIN32 -DXP_WIN -Wno-import -std=gnu99 `sdl-config --cflags` -mtune=generic -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DNTDDI_VERSION=0x0A00000F + ADDITIONAL_OBJCFLAGS += -DLOADSAVEGUI -DWIN32 -DXP_WIN -Wno-import -std=gnu99 `sdl-config --cflags` -mtune=generic -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DNTDDI_VERSION=0x0A00000F # oolite_LIB_DIRS += -L$(GNUSTEP_LOCAL_ROOT)/lib -L$(WIN_DEPS_DIR)/lib -L$(JS_LIB_DIR) ifeq ($(ESPEAK),yes) @@ -93,11 +80,11 @@ else # Linux only uses modern build LIBJS = js_static endif - ADDITIONAL_INCLUDE_DIRS = -I$(LIBJS_INC_DIR) -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables -Isrc/Core/MiniZip - ADDITIONAL_OBJC_LIBS = -lGLU -lGL -lX11 -lSDL -lgnustep-base -L$(LIBJS_DIR) -l$(LIBJS) -lopenal -lz -lvorbisfile -lpng `nspr-config --libs` -lstdc++ - ADDITIONAL_OBJCFLAGS = -DLINUX -DXP_UNIX `sdl-config --cflags` - ADDITIONAL_CFLAGS = -DLINUX `sdl-config --cflags` - ADDITIONAL_LDFLAGS = -fuse-ld=bfd # Force use of ld (ldd and gold don't work. mold also works) + ADDITIONAL_INCLUDE_DIRS += -I$(LIBJS_INC_DIR) -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables -Isrc/Core/MiniZip + ADDITIONAL_OBJC_LIBS += -lGLU -lGL -lX11 -lSDL -lgnustep-base -L$(LIBJS_DIR) -l$(LIBJS) -lopenal -lz -lvorbisfile -lpng `nspr-config --libs` -lstdc++ + ADDITIONAL_OBJCFLAGS += -DLINUX -DXP_UNIX `sdl-config --cflags` + ADDITIONAL_CFLAGS += -DLINUX `sdl-config --cflags` + ADDITIONAL_LDFLAGS += -fuse-ld=bfd # Force use of ld (ldd and gold don't work. mold also works) ifeq ($(ESPEAK),yes) ADDITIONAL_OBJC_LIBS += -lespeak-ng @@ -117,8 +104,9 @@ endif # add specific flags if building modern ifeq ($(modern),yes) - ADDITIONAL_CFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\" - ADDITIONAL_OBJCFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\" + VER_FULL := $(shell ./ShellScripts/common/get_version.sh) + ADDITIONAL_CFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\" + ADDITIONAL_OBJCFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\" # link time optimizations ifeq ($(lto),yes) ADDITIONAL_CFLAGS += -flto diff --git a/Makefile b/Makefile index 7d5140dcb..4a00c2cd4 100755 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ help: .PHONY: release release: $(MAKE) -f GNUmakefile debug=no strip=yes lto=yes - mkdir -p AddOns && rm -rf AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp AddOns/Basic-debug.oxp + mkdir -p build/AddOns && rm -rf build/AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp build/AddOns/Basic-debug.oxp .PHONY: release-deployment release-deployment: @@ -42,18 +42,18 @@ release-deployment: .PHONY: release-snapshot release-snapshot: $(MAKE) -f GNUmakefile SNAPSHOT_BUILD=yes debug=no - mkdir -p AddOns && rm -rf AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp AddOns/Basic-debug.oxp + mkdir -p build/AddOns && rm -rf build/AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp build/AddOns/Basic-debug.oxp .PHONY: debug debug: $(MAKE) -f GNUmakefile debug=yes strip=no - mkdir -p AddOns && rm -rf AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp AddOns/Basic-debug.oxp + mkdir -p build/AddOns && rm -rf build/AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp build/AddOns/Basic-debug.oxp .PHONY: clean clean: $(MAKE) -f GNUmakefile clean $(RM) -rf oolite.app - $(RM) -rf AddOns + $(RM) -rf build/AddOns .PHONY: all all: release release-deployment release-snapshot debug diff --git a/ShellScripts/Linux/GNUstep.conf.template b/ShellScripts/Linux/GNUstep.conf.template new file mode 100644 index 000000000..18734eefe --- /dev/null +++ b/ShellScripts/Linux/GNUstep.conf.template @@ -0,0 +1,37 @@ +GNUSTEP_MAKEFILES=@BASEDIR@/share/GNUstep/Makefiles +GNUSTEP_SYSTEM_USERS_DIR=/home +GNUSTEP_NETWORK_USERS_DIR=/home +GNUSTEP_LOCAL_USERS_DIR=/home +GNUSTEP_SYSTEM_APPS=@BASEDIR@/lib/GNUstep/Applications +GNUSTEP_SYSTEM_ADMIN_APPS=@BASEDIR@/lib/GNUstep/Applications +GNUSTEP_SYSTEM_WEB_APPS=@BASEDIR@/lib/GNUstep/WebApplications +GNUSTEP_SYSTEM_TOOLS=@BASEDIR@/bin +GNUSTEP_SYSTEM_ADMIN_TOOLS=@BASEDIR@/sbin +GNUSTEP_SYSTEM_LIBRARY=@BASEDIR@/lib/GNUstep +GNUSTEP_SYSTEM_HEADERS=@BASEDIR@/include +GNUSTEP_SYSTEM_LIBRARIES=@BASEDIR@/lib +GNUSTEP_SYSTEM_DOC=@BASEDIR@/share/GNUstep/Documentation +GNUSTEP_SYSTEM_DOC_MAN=@BASEDIR@/share/man +GNUSTEP_SYSTEM_DOC_INFO=@BASEDIR@/share/info +GNUSTEP_NETWORK_APPS=@BASEDIR@/lib/GNUstep/Applications +GNUSTEP_NETWORK_ADMIN_APPS=@BASEDIR@/lib/GNUstep/Applications +GNUSTEP_NETWORK_WEB_APPS=@BASEDIR@/lib/GNUstep/WebApplications +GNUSTEP_NETWORK_TOOLS=@BASEDIR@/bin +GNUSTEP_NETWORK_ADMIN_TOOLS=@BASEDIR@/sbin +GNUSTEP_NETWORK_LIBRARY=@BASEDIR@/lib/GNUstep +GNUSTEP_NETWORK_HEADERS=@BASEDIR@/include +GNUSTEP_NETWORK_LIBRARIES=@BASEDIR@/lib +GNUSTEP_NETWORK_DOC=@BASEDIR@/share/GNUstep/Documentation +GNUSTEP_NETWORK_DOC_MAN=@BASEDIR@/share/man +GNUSTEP_NETWORK_DOC_INFO=@BASEDIR@/share/info +GNUSTEP_LOCAL_APPS=@BASEDIR@/lib/GNUstep/Applications +GNUSTEP_LOCAL_ADMIN_APPS=@BASEDIR@/lib/GNUstep/Applications +GNUSTEP_LOCAL_WEB_APPS=@BASEDIR@/lib/GNUstep/WebApplications +GNUSTEP_LOCAL_TOOLS=@BASEDIR@/bin +GNUSTEP_LOCAL_ADMIN_TOOLS=@BASEDIR@/sbin +GNUSTEP_LOCAL_LIBRARY=@BASEDIR@/lib/GNUstep +GNUSTEP_LOCAL_HEADERS=@BASEDIR@/include +GNUSTEP_LOCAL_LIBRARIES=@BASEDIR@/lib +GNUSTEP_LOCAL_DOC=@BASEDIR@/share/GNUstep/Documentation +GNUSTEP_LOCAL_DOC_MAN=@BASEDIR@/share/man +GNUSTEP_LOCAL_DOC_INFO=@BASEDIR@/share/info diff --git a/ShellScripts/Linux/checkout_deps_fn.sh b/ShellScripts/Linux/checkout_deps_fn.sh index d2e3b0a8b..6340041dc 100755 --- a/ShellScripts/Linux/checkout_deps_fn.sh +++ b/ShellScripts/Linux/checkout_deps_fn.sh @@ -11,5 +11,6 @@ checkout_deps() { git clone --filter=blob:none https://github.com/gnustep/libobjc2.git git clone --filter=blob:none https://github.com/gnustep/tools-make.git git clone --filter=blob:none https://github.com/gnustep/libs-base.git + popd } diff --git a/ShellScripts/Linux/install_deps_root.sh b/ShellScripts/Linux/install_deps_root.sh index 80ce78d7b..5c2d16a03 100755 --- a/ShellScripts/Linux/install_deps_root.sh +++ b/ShellScripts/Linux/install_deps_root.sh @@ -78,10 +78,7 @@ run_script() { return 1 fi # For building AppImage - if ! install_package file; then - return 1 - fi - if ! install_package fuse; then + if ! install_package appimage; then return 1 fi # For building Flatpak @@ -116,7 +113,6 @@ run_script() { cd tools-make make clean - # Bash if [[ ${CURRENT_DISTRO,,} == "redhat" ]]; then LIB_PARAM="--with-libdir=lib64" else diff --git a/ShellScripts/Linux/install_freedesktop_fn.sh b/ShellScripts/Linux/install_freedesktop_fn.sh new file mode 100755 index 000000000..26ec37f00 --- /dev/null +++ b/ShellScripts/Linux/install_freedesktop_fn.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +install_freedesktop() { + # Install metainfo (eg. for FlatHub and AppImageHub) + # $1: app folder (destination) + # $2: appdata or metainfo + + local err_msg="❌ Error: Failed to install " + + SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd) + pushd "$SCRIPT_DIR" + + source ../common/get_version.sh + + echo "Installing metainfo to to $1" + + PROGDIR="../../oolite.app" + APPBIN="$1/bin" + APPSHR="$1/share" + + # Install binaries and scripts + install -D "$PROGDIR/oolite" "$APPBIN/oolite" || { echo "$err_msg oolite binary" >&2; return 1; } + install -D "$PROGDIR/run_oolite.sh" "$APPBIN/run_oolite.sh" || { echo "$err_msg run_oolite.sh" >&2; return 1; } + install -D "$PROGDIR/splash-launcher" "$APPBIN/splash-launcher" || { echo "$err_msg splash-launcher" >&2; return 1; } + + # Resources copy + mkdir -p "$APPBIN/Resources" + cp -rf "$PROGDIR/Resources/." "$APPBIN/Resources/" || { echo "$err_msg Copying Resources folder" >&2; return 1; } + + install -D "GNUstep.conf.template" "$APPBIN/Resources/GNUstep.conf.template" || { echo "$err_msg GNUstep template" >&2; return 1; } + + APP_METAINFO="$APPSHR/metainfo/space.oolite.Oolite.$2.xml" + install -D ../../installers/FreeDesktop/space.oolite.Oolite.metainfo.xml.template "$APP_METAINFO" || { echo "$err_msg metainfo template" >&2; return 1; } + + sed -i "s/@VER@/${VERSION}/g" "$APP_METAINFO" + sed -i "s/@DATE@/${APP_DATE}/g" "$APP_METAINFO" + + # Desktop and Icon + install -D ../../installers/FreeDesktop/space.oolite.Oolite.desktop "$APPSHR/applications/space.oolite.Oolite.desktop" || { echo "$err_msg desktop file" >&2; return 1; } + + install -D "$PROGDIR/Resources/Textures/oolite-logo1.png" "$APPSHR/icons/hicolor/256x256/apps/space.oolite.Oolite.png" || { echo "$err_msg icon file" >&2; return 1; } + + popd +} \ No newline at end of file diff --git a/ShellScripts/Linux/install_package_fn.sh b/ShellScripts/Linux/install_package_fn.sh index b48da02f6..68bab1169 100755 --- a/ShellScripts/Linux/install_package_fn.sh +++ b/ShellScripts/Linux/install_package_fn.sh @@ -128,21 +128,24 @@ install_package() { arch) PKG_NAME="libx11" ;; esac ;; - "file") PKG_NAME="file" ;; - - "fuse") PKG_NAME="fuse3" ;; + "appimage") + case "$CURRENT_DISTRO" in + debian) PKG_NAME="file fuse3" ;; + redhat) PKG_NAME="file fuse3 which desktop-file-utils perl-File-MimeInfo" ;; + arch) PKG_NAME="file fuse3" ;; + esac ;; "flatpak") PKG_NAME="flatpak flatpak-builder" ;; *) - echo "❌ Could not translate '$GENERIC_NAME' for $CURRENT_DISTRO!" >&2 + echo "❌ I don't know how to translate '$GENERIC_NAME' for $CURRENT_DISTRO" >&2 return 1 ;; esac # Perform the Installation if [ -z "$PKG_NAME" ]; then - echo "❌ Could not determine package name for $GENERIC_NAME!" >&2 + echo "❌ Could not determine package name for $GENERIC_NAME" >&2 return 1 else echo "--> Installing $GENERIC_NAME ($PKG_NAME)..." diff --git a/ShellScripts/Linux/os_detection.sh b/ShellScripts/Linux/os_detection.sh index 20e62ab61..a02a79d93 100644 --- a/ShellScripts/Linux/os_detection.sh +++ b/ShellScripts/Linux/os_detection.sh @@ -7,7 +7,7 @@ if [ -f /etc/os-release ]; then . /etc/os-release OS_FAMILY="${ID} ${ID_LIKE}" else - echo "❌ /etc/os-release not found - cannot detect OS!" >&2 + echo "❌ /etc/os-release not found. Cannot detect OS." >&2 exit 1 fi @@ -31,7 +31,7 @@ elif [[ "$OS_FAMILY" == *"arch"* ]]; then UPDATE_CMD=(pacman -Syu) else - echo "❌ Unsupported distribution detected!" >&2 + echo "❌ Unsupported distribution detected." >&2 exit 1 fi diff --git a/ShellScripts/Linux/run_oolite.sh b/ShellScripts/Linux/run_oolite.sh index 010d569b2..623db19d1 100755 --- a/ShellScripts/Linux/run_oolite.sh +++ b/ShellScripts/Linux/run_oolite.sh @@ -1,80 +1,148 @@ #!/bin/bash + +HERE="$(dirname "$(readlink -f "$0")")" + +SHOW_SPLASH=true +# Loop through all arguments +for arg in "$@"; do + case "$arg" in + -nosplash|--nosplash) + SHOW_SPLASH=false + ;; + esac +done + +notify_failure() { + if [[ -n "$FLATPAK_ID" ]]; then + local MSG="$FLATPAK_ID failed to start!\n\nExit Code: $EXIT_CODE" + gdbus call --session \ + --dest org.freedesktop.portal.Desktop \ + --object-path /org/freedesktop/portal/desktop \ + --method org.freedesktop.portal.Notification.AddNotification \ + "oolite_launch" \ + "{'title': <'Application Error'>, 'body': <'$MSG'>}" + else + local APP_NAME="${ARGV0:-Application}" + local MSG="$APP_NAME failed to start!\n\nExit Code: $EXIT_CODE\n\nRun from terminal to see details." + + if command -v notify-send > /dev/null; then + notify-send \ + --urgency=critical \ + --app-name="$APP_NAME" \ + --icon=dialog-error \ + "Application Error" \ + "$MSG" + else + # Fallback to Console (stderr) if libnotify is missing + echo "------------------------------------------------" >&2 + echo "ERROR: $APP_NAME exited with code $EXIT_CODE" >&2 + echo "------------------------------------------------" >&2 + fi + fi +} + launch_guarded() { - "$@" + if [[ "$1" == "packageinfo" ]]; then + cat "$OO_EXEDIR/Resources/manifest.plist" + exit 0 + 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 local EXIT_CODE=$? if [ $EXIT_CODE -eq 0 ]; then exit 0 fi - local APP_NAME="${ARGV0:-Application}" - local MSG="$APP_NAME failed to start.\n\nExit Code: $EXIT_CODE\n\nRun from terminal to see details." - - if command -v notify-send > /dev/null; then - notify-send \ - --urgency=critical \ - --app-name="$APP_NAME" \ - --icon=dialog-error \ - "Application Error" \ - "The application exited with code $EXIT_CODE." - else - # Fallback to Console (stderr) if libnotify is missing - echo "------------------------------------------------" >&2 - echo "ERROR: $APP_NAME exited with code $EXIT_CODE" >&2 - echo "------------------------------------------------" >&2 - fi - + notify_failure exit $EXIT_CODE } -find_exe_launch() { - if [[ -z "$OO_EXECUTABLE" ]]; then - HERE="$(dirname "$(readlink -f "$0")")" - OO_EXECUTABLE="$HERE/oolite" - if [[ ! -f "$OO_EXECUTABLE" ]]; then - OO_EXECUTABLE="$HERE/oolite.app/oolite" +find_exedir() { + if [[ -z "$OO_EXEDIR" ]]; then + OO_EXEDIR="$HERE" + if [[ ! -f "$OO_EXEDIR/oolite" ]]; then + OO_EXEDIR="$HERE/oolite.app" fi fi - launch_guarded "$OO_EXECUTABLE" "$@" +} + +make_gnustepconf_template() { + export GNUSTEP_CONFIG_FILE=$(mktemp -t oolite_gnustep_XXXX --suffix=.conf) + sed -e "s|@BASEDIR@|$BASEDIR|g" "$OO_EXEDIR/Resources/GNUstep.conf.template" > "$GNUSTEP_CONFIG_FILE" } # Check if we are running inside a Flatpak if [[ -n "$FLATPAK_ID" ]]; then + BASEDIR="/app" + OO_EXEDIR="$BASEDIR/bin" GAME_DATA="$HOME/.var/app/$FLATPAK_ID" - OO_EXECUTABLE="/app/bin/oolite" + make_gnustepconf_template # Check if we are running inside an AppImage elif [[ -n "$APPIMAGE" ]]; then - # Get the folder where AppRun is in the AppImage - HERE="$(dirname "$(readlink -f "${0}")")" - export LD_LIBRARY_PATH="$HERE/usr/lib:$LD_LIBRARY_PATH" - export PATH="$HERE/usr/bin:$PATH" - OO_EXECUTABLE="$HERE/usr/bin/oolite" + BASEDIR="$APPDIR/usr" + OO_EXEDIR="$BASEDIR/bin" + export LD_LIBRARY_PATH="$BASEDIR/lib:$LD_LIBRARY_PATH" + export PATH="$OO_EXEDIR:$PATH" + + DEBUG_OXP=$(grep "debug_functionality_support" "$OO_EXEDIR/Resources/manifest.plist") + if [[ "$DEBUG_OXP" == *"yes"* ]]; then + INTERNAL_ADDONS="$OO_EXEDIR/AddOns" + export OO_ADDITIONALADDONSDIRS="${OO_ADDITIONALADDONSDIRS}${OO_ADDITIONALADDONSDIRS:+,}$INTERNAL_ADDONS" + fi if [[ -n "$OO_DIRTYPE" ]]; then if [[ "${OO_DIRTYPE,,}" == "xdg" ]]; then GAME_DATA="$HOME/.local/share/Oolite" elif [[ "${OO_DIRTYPE,,}" == "legacy" ]]; then - launch_guarded "$OO_EXECUTABLE" "$@" + launch_guarded "$@" fi else # Get the folder containing the AppImage file HERE="$(dirname "$APPIMAGE")" GAME_DATA="$HERE/GameData" fi + make_gnustepconf_template +else + # Check if OO_DIRTYPE set + if [[ -n "$OO_DIRTYPE" ]]; then + if [[ "${OO_DIRTYPE,,}" == "xdg" ]]; then + GAME_DATA="$HOME/.local/share/Oolite" + elif [[ "${OO_DIRTYPE,,}" == "legacy" ]]; then + find_exedir + launch_guarded "$@" + fi + else + # Use script directory + GAME_DATA="$HERE/GameData" + fi + # Find the current system configuration file + ORIGINAL_CONF=$(gnustep-config --variable=GNUSTEP_CONFIG_FILE) -# Check if OO_DIRTYPE set -elif [[ -n "$OO_DIRTYPE" ]]; then - if [[ "${OO_DIRTYPE,,}" == "xdg" ]]; then - GAME_DATA="$HOME/.local/share/Oolite" - elif [[ "${OO_DIRTYPE,,}" == "legacy" ]]; then - find_exe_launch "$@" + # Fallback: If gnustep-config returns nothing, assume standard location + if [ -z "$ORIGINAL_CONF" ]; then + ORIGINAL_CONF="/etc/GNUstep/GNUstep.conf" + fi + + if [ -z "$ORIGINAL_CONF" ]; then + ORIGINAL_CONF="/usr/local/etc/GNUstep/GNUstep.conf" + fi + + GNUSTEP_CONFIG_FILE=$(mktemp -t oolite_gnustep_XXXX --suffix=.conf) + # Copy the original config (if it exists) to the temp file + if [ -f "$ORIGINAL_CONF" ]; then + cp "$ORIGINAL_CONF" "$GNUSTEP_CONFIG_FILE" + else + echo "No system config found at $ORIGINAL_CONF. Starting with empty config." + touch "$GNUSTEP_CONFIG_FILE" fi -else - # Use script directory - HERE="$(dirname "$(readlink -f "$0")")" - GAME_DATA="$HERE/GameData" fi mkdir -p "$GAME_DATA" @@ -96,6 +164,7 @@ elif [[ -n "$OO_USERADDONSDIR" ]]; then fi fi mkdir -p "$OO_ADDONSEXTRACTDIR" +# OO_ADDITIONALADDONSDIRS can be used to pass a comma separated list of additional OXP folders if [ -n "$OO_ADDITIONALADDONSDIRS" ]; then (IFS=,; mkdir -p $OO_ADDITIONALADDONSDIRS) fi @@ -105,47 +174,21 @@ mkdir -p "$OO_GNUSTEPDIR" OO_GNUSTEPDEFAULTSDIR="${OO_GNUSTEPDEFAULTSDIR:-${GAME_DATA}}" mkdir -p "$OO_GNUSTEPDEFAULTSDIR" -# OO_ADDITIONALADDONSDIRS can be used to pass a comma separated list of additional OXP folders - - -# Find the current system configuration file -ORIGINAL_CONF=$(gnustep-config --variable=GNUSTEP_CONFIG_FILE) - -# Fallback: If gnustep-config returns nothing, assume standard location -if [ -z "$ORIGINAL_CONF" ]; then - ORIGINAL_CONF="/etc/GNUstep/GNUstep.conf" -fi - -if [ -z "$ORIGINAL_CONF" ]; then - ORIGINAL_CONF="/usr/local/etc/GNUstep/GNUstep.conf" -fi - -TEMP_CONF=$(mktemp -t oolite_gnustep_XXXX --suffix=.conf) - -# Copy the original config to the temp file (if it exists) -if [ -f "$ORIGINAL_CONF" ]; then - cp "$ORIGINAL_CONF" "$TEMP_CONF" -else - echo "No system config found at $ORIGINAL_CONF. Starting with empty config." - touch "$TEMP_CONF" -fi - -echo "" >> "$TEMP_CONF" -echo "# --- Overrides added by launcher script ---" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_APPS=$OO_GNUSTEPDIR/Applications" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_ADMIN_APPS=$OO_GNUSTEPDIR/Applications/Admin" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_WEB_APPS=$OO_GNUSTEPDIR/WebApplications" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_TOOLS=$OO_GNUSTEPDIR/Tools" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_ADMIN_TOOLS=$OO_GNUSTEPDIR/Tools/Admin" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_LIBRARY=$OO_GNUSTEPDIR/Library" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_HEADERS=$OO_GNUSTEPDIR/Library/Headers" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_LIBRARIES=$OO_GNUSTEPDIR/Library/Libraries" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_DOC=$OO_GNUSTEPDIR/Library/Documentation" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_DOC_MAN=$OO_GNUSTEPDIR/Library/Documentation/man" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DIR_DOC_INFO=$OO_GNUSTEPDIR/Library/Documentation/info" >> "$TEMP_CONF" -echo "GNUSTEP_USER_DEFAULTS_DIR=$OO_GNUSTEPDEFAULTSDIR" >> "$TEMP_CONF" - -export GNUSTEP_CONFIG_FILE="$TEMP_CONF" - -find_exe_launch "$@" -rm "$TEMP_CONF" +echo "" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_CONFIG_FILE=$GNUSTEP_CONFIG_FILE" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_APPS=$OO_GNUSTEPDIR/Applications" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_ADMIN_APPS=$OO_GNUSTEPDIR/Applications/Admin" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_WEB_APPS=$OO_GNUSTEPDIR/WebApplications" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_TOOLS=$OO_GNUSTEPDIR/Tools" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_ADMIN_TOOLS=$OO_GNUSTEPDIR/Tools/Admin" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_LIBRARY=$OO_GNUSTEPDIR/Library" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_HEADERS=$OO_GNUSTEPDIR/Library/Headers" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_LIBRARIES=$OO_GNUSTEPDIR/Library/Libraries" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_DOC=$OO_GNUSTEPDIR/Library/Documentation" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_DOC_MAN=$OO_GNUSTEPDIR/Library/Documentation/man" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DIR_DOC_INFO=$OO_GNUSTEPDIR/Library/Documentation/info" >> "$GNUSTEP_CONFIG_FILE" +echo "GNUSTEP_USER_DEFAULTS_DIR=$OO_GNUSTEPDEFAULTSDIR" >> "$GNUSTEP_CONFIG_FILE" + +find_exedir +launch_guarded "$@" +rm "$GNUSTEP_CONFIG_FILE" diff --git a/ShellScripts/Linux/splash-launcher b/ShellScripts/Linux/splash-launcher new file mode 100755 index 000000000..e9cb473cb Binary files /dev/null and b/ShellScripts/Linux/splash-launcher differ diff --git a/ShellScripts/Windows/install_deps.sh b/ShellScripts/Windows/install_deps.sh index c4139adf9..c8987c6af 100755 --- a/ShellScripts/Windows/install_deps.sh +++ b/ShellScripts/Windows/install_deps.sh @@ -20,7 +20,7 @@ install() { # package file eg. mingw-w64-x86_64-libobjc2-2.3-3-any.pkg.tar.zst if [ -z "$filename" ]; then - echo "❌ No file matching $packagename found!" >&2 + echo "❌ No file matching $packagename found." >&2 return 1 fi diff --git a/ShellScripts/common/build_oolite.sh b/ShellScripts/common/build_oolite.sh index e6b229198..fc3e8490b 100755 --- a/ShellScripts/common/build_oolite.sh +++ b/ShellScripts/common/build_oolite.sh @@ -26,11 +26,12 @@ run_script() { source "$SHARE/GNUstep/Makefiles/GNUstep.sh" make -f Makefile clean - if ! make -f Makefile $TARGET -j$(nproc); then - echo "❌ Oolite build failed!" >&2 + if make -f Makefile $TARGET -j$(nproc); then + echo "✅ Oolite build completed successfully" + else + echo "❌ Oolite build failed" >&2 return 1 fi - echo "✅ Oolite build completed successfully" popd } diff --git a/ShellScripts/common/check_rename_fn.sh b/ShellScripts/common/check_rename_fn.sh deleted file mode 100644 index ae16f4669..000000000 --- a/ShellScripts/common/check_rename_fn.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -check_rename() { - # Checks file exists and optionally renames it - # First parameter is package name - # Second parameter is file pattern - # Third optional parameter is substring to replace in the filename - if [ -z "$3" ]; then - fullname=$1 - else - fullname="${1}_${3}" - fi - filename=$(ls $2 2>/dev/null) - if [ -z "$filename" ]; then - echo "❌ No file matching $2 found!" >&2 - return 1 - fi - if [ "$3" ]; then - newname="${filename/$1/$fullname}" - mv $filename $newname - filename=$newname - fi - - echo "${filename}" "${fullname}" -} diff --git a/ShellScripts/common/checkout_submodules.sh b/ShellScripts/common/checkout_submodules.sh index 2932d1584..5b1b1f814 100755 --- a/ShellScripts/common/checkout_submodules.sh +++ b/ShellScripts/common/checkout_submodules.sh @@ -5,7 +5,7 @@ run_script() { pushd "$SCRIPT_DIR" source ./checkout_submodules_fn.sh - cd ../.. + if ! checkout_submodules; then return 1 fi diff --git a/ShellScripts/common/get_version.sh b/ShellScripts/common/get_version.sh index e5ebf06eb..462bd02a8 100755 --- a/ShellScripts/common/get_version.sh +++ b/ShellScripts/common/get_version.sh @@ -1,7 +1,7 @@ #!/bin/bash SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd) -pushd "$SCRIPT_DIR" +pushd "$SCRIPT_DIR" > /dev/null mkdir -p ../../build cd ../../build @@ -13,24 +13,23 @@ VER_REV=$(echo "$VERSION" | cut -d. -f3) if [ "" == "$VER_REV" ]; then VER_REV="0" fi -VER_DATE=$(date +%y%m%d) +TIMESTAMP=$(git log -1 --format=%ct) +# Date conversions use UTC for consistency +# Convert to __DATE__ format (e.g., Feb 20 2026) +CPP_DATE=$(date -u -d "@$TIMESTAMP" +"%b %e %Y") +# Convert to YYYY-MM-DD +APP_DATE=$(date -u -d "@$TIMESTAMP" +"%Y-%m-%d") +# Convert to YYMMDD format (e.g., 260313) +VER_DATE=$(date -u -d "@$TIMESTAMP" +"%y%m%d") + VER_GITREV=$(git rev-list --count HEAD) VER_GITHASH=$(git rev-parse --short=7 HEAD) -VER="$VER_MAJ.$VER_MIN.$VER_REV.$VER_GITREV-$VER_DATE-$VER_GITHASH" +VER_FULL="$VER_MAJ.$VER_MIN.$VER_REV.$VER_GITREV-$VER_DATE-$VER_GITHASH" BUILDTIME=$(date "+%Y.%m.%d %H:%M") -echo "OOLITE_VERSION=$VER" >> OOLITE_VERSION.txt -cat OOLITE_VERSION.txt +echo "OOLITE_VERSION=$VER_FULL" > OOLITE_VERSION.txt -echo "VERSION=$VERSION" > version.mk -echo "VER_MAJ=$VER_MAJ" >> version.mk -echo "VER_MIN=$VER_MIN" >> version.mk -echo "VER_REV=$VER_REV" >> version.mk -echo "VER_DATE=$VER_DATE" >> version.mk -echo "VER_GITREV=$VER_GITREV" >> version.mk -echo "VER_GITHASH=$VER_GITHASH" >> version.mk -echo "VER=$VER" >> version.mk -echo "BUILDTIME=$BUILDTIME" >> version.mk +echo "$VER_FULL" -popd \ No newline at end of file +popd > /dev/null \ No newline at end of file diff --git a/ShellScripts/common/post_build.sh b/ShellScripts/common/post_build.sh index 2910e77cb..eca068dff 100755 --- a/ShellScripts/common/post_build.sh +++ b/ShellScripts/common/post_build.sh @@ -117,6 +117,7 @@ run_script() { else # Copy Linux-specific wrapper script cp -fu ShellScripts/Linux/run_oolite.sh "$PROGDIR" + cp -fu ShellScripts/Linux/splash-launcher "$PROGDIR" fi echo "✅ Oolite post-build completed successfully" diff --git a/installers/FreeDesktop/oolite-001.png b/installers/FreeDesktop/oolite-001.png new file mode 100644 index 000000000..49858464d Binary files /dev/null and b/installers/FreeDesktop/oolite-001.png differ diff --git a/installers/FreeDesktop/oolite-002.png b/installers/FreeDesktop/oolite-002.png new file mode 100644 index 000000000..ce6524840 Binary files /dev/null and b/installers/FreeDesktop/oolite-002.png differ diff --git a/installers/FreeDesktop/oolite-004.png b/installers/FreeDesktop/oolite-004.png new file mode 100644 index 000000000..879c33d88 Binary files /dev/null and b/installers/FreeDesktop/oolite-004.png differ diff --git a/installers/FreeDesktop/oolite-008.png b/installers/FreeDesktop/oolite-008.png new file mode 100644 index 000000000..128019b76 Binary files /dev/null and b/installers/FreeDesktop/oolite-008.png differ diff --git a/installers/FreeDesktop/oolite-064.png b/installers/FreeDesktop/oolite-064.png new file mode 100644 index 000000000..0c8659bce Binary files /dev/null and b/installers/FreeDesktop/oolite-064.png differ diff --git a/installers/FreeDesktop/oolite-999.png b/installers/FreeDesktop/oolite-999.png new file mode 100644 index 000000000..7651ec3a8 Binary files /dev/null and b/installers/FreeDesktop/oolite-999.png differ diff --git a/installers/FreeDesktop/oolite-icon.png b/installers/FreeDesktop/oolite-icon.png deleted file mode 100644 index f6923a260..000000000 Binary files a/installers/FreeDesktop/oolite-icon.png and /dev/null differ diff --git a/installers/FreeDesktop/oolite.desktop b/installers/FreeDesktop/space.oolite.Oolite.desktop similarity index 71% rename from installers/FreeDesktop/oolite.desktop rename to installers/FreeDesktop/space.oolite.Oolite.desktop index 839055243..a65e0cb19 100644 --- a/installers/FreeDesktop/oolite.desktop +++ b/installers/FreeDesktop/space.oolite.Oolite.desktop @@ -1,8 +1,8 @@ [Desktop Entry] -Name=Oolite +Name=oolite Comment=An OpenGL Elite-like space game -Exec=oolite -Icon=oolite-icon +Exec=run_oolite.sh +Icon=space.oolite.Oolite Terminal=false Type=Application Categories=Game;Simulation; diff --git a/installers/FreeDesktop/space.oolite.Oolite.metainfo.xml.template b/installers/FreeDesktop/space.oolite.Oolite.metainfo.xml.template new file mode 100644 index 000000000..8b8106da7 --- /dev/null +++ b/installers/FreeDesktop/space.oolite.Oolite.metainfo.xml.template @@ -0,0 +1,89 @@ + + + space.oolite.Oolite + + Oolite + Open-world space opera + + MIT + GPL-2.0-or-later + https://oolite.space + https://github.com/OoliteProject/oolite/issues + https://wiki.alioth.net/index.php/Contributing_to_the_project + https://github.com/OoliteProject/oolite + https://wiki.alioth.net/index.php/Oolite_FAQ + + + Giles Williams, Jens Ayton, and contributors + + + + #bbbbce + #1c1a2e + + + + moderate + mild + mild + + + +

+ Oolite is inspired by the 8-bit classic Elite, and many aspects of gameplay will be familiar to players of that game. In the tradition of open-world games, there's no overall story: you can be a millionaire trader, a veteran combateer, a feared pirate, a lonely miner, a notorious smuggler, or all of them, or something else entirely, based on your own actions. +

+
+ + + keyboard + pointing + 768 + + + space.oolite.Oolite.desktop + + + + https://raw.githubusercontent.com/OoliteProject/oolite/1.92-maintenance/installers/FreeDesktop/oolite-999.png + The universe awaits. Go explore and seek your fortune! + + + https://raw.githubusercontent.com/OoliteProject/oolite/1.92-maintenance/installers/FreeDesktop/oolite-008.png + Choose from a diverse range of interstellar craft. + + + https://raw.githubusercontent.com/OoliteProject/oolite/1.92-maintenance/installers/FreeDesktop/oolite-064.png + Find safety in massive orbital stations. + + + https://raw.githubusercontent.com/OoliteProject/oolite/1.92-maintenance/installers/FreeDesktop/oolite-001.png + Access the expansion pack manager and quick reference guides on the start screen. + + + https://raw.githubusercontent.com/OoliteProject/oolite/1.92-maintenance/installers/FreeDesktop/oolite-002.png + Learn to fly with the tutorial covering piloting, combat, and travel. + + + https://raw.githubusercontent.com/OoliteProject/oolite/1.92-maintenance/installers/FreeDesktop/oolite-004.png + Fly to Maraus, a wealthy industrial world, one of 2000 systems to be discovered. + + + + + + +

This stable release fixes these bugs:

+
    +
  • Centre main window after showing splash.
  • +
  • Smooth resizing of game window.
  • +
  • Fix for crash when no network.
  • +
+
+
+ + +

First release of Oolite for Flatpak and AppImage.

+
+
+
+
diff --git a/installers/appimage/create_appimage.sh b/installers/appimage/create_appimage.sh index 7157638a0..3bae45325 100755 --- a/installers/appimage/create_appimage.sh +++ b/installers/appimage/create_appimage.sh @@ -9,38 +9,53 @@ run_script() { cd ../../build source ../ShellScripts/Linux/os_detection.sh source ../ShellScripts/common/get_version.sh - source ../ShellScripts/common/check_rename_fn.sh + source ../ShellScripts/Linux/install_freedesktop_fn.sh - APPDIR="./Oolite.AppDir" - rm -rf $APPDIR - mkdir -p $APPDIR/usr/bin + ARCH=$(uname -m) + APPDIR="./oolite.AppDir" + APPBIN="$APPDIR/usr/bin" + APPSHR="$APPDIR/usr/share" + rm -rf "$APPDIR" - PROGDIR="../oolite.app" - cp -rf $PROGDIR/Resources $APPDIR/usr/bin + ABS_APPDIR_USR=$(realpath -m "$APPDIR/usr") + if ! install_freedesktop "$ABS_APPDIR_USR" appdata; then + return 1 + fi + + if (( $# == 1 )); then + echo "Including Basic-debug.oxp" + cp -rf AddOns "$APPBIN" + fi - if ! curl -o linuxdeploy -L https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage; then - echo "❌ linuxdeploy download failed!" >&2 - return 1 + LINUXDEPLOY_BIN="./linuxdeploy" + if [ ! -x "$LINUXDEPLOY_BIN" ]; then + echo "📥 linuxdeploy not found or not executable. Downloading..." + curl -o "$LINUXDEPLOY_BIN" -L https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage || { echo "❌ Download failed" >&2; exit 1; } + chmod +x "$LINUXDEPLOY_BIN" fi - chmod +x linuxdeploy case "$CURRENT_DISTRO" in - debian) SDL2="--library=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0" ;; + debian) SDL2="--library=/usr/lib/$ARCH-linux-gnu/libSDL2-2.0.so.0" ;; redhat) SDL2="--library=/usr/lib64/libSDL2-2.0.so.0 --library=/usr/lib64/libSDL3.so.0" ;; arch) SDL2="--library=/usr/lib/libSDL2-2.0.so.0 --library=/usr/lib/libSDL3.so.0" ;; esac + ICON_SUBPATH="icons/hicolor/256x256/apps/space.oolite.Oolite.png" + ICON_PATH="$APPSHR/$ICON_SUBPATH" echo "Building AppDir for AppImage..." + # install_metadatainfo_fn already put the files in the parameters below in the right place, + # but no harm putting again here if ! NO_STRIP=1 ./linuxdeploy \ - --appdir $APPDIR \ - --executable $PROGDIR/oolite \ - --custom-apprun $PROGDIR/run_oolite.sh \ - --desktop-file ../installers/FreeDesktop/oolite.desktop \ - --icon-file ../installers/FreeDesktop/oolite-icon.png \ + --appdir "$APPDIR" \ + --executable "$APPBIN/oolite" \ + --custom-apprun "$APPBIN/run_oolite.sh" \ + --desktop-file "$APPSHR/applications/space.oolite.Oolite.desktop" \ + --icon-file "$ICON_PATH" \ $SDL2; then echo "❌ AppDir generation failed!" >&2 return 1 fi + ln -sf "usr/share/$ICON_SUBPATH" "$APPDIR/.DirIcon" if [[ $1 == "dev" ]]; then echo "Not stripping libs for snapshot AppImage" @@ -51,26 +66,38 @@ run_script() { -exec strip --strip-unneeded '{}' + # keeps symbols needed for runtime linking fi - if ! curl -o appimagetool -L https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage; then - echo "❌ appimagetool download failed!" >&2 - return 1 - fi + LINTER_BIN="./appdir-lint.sh" + EXCLUDE_LIST="./excludelist" - chmod +x appimagetool + if [ ! -x "$LINTER_BIN" ] || [ ! -f "$EXCLUDE_LIST" ]; then + echo "📥 Downloading AppDir linter and excludelist..." + curl -o "$LINTER_BIN" -L https://raw.githubusercontent.com/AppImage/AppImages/master/appdir-lint.sh || { echo "❌ Linter download failed" >&2; exit 1; } + curl -o "$EXCLUDE_LIST" -L https://raw.githubusercontent.com/AppImage/AppImages/master/excludelist || { echo "❌ Excludelist download failed" >&2; exit 1; } + chmod +x "$LINTER_BIN" + fi - echo "Creating AppImage..." - if ! ./appimagetool $APPDIR; then - echo "❌ AppImage creation failed!" >&2 + echo "🔍 Running AppDir linter..." + if ! "$LINTER_BIN" "$APPDIR"; then + echo "❌ AppDir linting failed!" >&2 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 + if (( $# == 1 )); then - SUFFIX="${1}_${VER}" + SUFFIX="_${1}-${VER_FULL}" else - SUFFIX="$VER" + SUFFIX="-$VER_FULL" fi - - if ! check_rename "Oolite" "Oolite-*" $SUFFIX; then + FILENAME="oolite${SUFFIX}-${ARCH}.AppImage" + echo "Creating AppImage $FILENAME..." + if ! ./appimagetool "$APPDIR" "$FILENAME"; then + echo "❌ AppImage creation failed!" >&2 return 1 fi diff --git a/installers/flatpak/create_flatpak.sh b/installers/flatpak/create_flatpak.sh index 53005335f..446f663cf 100755 --- a/installers/flatpak/create_flatpak.sh +++ b/installers/flatpak/create_flatpak.sh @@ -10,7 +10,6 @@ run_script() { rm -rf oolite.app rm -rf obj.spk source ShellScripts/common/get_version.sh - source ShellScripts/common/check_rename_fn.sh source ShellScripts/common/checkout_submodules_fn.sh if ! checkout_submodules; then @@ -59,8 +58,6 @@ run_script() { return 1 fi - sed -i "/- name: oolite/a \ build-options:\n env:\n VERSION_OVERRIDE: \"$VER\"" \ - $MANIFEST TOTAL_LINES=$(wc -l < $MANIFEST) START_LINE=$((TOTAL_LINES - 3)) sed -i "${START_LINE},\$d" $MANIFEST @@ -80,23 +77,22 @@ EOF return 1 fi + if (( $# == 1 )); then + SUFFIX="_${1}-${VER_FULL}" + else + SUFFIX="-$VER_FULL" + fi + ARCH=$(uname -m) + FILENAME="space.oolite.Oolite${SUFFIX}-${ARCH}.flatpak" + echo "Creating Flatpak $FILENAME..." if ! flatpak build-bundle \ repo \ - space.oolite.Oolite.flatpak \ + "$FILENAME" \ space.oolite.Oolite; then echo "❌ Flatpak bundle creation failed!" >&2 return 1 fi - if (( $# == 1 )); then - SUFFIX="${1}_${VER}" - else - SUFFIX="$VER" - fi - - if ! check_rename "space.oolite.Oolite" "space.oolite.Oolite.flatpak" $SUFFIX; then - return 1 - fi popd } diff --git a/installers/flatpak/flatpak_build.sh b/installers/flatpak/flatpak_build.sh new file mode 100755 index 000000000..97f3148c6 --- /dev/null +++ b/installers/flatpak/flatpak_build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +source /app/share/GNUstep/Makefiles/GNUstep.sh +source ShellScripts/common/get_version.sh +source ShellScripts/Linux/install_freedesktop_fn.sh + +export ADDITIONAL_CFLAGS="-DBUILD_DATE='\"$CPP_DATE\"'" +export ADDITIONAL_OBJCFLAGS="-DBUILD_DATE='\"$CPP_DATE\"'" +make -f Makefile release-deployment -j$FLATPAK_BUILDER_N_JOBS + +install_freedesktop /app metainfo diff --git a/installers/flatpak/flatpak_postbuild.sh b/installers/flatpak/flatpak_postbuild.sh deleted file mode 100755 index 0ba81167f..000000000 --- a/installers/flatpak/flatpak_postbuild.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -cp -r oolite.app/* /app/bin - -if [[ -z "$VERSION_OVERRIDE" ]]; then - source ShellScripts/common/get_version.sh - FLATPAK_VERSION="$VERSION" -else - FLATPAK_VERSION="$VERSION_OVERRIDE" -fi - -FLATPAK_METAINFO=/app/share/metainfo/space.oolite.Oolite.metainfo.xml -install -D installers/flatpak/space.oolite.Oolite.metainfo.xml $FLATPAK_METAINFO -sed -i "//a \\ " $FLATPAK_METAINFO - -FLATPAK_DESKTOP=/app/share/applications/space.oolite.Oolite.desktop -install -D installers/FreeDesktop/oolite.desktop $FLATPAK_DESKTOP -desktop-file-edit --set-key=Exec --set-value=run_oolite.sh $FLATPAK_DESKTOP -desktop-file-edit --set-key=Icon --set-value=space.oolite.Oolite $FLATPAK_DESKTOP - -install -D Oolite-logo3.png /app/share/icons/hicolor/256x256/apps/space.oolite.Oolite.png diff --git a/installers/flatpak/space.oolite.Oolite.metainfo.xml b/installers/flatpak/space.oolite.Oolite.metainfo.xml deleted file mode 100644 index 2a8f586f5..000000000 --- a/installers/flatpak/space.oolite.Oolite.metainfo.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - space.oolite.Oolite - - Oolite - Open-world space opera - - MIT - GPL-2.0-or-later - https://oolite.space - https://github.com/OoliteProject/oolite/issues - https://wiki.alioth.net/index.php/Contributing_to_the_project - https://github.com/OoliteProject/oolite - https://wiki.alioth.net/index.php/Oolite_FAQ - - - Giles Williams, Jens Ayton, and contributors - - - - #000032 - #000032 - - - - moderate - mild - mild - - - -

- Oolite is inspired by the 8-bit classic Elite, and many aspects of gameplay will be familiar to players of that game. In the tradition of open-world games, there's no overall story: you can be a millionaire trader, a veteran combateer, a feared pirate, a lonely miner, a notorious smuggler, or all of them, or something else entirely, based on your own actions. -

-
- - - keyboard - pointing - 768 - - - space.oolite.Oolite.desktop - - - https://addons.oolite.space/i/gallery/basic/large/Station.png - Orbital stations provide facilities and protection to pilots. - - - https://addons.oolite.space/i/gallery/basic/large/Tutorial.png - A tutorial introduces the basics of piloting, combat, and travel. - - - https://addons.oolite.space/i/gallery/basic/large/Main.png - Oolite's start screen includes an expansion pack manager and quick reference guides. - - - https://addons.oolite.space/i/gallery/basic/large/Contracts.png - A route finder allows long journeys to be planned - great for transport contracts. - - - https://addons.oolite.space/i/gallery/basic/large/Equipment.png - A wide range of equipment is available to increase your chances of survival. - - - - - -
diff --git a/installers/flatpak/space.oolite.Oolite.yaml b/installers/flatpak/space.oolite.Oolite.yaml index f4e3d39df..7bf712565 100644 --- a/installers/flatpak/space.oolite.Oolite.yaml +++ b/installers/flatpak/space.oolite.Oolite.yaml @@ -59,7 +59,7 @@ modules: sources: - type: git url: https://github.com/gnustep/libobjc2.git - commit: e5c06e3be8895007bcc7be58cbeccac2a5a89eff + commit: 62e3a80b8e93818c2ac3250beab211c4d294cc87 - name: gnustep-make build-options: env: @@ -69,9 +69,9 @@ modules: - --with-library-combo=ng-gnu-gnu - --with-runtime-abi=gnustep-2.2 sources: - - type: archive - url: "https://github.com/gnustep/tools-make/releases/download/make-2_9_3/gnustep-make-2.9.3.tar.gz" - sha256: "93ca320b706279ebca53760da89d4c3f2bbc547f4723967140a34346d9f04c24" + - type: git + url: https://github.com/gnustep/tools-make.git + commit: 50cf9619e672fb2ff6825f239b5a172c5dc55630 - name: gnustep-base build-options: env: @@ -80,23 +80,16 @@ modules: sources: - type: git url: https://github.com/gnustep/libs-base.git - commit: 2b236ec2c4816e7ff482f07dc973b655a3780122 + commit: caa0816846937a0ad4724eba12cd0d69786b2e54 - name: oolite buildsystem: simple build-commands: - - | - source /app/share/GNUstep/Makefiles/GNUstep.sh - make -f Makefile release-deployment -j$FLATPAK_BUILDER_N_JOBS - source installers/flatpak/flatpak_postbuild.sh + - source installers/flatpak/flatpak_build.sh sources: - - type: file - url: https://wiki.alioth.net/img_auth.php/a/a2/Oolite-logo3.png - sha256: e1d13be05d665480d034ff5f824ab5463463f16dd411de25f870522e3d3e45b1 - dest-filename: Oolite-logo3.png # Update tag and commit for FlatHub release. For CI and local builds, create_flatpak.sh replaces git source with: # - type: dir # path: ../ - type: git url: https://github.com/OoliteProject/oolite.git - tag: "1.92.0.3" - commit: d2a705b05f667e9aa4d18478ff9305dac9183a9a + tag: "1.92.1.0" + commit: dd117d31c2f0e756d478e64584120d3d5cbf64d8 diff --git a/installers/win32/OOlite.nsi b/installers/win32/OOlite.nsi index ec74d14b4..8bd1e6394 100644 --- a/installers/win32/OOlite.nsi +++ b/installers/win32/OOlite.nsi @@ -133,7 +133,7 @@ SectionEnd Section "Basic-debug.OXP" ooDebugOXP ; Do not use any of the Debug OXP files when we are building Deployment SetOutPath $INSTDIR -File /r "..\..\AddOns" +File /r "..\..\build\AddOns" SectionEnd ; Below are the descriptions of the two component sections diff --git a/installers/win32/create_nsis.sh b/installers/win32/create_nsis.sh index e26fae6c0..0de73fd23 100644 --- a/installers/win32/create_nsis.sh +++ b/installers/win32/create_nsis.sh @@ -41,7 +41,7 @@ run_script() { echo "!define VER_REV ${VER_REV}" >> OoliteVersions.nsh echo "!define VER_GITREV ${VER_GITREV}" >> OoliteVersions.nsh echo "!define VER_GITHASH ${VER_GITHASH}" >> OoliteVersions.nsh - echo "!define VERSION ${VER}" >> OoliteVersions.nsh + echo "!define VERSION ${VER_FULL}" >> OoliteVersions.nsh echo "!define BUILDTIME \"${BUILDTIME}\"" >> OoliteVersions.nsh echo "!define BUILDHOST_IS64BIT 1" >> OoliteVersions.nsh diff --git a/src/Core/OOOXZManager.m b/src/Core/OOOXZManager.m index d90b2bf00..ce0ba98c7 100644 --- a/src/Core/OOOXZManager.m +++ b/src/Core/OOOXZManager.m @@ -114,7 +114,6 @@ OXZ_GUI_ROW_EXIT = 27 }; - NSComparisonResult oxzSort(id m1, id m2, void *context); static OOOXZManager *sSingleton = nil; @@ -624,7 +623,6 @@ - (void) setProgressStatus:(NSString *)new - (BOOL) updateManifests { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[self dataURL]]]; - [request setHTTPShouldHandleCookies:NO]; if (_downloadStatus != OXZ_DOWNLOAD_NONE) { return NO; @@ -641,6 +639,7 @@ - (BOOL) beginDownload:(NSMutableURLRequest *)request { NSString *userAgent = [NSString stringWithFormat:@"Oolite/%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]; [request setValue:userAgent forHTTPHeaderField:@"User-Agent"]; + [request setHTTPShouldHandleCookies:NO]; NSURLConnection *download = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if (download) { @@ -1232,7 +1231,14 @@ - (void) gui case OXZ_STATE_INSTALLING: [gui setTitle:DESC(@"oolite-oxzmanager-title-downloading")]; - [gui addLongText:[NSString stringWithFormat:DESC(@"oolite-oxzmanager-progress-@-is-@-of-@"),_currentDownloadName,[self humanSize:_downloadProgress],[self humanSize:_downloadExpected]] startingAtRow:OXZ_GUI_ROW_PROGRESS align:GUI_ALIGN_LEFT]; + if (_downloadStatus == OXZ_DOWNLOAD_ERROR) + { + [gui addLongText:OOExpandKey(@"oolite-oxzmanager-progress-error") startingAtRow:OXZ_GUI_ROW_PROGRESS align:GUI_ALIGN_LEFT]; + } + else + { + [gui addLongText:[NSString stringWithFormat:DESC(@"oolite-oxzmanager-progress-@-is-@-of-@"),_currentDownloadName,[self humanSize:_downloadProgress],[self humanSize:_downloadExpected]] startingAtRow:OXZ_GUI_ROW_PROGRESS align:GUI_ALIGN_LEFT]; + } [gui addLongText:_progressStatus startingAtRow:OXZ_GUI_ROW_PROGRESS+2 align:GUI_ALIGN_LEFT]; @@ -1710,7 +1716,6 @@ - (BOOL) installOXZ:(NSUInteger)item return NO; } NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; - [request setHTTPShouldHandleCookies:NO]; if (_downloadStatus != OXZ_DOWNLOAD_NONE) { return NO; diff --git a/src/SDL/MyOpenGLView.m b/src/SDL/MyOpenGLView.m index 1df5c31dd..caad4df18 100644 --- a/src/SDL/MyOpenGLView.m +++ b/src/SDL/MyOpenGLView.m @@ -248,7 +248,12 @@ - (id) init NSString *versionString = [NSString stringWithFormat:@"Oolite v%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]; strcpy (windowCaption, [versionString UTF8String]); - strcat (windowCaption, " - "__DATE__); + strcat(windowCaption, " - "); +#ifdef BUILD_DATE + strcat(windowCaption, BUILD_DATE); +#else + strcat(windowCaption, __DATE__); +#endif SDL_WM_SetCaption (windowCaption, "Oolite"); // Set window title. #if OOLITE_WINDOWS @@ -710,9 +715,12 @@ - (void) toggleScreenMode #endif } else + { [self initialiseGLWithSize: currentWindowSize]; - - +#if OOLITE_LINUX + SDL_WM_GrabInput(SDL_GRAB_OFF); +#endif + } // do screen resizing updates if ([PlayerEntity sharedPlayer]) { @@ -2125,6 +2133,10 @@ - (void)pollControls NSTimeInterval timeNow = [NSDate timeIntervalSinceReferenceDate]; Uint16 key_id; int scan_code; +#if OOLITE_LINUX + NSSize newSize; + bool resize_pending = false; +#endif while (SDL_PollEvent(&event)) { @@ -2540,8 +2552,8 @@ reset the virtual joystick (mouse) coordinates, we need to send a WarpMouse call case SDL_VIDEORESIZE: { SDL_ResizeEvent *rsevt=(SDL_ResizeEvent *)&event; - NSSize newSize=NSMakeSize(rsevt->w, rsevt->h); #if OOLITE_WINDOWS + NSSize newSize=NSMakeSize(rsevt->w, rsevt->h); if (!fullScreen && updateContext) { if (saveSize == NO) @@ -2557,8 +2569,8 @@ reset the virtual joystick (mouse) coordinates, we need to send a WarpMouse call } } #else - [self initialiseGLWithSize: newSize]; - [self saveWindowSize: newSize]; + newSize=NSMakeSize(rsevt->w, rsevt->h); + resize_pending = true; #endif // certain gui screens will require an immediate redraw after // a resize event - Nikos 20140129 @@ -2722,6 +2734,14 @@ detect that our (fullscreen) window has moved, we immediately bring it back to i { _mouseWheelDelta = 0.0f; } +#if OOLITE_LINUX + if (resize_pending) + { + [self initialiseGLWithSize: newSize]; + [self saveWindowSize: newSize]; + resize_pending = false; + } +#endif }