Ports: Support multiple port directories

This allows Ports unfit for the main repository to be put elsewhere.
This commit is contained in:
Jan200101 2023-01-05 18:51:32 +01:00 committed by Jelle Raaijmakers
parent 722ae35329
commit 9b7e217dda
Notes: sideshowbarker 2024-07-17 01:00:26 +09:00
2 changed files with 12 additions and 1 deletions

View File

@ -56,3 +56,4 @@ export PKG_CONFIG_SYSROOT_DIR="${SERENITY_BUILD_DIR}/Root"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/usr/local/lib/pkgconfig"
export SERENITY_INSTALL_ROOT="${SERENITY_BUILD_DIR}/Root"
export SERENITY_PORT_DIRS="${SERENITY_PORT_DIRS:+${SERENITY_PORT_DIRS}:}${SERENITY_SOURCE_DIR}/Ports"

View File

@ -528,7 +528,17 @@ package_install_state() {
installdepends() {
for depend in "${depends[@]}"; do
if [ -z "$(package_install_state $depend)" ]; then
(cd "${PORT_META_DIR}/../$depend" && ./package.sh --auto)
# Split colon seperated string into a list
IFS=':' read -ra port_directories <<< "$SERENITY_PORT_DIRS"
for port_dir in "${port_directories[@]}"; do
if [ -d "${port_dir}/$depend" ]; then
(cd "${port_dir}/$depend" && ./package.sh --auto)
return
fi
done
>&2 echo "Error: Dependency $depend could not be found."
exit 1
fi
done
}