mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Add support for adding libraries when building extensions from source
This commit is contained in:
parent
a9a6d1986e
commit
c7736a605a
@ -291,6 +291,16 @@ php_src_tag() {
|
||||
echo "$php_src_tag"
|
||||
}
|
||||
|
||||
# Function to add required libraries
|
||||
add_libs() {
|
||||
libs=("$@")
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
install_packages "${libs[@]}"
|
||||
else
|
||||
brew install "${libs[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to install extension from a GitHub repository
|
||||
add_extension_from_github() {
|
||||
extension=$1
|
||||
@ -298,6 +308,8 @@ add_extension_from_github() {
|
||||
repo=$3
|
||||
release=$4
|
||||
prefix=$5
|
||||
libs_var="${extension}_LIBS"
|
||||
IFS=' ' read -r -a libs <<< "${!libs_var}"
|
||||
(
|
||||
add_devtools phpize
|
||||
delete_extension "$extension"
|
||||
@ -305,6 +317,7 @@ add_extension_from_github() {
|
||||
cd /tmp/"$repo-$release" || exit 1
|
||||
git checkout "$release" || exit 1
|
||||
git submodule update --init --recursive || exit 1
|
||||
add_libs "${libs[@]}"
|
||||
phpize && ./configure && make -j"$(nproc)" && sudo make install
|
||||
enable_extension "$extension" "$prefix"
|
||||
) >/dev/null 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user