mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2024-11-10 07:11:39 +00:00
Remove setup.sh.
This has turned out to not do very much, and adds an annoying initial stage before building. Just move this logic into the main script instead, and get rid of it.
This commit is contained in:
parent
3ad8b4a563
commit
ea6d80c4bf
2 changed files with 30 additions and 28 deletions
|
@ -2,16 +2,42 @@
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
# set_chocpkg_root sets the CHOCPKG_ROOT environment variable based on the
|
||||||
|
# path where the script is located.
|
||||||
|
set_chocpkg_root() {
|
||||||
|
# Assume that the package root is one directory up from the script.
|
||||||
|
local script_path=$(realpath "$0")
|
||||||
|
local script_dir=$(dirname "$script_path")
|
||||||
|
CHOCPKG_ROOT=$(dirname "$script_dir")
|
||||||
|
|
||||||
|
# Build directory must not contain a space, or bad things happen:
|
||||||
|
case "$CHOCPKG_ROOT" in
|
||||||
|
*\ *)
|
||||||
|
cat <<END
|
||||||
|
The build scripts are in a path containing a space:
|
||||||
|
|
||||||
|
$CHOCPKG_ROOT
|
||||||
|
|
||||||
|
Builds will probably fail - try moving the build scripts to a
|
||||||
|
different directory not containing a space.
|
||||||
|
END
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# basic_setup is invoked on script startup to set various environment variables
|
||||||
|
# and create basic directories used throughout the rest of the script.
|
||||||
basic_setup() {
|
basic_setup() {
|
||||||
if [ "${CHOCPKG_ROOT:-}" = "" ]; then
|
if [ -z "${CHOCPKG_ROOT:-}" ]; then
|
||||||
echo "CHOCPKG_ROOT not configured - please source setup.sh." \
|
set_chocpkg_root
|
||||||
>> /dev/stderr
|
PATH="$CHOCPKG_ROOT/chocpkg:$CHOCPKG_ROOT/install.native/bin:$PATH"
|
||||||
exit -1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INSTALL_DIR="$CHOCPKG_ROOT/install"
|
INSTALL_DIR="$CHOCPKG_ROOT/install"
|
||||||
NATIVE_INSTALL_DIR="$CHOCPKG_ROOT/install.native"
|
NATIVE_INSTALL_DIR="$CHOCPKG_ROOT/install.native"
|
||||||
PACKAGES_DIR="$CHOCPKG_ROOT/packages"
|
PACKAGES_DIR="$CHOCPKG_ROOT/packages"
|
||||||
BUILD_DIR="$CHOCPKG_ROOT/build"
|
BUILD_DIR="$CHOCPKG_ROOT/build"
|
||||||
|
|
||||||
mkdir -p "$INSTALL_DIR" "$NATIVE_INSTALL_DIR" "$PACKAGES_DIR" "$BUILD_DIR"
|
mkdir -p "$INSTALL_DIR" "$NATIVE_INSTALL_DIR" "$PACKAGES_DIR" "$BUILD_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
24
setup.sh
24
setup.sh
|
@ -1,24 +0,0 @@
|
||||||
|
|
||||||
CHOCPKG_ROOT=$HOME/chocolate-doom-build
|
|
||||||
export CHOCPKG_ROOT
|
|
||||||
|
|
||||||
# Build directory must not contain a space, or bad things happen:
|
|
||||||
case "$CHOCPKG_ROOT" in
|
|
||||||
*\ *)
|
|
||||||
cat <<END
|
|
||||||
The path to your home directory contains a space:
|
|
||||||
|
|
||||||
HOME=$HOME
|
|
||||||
|
|
||||||
This script will probably fail to build - reset HOME to point
|
|
||||||
somewhere else. For example, type:
|
|
||||||
|
|
||||||
mkdir /home/user
|
|
||||||
HOME=/home/user
|
|
||||||
END
|
|
||||||
exit -1
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Set up various environment variables:
|
|
||||||
PATH="$CHOCPKG_ROOT/chocpkg:$CHOCPKG_ROOT/install.native/bin:$PATH"
|
|
||||||
|
|
Loading…
Reference in a new issue