Skip to content
Merged
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
20 changes: 7 additions & 13 deletions .github/workflows/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ jobs:
# This must run before the checkout action if the action tries to do git commands
mkdir -p "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cat << EOF >> ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
- name: Checkout Oolite
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install packages
run: |
ShellScripts/Linux/install_packages_root.sh
ShellScripts/Linux/install_packages_root.sh --core+appimage
- name: Build GNUstep
run: |
ShellScripts/Linux/build_gnustep.sh system
Expand Down Expand Up @@ -83,10 +81,8 @@ jobs:
# This must run before the checkout action if the action tries to do git commands
mkdir -p "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cat << EOF >> ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
- name: Checkout Oolite
uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -137,10 +133,8 @@ jobs:
msystem: UCRT64
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cat << EOF > ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
cp ~/.curlrc /c/Users/runneradmin/.curlrc 2>/dev/null || true
ShellScripts/Windows/install_deps.sh clang
- name: Build Oolite
Expand Down
30 changes: 11 additions & 19 deletions .github/workflows/test_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ jobs:
# This must run before the checkout action if the action tries to do git commands
mkdir -p "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cat << EOF >> ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install packages
run: |
ShellScripts/Linux/install_packages_root.sh
ShellScripts/Linux/install_packages_root.sh --core+appimage
- name: Build GNUstep
run: |
ShellScripts/Linux/build_gnustep.sh system
Expand Down Expand Up @@ -78,16 +76,14 @@ jobs:
# This must run before the checkout action if the action tries to do git commands
mkdir -p "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cat << EOF >> ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install packages
run: |
ShellScripts/Linux/install_packages_root.sh
ShellScripts/Linux/install_packages_root.sh --core+appimage
- name: Build GNUstep
run: |
ShellScripts/Linux/build_gnustep.sh system
Expand Down Expand Up @@ -127,16 +123,14 @@ jobs:
# This must run before the checkout action if the action tries to do git commands
mkdir -p "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cat << EOF >> ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install packages
run: |
ShellScripts/Linux/install_packages_root.sh
ShellScripts/Linux/install_packages_root.sh --core+appimage
- name: Build GNUstep
run: |
ShellScripts/Linux/build_gnustep.sh system
Expand Down Expand Up @@ -182,10 +176,8 @@ jobs:
msystem: UCRT64
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cat << EOF > ~/.curlrc
header = "Authorization: Bearer $GITHUB_TOKEN"
header = "Accept: application/vnd.github+json"
EOF
echo 'header = "Authorization: Bearer '$GITHUB_TOKEN'"' >> ~/.curlrc
echo 'header = "Accept: application/vnd.github+json"' >> ~/.curlrc
cp ~/.curlrc /c/Users/runneradmin/.curlrc 2>/dev/null || true
ShellScripts/Windows/install_deps.sh clang

Expand Down
16 changes: 9 additions & 7 deletions ShellScripts/Linux/install_gitversion_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ install_gitversion() {
fi

local script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
pushd "$script_dir"

source ../common/download_github_release_fn.sh
source "$script_dir/../common/download_github_release_fn.sh"

local gitversion_tgz
download_github_release gitversion_tgz "GitTools" "GitVersion" "linux-x64" "$outputdir"
tar xfz ${gitversion_tgz} --directory "$outputdir"
if ! tar xfz ${gitversion_tgz} --directory "$outputdir"; then
echo "❌ Could not unpack gitversion tgz!" >&2
return 1
fi
chmod +x "$outputdir/gitversion"
mv "$outputdir/gitversion" /usr/local/bin/gitversion
if ! mv "$outputdir/gitversion" /usr/local/bin/gitversion; then
echo "❌ Could not move gitversion to /usr/local/bin!" >&2
return 1
fi
rm -f ${gitversion_tgz}

popd
}
2 changes: 1 addition & 1 deletion ShellScripts/Linux/install_package_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ install_package() {

"appimage")
case "$CURRENT_DISTRO" in
debian) pkg_name="file fuse3 patchelf" ;;
debian) pkg_name="file fuse3 patchelf desktop-file-utils" ;;
redhat) pkg_name="file fuse3 desktop-file-utils patchelf which zsync" ;;
arch) pkg_name="file fuse3 desktop-file-utils patchelf zsync" ;;
esac ;;
Expand Down
179 changes: 93 additions & 86 deletions ShellScripts/Linux/install_packages_root.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash
#!/bin/bash -e

# This script must be run as root (for example with sudo).
set -e


run_script() {
# If current user ID is NOT 0 (root)
Expand All @@ -11,99 +9,108 @@ run_script() {
return 1
fi

local script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
pushd "$script_dir"

source install_gitversion_fn.sh
source install_package_fn.sh
# Initialize local flags with defaults
local INSTALL_CORE=true
local INSTALL_APPIMAGE=false
local INSTALL_FLATPAK=false
local SCRIPT_DIR
local pkgs
local pkg
local LIB_PARAM
local BIN
local LINTER_BIN
local EXCLUDE_LIST

if ! install_package procps; then
return 1
fi
if ! install_package base-devel; then
return 1
fi
if ! install_package clang; then
return 1
# Parse Command Line Arguments
if [[ "$#" -gt 0 ]]; then
INSTALL_CORE=false
fi
if ! install_package cmake; then
return 1
fi
if ! install_package jq; then
return 1
fi
if ! install_package meson; then
return 1
fi
if ! install_package gnutls-dev; then
return 1

while [[ "$#" -gt 0 ]]; do
case $1 in
--appimage) INSTALL_APPIMAGE=true ;;
--flatpak) INSTALL_FLATPAK=true ;;
--core) INSTALL_CORE=true ;;
--core+appimage|--core-appimage)
INSTALL_CORE=true
INSTALL_APPIMAGE=true
;;
--core+flatpak|--core-flatpak)
INSTALL_CORE=true
INSTALL_FLATPAK=true
;;
--all)
INSTALL_CORE=true
INSTALL_APPIMAGE=true
INSTALL_FLATPAK=true
;;
-h|--help)
echo "Usage: ./install_deps_root.sh [options]"
echo "Options:"
echo " --core Install only base build dependencies (default if no args)"
echo " --appimage Install only AppImage tools"
echo " --flatpak Install only Flatpak tools"
echo " --core+appimage Install base build dependencies + AppImage tools"
echo " --core+flatpak Install base build dependencies + Flatpak tools"
echo " --all Install everything"
exit 0
;;
*) echo "Unknown parameter: $1"; exit 1 ;;
esac
shift
done

if [[ "$INSTALL_CORE" == false && "$INSTALL_APPIMAGE" == false && "$INSTALL_FLATPAK" == false ]]; then
INSTALL_CORE=true
fi
# Check Python
if ! python3 --version >/dev/null 2>&1; then
if ! install_package python; then
return 1

local script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
pushd "$script_dir" > /dev/null

source ./install_package_fn.sh
source ../common/download_fn.sh
source ./install_gitversion_fn.sh

local outputdir="../../build"
mkdir -p "$outputdir"

if [[ "$INSTALL_CORE" == true ]]; then # Core dependencies
echo "📦 Installing Core Build Dependencies..."
pkgs=(
procps base-devel clang cmake jq meson gnutls-dev icu-dev ffi-dev xslt-dev png-dev zlib-dev nspr-dev
espeak-ng-dev vorbis-dev openal-dev opengl-dev glu-dev sdl3 x11-dev
)
for pkg in "${pkgs[@]}"; do
install_package "$pkg"
done
if ! python3 --version >/dev/null 2>&1; then # Check Python
install_package python
fi
fi
if ! install_package icu-dev; then
return 1
fi
if ! install_package ffi-dev; then
return 1
fi
if ! install_package xslt-dev; then
return 1
fi
if ! install_package png-dev; then
return 1
fi
if ! install_package zlib-dev; then
return 1
fi
if ! install_package nspr-dev; then
return 1
fi
if ! install_package espeak-ng-dev; then
return 1
fi
if [ ! -d /usr/share/espeak-ng-data ]; then
if [ ! -d /usr/local/share/espeak-ng-data ]; then
if [ ! -d /usr/lib/x86_64-linux-gnu/espeak-ng-data ]; then
echo "❌ espeak-ng-data not in /usr/share, /usr/local/share or /usr/lib/x86_64-linux-gnu!"
return 1
install_gitversion "$outputdir"
if [ ! -d /usr/share/espeak-ng-data ]; then
if [ ! -d /usr/local/share/espeak-ng-data ]; then
if [ ! -d /usr/lib/x86_64-linux-gnu/espeak-ng-data ]; then
echo "❌ espeak-ng-data not in /usr/share, /usr/local/share or /usr/lib/x86_64-linux-gnu!"
return 1
fi
fi
fi
fi
if ! install_package vorbis-dev; then
return 1
fi
if ! install_package openal-dev; then
return 1
fi
if ! install_package opengl-dev; then
return 1
fi
if ! install_package glu-dev; then
return 1
fi
if ! install_package sdl3; then
return 1
fi
if ! install_package x11-dev; then
return 1
fi
# For building AppImage
if ! install_package appimage; then
return 1

if [[ "$INSTALL_APPIMAGE" == true ]]; then # For building AppImage
echo "📦 Installing AppImage Tools..."
install_package appimage
BIN="/usr/local/bin"
download "https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh" "$BIN" "+x"
download "https://raw.githubusercontent.com/AppImage/AppImages/master/appdir-lint.sh" "$BIN" "+x"
download "https://raw.githubusercontent.com/AppImage/AppImages/master/excludelist" "$BIN"
download "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage" "$BIN" "+x"
fi
# For building Flatpak
if ! install_package flatpak; then
return 1

if [[ "$INSTALL_FLATPAK" == true ]]; then # For building Flatpak
install_package flatpak
fi

# install gitversion
local outputdir="../../build"
mkdir -p "$outputdir"
install_gitversion "$outputdir"
popd
}

Expand Down
25 changes: 4 additions & 21 deletions ShellScripts/Windows/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

# No parameters: build clang only
# One parameter gcc = build gcc only
Expand Down Expand Up @@ -33,31 +33,14 @@ install() {

run_script() {
local script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
source "$script_dir/../common/download_github_release_fn.sh"
pushd "$script_dir"

source ../common/download_github_release_fn.sh

local oolite_deps_url="https://api.github.com/repos/OoliteProject/oolite_windeps_build/releases/latest"

pacman -Syu --noconfirm
pacman -S git --noconfirm
pacman -S dos2unix --noconfirm
pacman -S pactoys --noconfirm
pacboy -S binutils --noconfirm
pacboy -S jq --noconfirm
pacman -S unzip --noconfirm
pacboy -S python-pip --noconfirm
pacboy -S meson --noconfirm
pacboy -S ninja --noconfirm
pacboy -S nsis --noconfirm
pacboy -S libpng --noconfirm
pacboy -S openal --noconfirm
pacboy -S libvorbis --noconfirm
pacboy -S pcaudiolib --noconfirm
pacboy -S espeak-ng --noconfirm
pacboy -S mesa --noconfirm
pacboy -S sdl3 --noconfirm

pacman -S --noconfirm dos2unix git pactoys unzip
pacboy -S --noconfirm binutils espeak-ng jq libpng libvorbis mesa meson ninja nsis openal pcaudiolib python-pip sdl3
mkdir -p ../../build/packages
cd ../../build
# install gitversion
Expand Down
Loading