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
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build GNUstep (CI)

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build using stock script
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

# Running only the non-dev version for now, as the dev version assumes
# ssh keys are set up. This should be possible to set up with GitHub
# Actions, but let's keep it simple for now.
- name: Run the script per README instructions (non-dev version)
shell: bash
run: |
# Sourcing so we get the pipefail propagate.
(set -euo pipefail ; export MANAGE_SUDO=no ; . gnustep-web-install) | tee /tmp/gs-build.log
# We should process the log here to see if we can recognize critical
# errors.

# Otherwise let's see if some expected binaries are present.
if [ ! -x "/usr/local/GNUstep/bin/gnustep-config" ] ; then
echo "gnustep-config not found!"
exit 1
fi
if [ ! -x "/usr/local/GNUstep/bin/gorm" ] ; then
echo "gorm not found!"
exit 1
fi
27 changes: 21 additions & 6 deletions gnustep-web-install
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,29 @@ export KERNEL=`uname -s | sed "s/\-.*//g" | awk '{print(tolower($0))}'`
echo "Begin setup for ${KERNEL}"

export USER=`whoami`
curl -fsSL > ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
. ./setup-${KERNEL}
rm ./setup-${KERNEL}
if [ ! -f ./setup-${KERNEL} ] ; then
# Download the setup script only if not already present (e.g. CI).
curl -fsSL > ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
. ./setup-${KERNEL}
rm ./setup-${KERNEL}
else
# Assume inside CI.
# For CI purposes, default to failing. Using bashism is fine here, for now.
set -euo pipefail
. ./setup-${KERNEL}
fi

echo "======== Create gnustep build directories ========"
mkdir -p gnustep
cd gnustep
git clone https://github.com/gnustep/tools-scripts
if [ ! -e .git ] ; then
# Default outside CI.
mkdir -p gnustep
cd gnustep
git clone https://github.com/gnustep/tools-scripts
else
# Inside CI we are already in the repo.
# Just go to the parent directory, tools-scripts will exist.
cd ..
fi
./tools-scripts/clone-essential-repos-https

echo "================ Install Dependencies ================"
Expand Down
34 changes: 24 additions & 10 deletions gnustep-web-install-dev
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,34 @@ echo " "
export KERNEL=`uname -s | sed "s/\-.*//g" | awk '{print(tolower($0))}'`
echo "Begin setup for ${KERNEL}"

export USER=`whoami`
if [ "X${KERNEL}" == "Xopenbsd" ];then
ftp -o ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
if [ ! -f ./setup-${KERNEL} ] ; then
# Download the setup script only if not already present (e.g. CI).
export USER=`whoami`
if [ "X${KERNEL}" == "Xopenbsd" ];then
ftp -o ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
else
curl -fsSL > ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
fi
./setup-${KERNEL}
rm ./setup-${KERNEL}
else
curl -fsSL > ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
# Else, assume inside CI.
# For CI purposes, default to failing. Using bashism is fine here, for now.
set -euo pipefail
./setup-${KERNEL}
fi

./setup-${KERNEL}
rm ./setup-${KERNEL}

echo "======== Create gnustep build directories ========"
mkdir -p gnustep
cd gnustep
git clone git@github.com:gnustep/tools-scripts.git
if [ ! -e .git ] ; then
# Default outside CI.
mkdir -p gnustep
cd gnustep
git clone git@github.com:gnustep/tools-scripts.git
else
# Inside CI we are already in the repo.
# Just go to the parent directory, tools-scripts will exist.
cd ..
fi
./tools-scripts/clone-all-repos

echo "================ Install Dependencies ================"
Expand Down
58 changes: 32 additions & 26 deletions setup-linux
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,43 @@ COMMAND="apt"
# Add distro specific variables...
. /etc/lsb-release

# Install SUDO if needed...
if [ ! -e /usr/bin/sudo ]; then
echo "Installing sudo..."
if [ -e /usr/bin/apt ]; then
su -c "apt install sudo"

MANAGE_SUDO="${MANAGE_SUDO:-yes}"
if [ "X${MANAGE_SUDO}" != "Xyes" ]; then
# Either CI or user does not want to adjust whether sudo is installed,
# whether root password is set or not, etc.
echo "Skipping sudo management"
else
# Install SUDO if needed...
if [ ! -e /usr/bin/sudo ]; then
echo "Installing sudo..."
if [ -e /usr/bin/apt ]; then
su -c "apt install sudo"
else
su -c "rpm install sudo"
COMMAND="rpm"
fi
else
su -c "rpm install sudo"
COMMAND="rpm"
echo "sudo command is already present."
fi
else
echo "sudo command is already present."
fi

# Update root password...
echo "Checking if root password is not set, please set it..."
if [ "${DISTRIB_ID}" = "Ubuntu" ]; then
STATUS=`sudo passwd root --status | cut -f2 -d' '`
if [ "${STATUS}" = "L" ]; then
sudo passwd root
# Update root password...
echo "Checking if root password is not set, please set it..."
if [ "${DISTRIB_ID}" = "Ubuntu" ]; then
STATUS=`sudo passwd root --status | cut -f2 -d' '`
if [ "${STATUS}" = "L" ]; then
sudo passwd root
fi
fi
fi

# Add to sudoers
if [ "${DISTRIB_ID}" != "Ubuntu" ]; then
if [ ! -e /etc/sudoers.d/${USER} ]; then
echo "Adding ${USER} to sudoers..."
echo "Please enter the root user's password."
su -c 'echo "${USER} ALL=(ALL:ALL) ALL" > /etc/sudoers.d/${USER}'
else
echo "${USER} is already a member of sudo users."
# Add to sudoers
if [ "${DISTRIB_ID}" != "Ubuntu" ]; then
if [ ! -e /etc/sudoers.d/${USER} ]; then
echo "Adding ${USER} to sudoers..."
echo "Please enter the root user's password."
su -c 'echo "${USER} ALL=(ALL:ALL) ALL" > /etc/sudoers.d/${USER}'
else
echo "${USER} is already a member of sudo users."
fi
fi
fi

Expand Down
Loading