Skip to content

Commit

Permalink
Ports: Support multiple port directories
Browse files Browse the repository at this point in the history
This allows Ports unfit for the main repository to be put elsewhere.
  • Loading branch information
Jan200101 authored and gmta committed Jan 29, 2023
1 parent 722ae35 commit 9b7e217
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Ports/.hosted_defs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 11 additions & 1 deletion Ports/.port_include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9b7e217

Please sign in to comment.