mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ports: Fix compatiblity issues with running package.sh on Serenity
This commit is contained in:
parent
18d72ed3fd
commit
d844829de4
Notes:
sideshowbarker
2024-07-17 11:30:54 +09:00
Author: https://github.com/petelliott Commit: https://github.com/SerenityOS/serenity/commit/d844829de4 Pull-request: https://github.com/SerenityOS/serenity/pull/16134 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/timschumi ✅
1 changed files with 20 additions and 9 deletions
|
@ -30,14 +30,16 @@ buildstep_intro() {
|
|||
echo -e "\x1b[1;32m=> $@\x1b[0m"
|
||||
}
|
||||
|
||||
maybe_source() {
|
||||
if [ -f "$1" ]; then
|
||||
. "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -107,7 +109,12 @@ shift
|
|||
: "${workdir:=$port-$version}"
|
||||
|
||||
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}"
|
||||
cd "${PORT_BUILD_DIR}"
|
||||
|
@ -455,7 +462,11 @@ func_defined pre_configure || pre_configure() {
|
|||
}
|
||||
func_defined configure || configure() {
|
||||
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() {
|
||||
:
|
||||
|
|
Loading…
Reference in a new issue