Skip to content
Open
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
4 changes: 2 additions & 2 deletions Documentation/build_documentation.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

rm -rf ../build/documentation
source ./build_doxygen_fn.sh
Expand Down
4 changes: 2 additions & 2 deletions Documentation/build_doxygen.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

rm -rf ../build/documentation
source ./build_doxygen_fn.sh
Expand Down
4 changes: 2 additions & 2 deletions Documentation/build_doxygen_fn.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

PKG_OK=$(command -v doxygen)
if [ "" = "$PKG_OK" ]; then
Expand Down
4 changes: 2 additions & 2 deletions Documentation/build_referencesheet.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

source ./build_referencesheet_fn.sh

Expand Down
4 changes: 2 additions & 2 deletions Documentation/build_referencesheet_fn.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

PKG_OK=$(command -v soffice)
if [ "" = "$PKG_OK" ]; then
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ help: ## Show this help message
define meson_build
meson setup build/meson_$(2) $(1) --native-file $(NATIVE_FILE) --reconfigure 2>/dev/null || meson setup build/meson_$(2) $(1) --native-file $(NATIVE_FILE)
meson compile -C build/meson_$(2)
meson install -C build/meson_$(2)
endef

# Helper macro for syncing OXP files cleanly
Expand Down
10 changes: 5 additions & 5 deletions ShellScripts/Linux/build_gnustep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Parameter two: Escalate command (defaults to sudo for 'system').

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

echo "Building GNUStep libraries"

Expand Down Expand Up @@ -67,9 +67,9 @@ run_script() {
cd tools-make
make clean

local LIB_DIR="$TARGET/$LIB_SUBDIR"
local lib_dir="$TARGET/$LIB_SUBDIR"
export CPPFLAGS="-I$TARGET/include"
export LDFLAGS="-L$LIB_DIR"
export LDFLAGS="-L$lib_dir"

if ! ./configure --prefix="$TARGET" --with-library-combo=ng-gnu-gnu --with-runtime-abi=gnustep-2.2 "--with-libdir=$LIB_SUBDIR"; then
echo "❌ tools-make configure failed!" >&2
Expand All @@ -82,7 +82,7 @@ run_script() {
cd libs-base
make clean

export LD_LIBRARY_PATH="$LIB_DIR:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$lib_dir:$LD_LIBRARY_PATH"
source "$TARGET/share/GNUstep/Makefiles/GNUstep.sh"
if ! ./configure; then
echo "❌ libs-base configure failed!" >&2
Expand Down
4 changes: 2 additions & 2 deletions ShellScripts/Linux/dep_location_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ dep_location() {
local _escalate_cmd="${6:-sudo}"

# Get the directory where the script is located
local SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
local script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

source "$SCRIPT_DIR/os_detection.sh"
source "$script_dir/os_detection.sh"
cd ../../

# Logic for LIB_SUBDIR
Expand Down
40 changes: 21 additions & 19 deletions ShellScripts/Linux/install_freedesktop_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,53 @@ install_freedesktop() {

local err_msg="❌ Error: Failed to"

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

source ../common/get_version.sh

echo "Installing metainfo to to $2"

local APPBIN="$2/bin"
local APPSHR="$2/share"
local appbin="$2/bin"
local appshr="$2/share"

# Install binaries and scripts
install -D "$1/oolite" "$APPBIN/oolite" || { echo "$err_msg install oolite binary" >&2; return 1; }
install -D "$1/oolite" "$appbin/oolite" || { echo "$err_msg install oolite binary" >&2; return 1; }
if [[ -f "$1/oolite.debug" ]]; then
install -D "$1/oolite.debug" "$2/$3/oolite.debug" || { echo "$err_msg install oolite debug symbols" >&2; return 1; }
fi
install -D "$1/run_oolite.sh" "$APPBIN/run_oolite.sh" || { echo "$err_msg install run_oolite.sh" >&2; return 1; }
install -D "$1/run_oolite.sh" "$appbin/run_oolite.sh" || { echo "$err_msg install run_oolite.sh" >&2; return 1; }

# Resources copy
mkdir -p "$APPBIN/Resources"
cp -rf "$1/Resources/." "$APPBIN/Resources/" || { echo "$err_msg copy Resources folder" >&2; return 1; }
local resourcesdir="$appshr/oolite/Resources"
mkdir -p "$resourcesdir"
cp -rf "$1/Resources/." "$resourcesdir/" || { echo "$err_msg copy Resources folder" >&2; return 1; }

# AddOns copy if folder exists in oolite.app
if [ -d "$1/AddOns" ]; then
mkdir -p "$APPBIN/AddOns"
cp -rf "$1/AddOns/." "$APPBIN/AddOns/" || { echo "$err_msg copy AddOns folder" >&2; return 1; }
local addonsdir="$appshr/oolite/AddOns"
mkdir -p "$addonsdir"
cp -rf "$1/AddOns/." "$addonsdir/" || { echo "$err_msg copy AddOns folder" >&2; return 1; }
fi

rm -f "$APPBIN/Resources/GNUstep.conf.orig"
install -D "GNUstep.conf.template" "$APPBIN/Resources/GNUstep.conf.template" || { echo "$err_msg GNUstep template" >&2; return 1; }
rm -f "$resourcesdir/GNUstep.conf.orig"
install -D "GNUstep.conf.template" "$resourcesdir/GNUstep.conf.template" || { echo "$err_msg GNUstep template" >&2; return 1; }

APP_METAINFO="$APPSHR/metainfo/space.oolite.Oolite.$4.xml"
install -D ../../installers/FreeDesktop/space.oolite.Oolite.metainfo.xml.template "$APP_METAINFO" || { echo "$err_msg metainfo template" >&2; return 1; }
local app_metainfo="$appshr/metainfo/space.oolite.Oolite.$4.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"
sed -i "s/@VER@/${VERSION}/g" "$app_metainfo"
sed -i "s/@DATE@/${APP_DATE}/g" "$app_metainfo"

echo ===========================================
echo Our manifest looks like this:
cat "$APP_METAINFO"
cat "$app_metainfo"
echo ===========================================

# 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 ../../installers/FreeDesktop/space.oolite.Oolite.desktop "$appshr/applications/space.oolite.Oolite.desktop" || { echo "$err_msg desktop file" >&2; return 1; }

install -D "$1/Resources/Textures/oolite-logo1.png" "$APPSHR/icons/hicolor/256x256/apps/space.oolite.Oolite.png" || { echo "$err_msg icon file" >&2; return 1; }
install -D "$1/Resources/Textures/oolite-logo1.png" "$appshr/icons/hicolor/256x256/apps/space.oolite.Oolite.png" || { echo "$err_msg icon file" >&2; return 1; }

popd
}
18 changes: 9 additions & 9 deletions ShellScripts/Linux/install_mozilla_js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@

run_script() {
# Get the directory where the script is located
local SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
local script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

source "$SCRIPT_DIR/dep_location_fn.sh"
source "$script_dir/dep_location_fn.sh"
dep_location LIB_SUBDIR TARGET ESCALATE "mozilla_js" $1 $2

# The URL to your specific GitHub release asset
local RELEASE_URL="https://github.com/OoliteProject/mozillajs-linux/releases/download/0.0.1/mozilla-js-static-lib.tar.gz"
local release_url="https://github.com/OoliteProject/mozillajs-linux/releases/download/0.0.1/mozilla-js-static-lib.tar.gz"

echo "Installing Mozilla JS static library to $TARGET"
[[ -n "$ESCALATE" ]] && echo "Using escalation: $ESCALATE"

# Download and extract
# Curl downloads as current user, Tar extracts using escalation

local TEMP_STAGING=$(mktemp -d)
trap 'rm -rf "$TEMP_STAGING"' EXIT
local temp_staging=$(mktemp -d)
trap 'rm -rf "$temp_staging"' EXIT

if ! curl -L "$RELEASE_URL" | tar -xz -C "$TEMP_STAGING"; then
if ! curl -L "$release_url" | tar -xz -C "$temp_staging"; then
echo "❌ Mozilla JS library download or extract failed!" >&2
return 1
fi

if ! [[ -d "$TEMP_STAGING/include" ]]; then
if ! [[ -d "$temp_staging/include" ]]; then
echo "❌ Mozilla JS library extract empty!" >&2
return 1
fi

# Move headers to include
if ! $ESCALATE cp -r "$TEMP_STAGING/include/"* "$TARGET/include/"; then
if ! $ESCALATE cp -r "$temp_staging/include/"* "$TARGET/include/"; then
echo "❌ Mozilla JS library header install failed!" >&2
return 1
fi
# Move libs from 'lib' in tarball to 'lib64' on system
if ! $ESCALATE cp -r "$TEMP_STAGING/lib/"* "$TARGET/$LIB_SUBDIR/"; then
if ! $ESCALATE cp -r "$temp_staging/lib/"* "$TARGET/$LIB_SUBDIR/"; then
echo "❌ Mozilla JS library lib install failed!" >&2
return 1
fi
Expand Down
Loading