mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
Ports: Fix compatiblity issues with running package.sh on Serenity
This commit is contained in:
parent
18d72ed3fd
commit
d844829de4
1 changed files with 20 additions and 9 deletions
|
@ -30,14 +30,16 @@ buildstep_intro() {
|
||||||
echo -e "\x1b[1;32m=> $@\x1b[0m"
|
echo -e "\x1b[1;32m=> $@\x1b[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
maybe_source() {
|
|
||||||
if [ -f "$1" ]; then
|
|
||||||
. "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
target_env() {
|
target_env() {
|
||||||
maybe_source "${SCRIPT}/.hosted_defs.sh"
|
if [ -f "${SCRIPT}/.hosted_defs.sh" ]; then
|
||||||
|
. "${SCRIPT}/.hosted_defs.sh"
|
||||||
|
elif [ "$(uname -s)" = "SerenityOS" ]; then
|
||||||
|
export SERENITY_ARCH="$(uname -m)"
|
||||||
|
export SERENITY_INSTALL_ROOT=""
|
||||||
|
else
|
||||||
|
>&2 echo "Error: .hosted_defs.sh is missing and we are not running on Serenity."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
target_env
|
target_env
|
||||||
|
@ -107,7 +109,12 @@ shift
|
||||||
: "${workdir:=$port-$version}"
|
: "${workdir:=$port-$version}"
|
||||||
|
|
||||||
PORT_META_DIR="$(pwd)"
|
PORT_META_DIR="$(pwd)"
|
||||||
PORT_BUILD_DIR="${SERENITY_BUILD_DIR}/Ports/${port}"
|
if [[ -z ${SERENITY_BUILD_DIR:-} ]]; then
|
||||||
|
PORT_BUILD_DIR="${PORT_META_DIR}"
|
||||||
|
else
|
||||||
|
PORT_BUILD_DIR="${SERENITY_BUILD_DIR}/Ports/${port}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
mkdir -p "${PORT_BUILD_DIR}"
|
mkdir -p "${PORT_BUILD_DIR}"
|
||||||
cd "${PORT_BUILD_DIR}"
|
cd "${PORT_BUILD_DIR}"
|
||||||
|
@ -455,7 +462,11 @@ func_defined pre_configure || pre_configure() {
|
||||||
}
|
}
|
||||||
func_defined configure || configure() {
|
func_defined configure || configure() {
|
||||||
chmod +x "${workdir}"/"$configscript"
|
chmod +x "${workdir}"/"$configscript"
|
||||||
run ./"$configscript" --host="${SERENITY_ARCH}-pc-serenity" "${configopts[@]}"
|
if [[ -n "${SERENITY_SOURCE_DIR:-}" ]]; then
|
||||||
|
run ./"$configscript" --host="${SERENITY_ARCH}-pc-serenity" "${configopts[@]}"
|
||||||
|
else
|
||||||
|
run ./"$configscript" --build="${SERENITY_ARCH}-pc-serenity" "${configopts[@]}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
func_defined post_configure || post_configure() {
|
func_defined post_configure || post_configure() {
|
||||||
:
|
:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue