Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
36 changes: 12 additions & 24 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
37 changes: 37 additions & 0 deletions ShellScripts/Linux/GNUstep.conf.template
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ShellScripts/Linux/checkout_deps_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 1 addition & 5 deletions ShellScripts/Linux/install_deps_root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,7 +113,6 @@ run_script() {
cd tools-make
make clean

# Bash
if [[ ${CURRENT_DISTRO,,} == "redhat" ]]; then
LIB_PARAM="--with-libdir=lib64"
else
Expand Down
44 changes: 44 additions & 0 deletions ShellScripts/Linux/install_freedesktop_fn.sh
Original file line number Diff line number Diff line change
@@ -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
}
13 changes: 8 additions & 5 deletions ShellScripts/Linux/install_package_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)..."
Expand Down
4 changes: 2 additions & 2 deletions ShellScripts/Linux/os_detection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
Loading
Loading