Skip to content

Commit d57ee13

Browse files
committed
chore: wip
1 parent bd37058 commit d57ee13

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

.github/workflows/precompile-php.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,13 @@ jobs:
197197
ls -la $(brew --prefix gettext)/include/libintl.h || echo "libintl.h not found in expected location"
198198
ls -la $(brew --prefix gettext)/lib/libintl.* || echo "libintl not found in expected location"
199199
200-
# Create symlinks to help PHP find readline, bzip2, and gettext
201-
echo "Creating symlinks for readline, bzip2, and gettext:"
200+
# Verify OpenLDAP installation
201+
echo "Checking OpenLDAP installation:"
202+
ls -la $(brew --prefix openldap)/include/ldap.h || echo "ldap.h not found in expected location"
203+
ls -la $(brew --prefix openldap)/lib/libldap.* || echo "libldap not found in expected location"
204+
205+
# Create symlinks to help PHP find readline, bzip2, gettext, and openldap
206+
echo "Creating symlinks for readline, bzip2, gettext, and openldap:"
202207
sudo mkdir -p /usr/local/include/readline /usr/local/lib
203208
sudo ln -sf $(brew --prefix readline)/include/readline/readline.h /usr/local/include/readline/readline.h
204209
sudo ln -sf $(brew --prefix readline)/include/readline/history.h /usr/local/include/readline/history.h
@@ -207,6 +212,8 @@ jobs:
207212
sudo ln -sf $(brew --prefix bzip2)/lib/libbz2.* /usr/local/lib/
208213
sudo ln -sf $(brew --prefix gettext)/include/libintl.h /usr/local/include/libintl.h
209214
sudo ln -sf $(brew --prefix gettext)/lib/libintl.* /usr/local/lib/
215+
sudo ln -sf $(brew --prefix openldap)/include/ldap.h /usr/local/include/ldap.h
216+
sudo ln -sf $(brew --prefix openldap)/lib/libldap.* /usr/local/lib/
210217
211218
- name: Create build configuration
212219
run: |
@@ -240,10 +247,10 @@ jobs:
240247
if: matrix.platform == 'darwin'
241248
run: |
242249
# Set paths for Homebrew dependencies including keg-only packages
243-
echo "PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix zlib)/lib/pkgconfig:$(brew --prefix postgresql@17)/lib/pkgconfig:$(brew --prefix bzip2)/lib/pkgconfig:$(brew --prefix gettext)/lib/pkgconfig" >> $GITHUB_ENV
250+
echo "PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix zlib)/lib/pkgconfig:$(brew --prefix postgresql@17)/lib/pkgconfig:$(brew --prefix bzip2)/lib/pkgconfig:$(brew --prefix gettext)/lib/pkgconfig:$(brew --prefix openldap)/lib/pkgconfig" >> $GITHUB_ENV
244251
echo "PATH=$(brew --prefix bison)/bin:$(brew --prefix)/bin:$(brew --prefix postgresql@17)/bin:$(brew --prefix gettext)/bin:$PATH" >> $GITHUB_ENV
245-
echo "LDFLAGS=-L$(brew --prefix)/lib -L$(brew --prefix openssl@3)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix libiconv)/lib -L$(brew --prefix postgresql@17)/lib -L$(brew --prefix bzip2)/lib -L$(brew --prefix gettext)/lib" >> $GITHUB_ENV
246-
echo "CPPFLAGS=-I$(brew --prefix)/include -I$(brew --prefix openssl@3)/include -I$(brew --prefix zlib)/include -I$(brew --prefix libiconv)/include -I$(brew --prefix postgresql@17)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix gettext)/include" >> $GITHUB_ENV
252+
echo "LDFLAGS=-L$(brew --prefix)/lib -L$(brew --prefix openssl@3)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix libiconv)/lib -L$(brew --prefix postgresql@17)/lib -L$(brew --prefix bzip2)/lib -L$(brew --prefix gettext)/lib -L$(brew --prefix openldap)/lib" >> $GITHUB_ENV
253+
echo "CPPFLAGS=-I$(brew --prefix)/include -I$(brew --prefix openssl@3)/include -I$(brew --prefix zlib)/include -I$(brew --prefix libiconv)/include -I$(brew --prefix postgresql@17)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix gettext)/include -I$(brew --prefix openldap)/include" >> $GITHUB_ENV
247254
echo "CXXFLAGS=-std=c++17" >> $GITHUB_ENV
248255
249256
# Set readline-specific paths
@@ -311,6 +318,10 @@ jobs:
311318
export GETTEXT_CFLAGS="-I$(brew --prefix gettext)/include"
312319
export GETTEXT_LIBS="-L$(brew --prefix gettext)/lib -lintl"
313320
321+
# Set OpenLDAP environment variables
322+
export LDAP_CFLAGS="-I$(brew --prefix openldap)/include"
323+
export LDAP_LIBS="-L$(brew --prefix openldap)/lib -lldap"
324+
314325
# Set C++17 flag for ICU4C compatibility
315326
export CXXFLAGS="$CXXFLAGS -std=c++17"
316327
@@ -378,12 +389,22 @@ jobs:
378389
CURL_CONFIG=""
379390
fi
380391
392+
# Build the final configure extensions based on availability
393+
FINAL_EXTENSIONS="${{ env.CONFIGURE_EXTENSIONS }}"
394+
395+
# If PostgreSQL is not available, remove PostgreSQL extensions
396+
if [[ "${{ matrix.platform }}" == "darwin" ]] && [[ "$POSTGRESQL_AVAILABLE" != "true" ]]; then
397+
echo "Removing PostgreSQL extensions from configure command"
398+
FINAL_EXTENSIONS=$(echo "$FINAL_EXTENSIONS" | sed 's/--with-pdo-pgsql//g' | sed 's/--with-pgsql//g' | sed 's/ */ /g')
399+
echo "Final extensions: $FINAL_EXTENSIONS"
400+
fi
401+
381402
./configure \
382403
--prefix="$INSTALL_PREFIX" \
383404
--disable-debug \
384405
--enable-shared \
385406
--with-pic \
386-
${{ env.CONFIGURE_EXTENSIONS }} \
407+
$FINAL_EXTENSIONS \
387408
$EXTRA_CONFIG \
388409
$CURL_CONFIG
389410

0 commit comments

Comments
 (0)