Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpExtensions.mssql: fix build on darwin #281

Merged
merged 1 commit into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/package-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ in
configureFlags = [
"--with-mssql=${pkgs.freetds}"
];
patches = [
# Make sure it looks also for the proper extension files
./patches/0001-mssql-extension-fix-builds-on-darwin.patch
];
}
else
throw "php.extensions.mssql requires PHP version < 7.0.";
Expand Down
28 changes: 28 additions & 0 deletions pkgs/patches/0001-mssql-extension-fix-builds-on-darwin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 481698135c339d916a78381eceeaa4b755ad5da5 Mon Sep 17 00:00:00 2001
From: Pol Dellaiera <pol.dellaiera@protonmail.com>
Date: Sun, 23 Jul 2023 21:44:13 +0200
Subject: [PATCH] mssql extension: fix builds on darwin

Detect proper file extensions by using `$SHLIB_SUFFIX_NAME`
---
ext/mssql/config.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ext/mssql/config.m4 b/ext/mssql/config.m4
index 2a298af734..4014312594 100644
--- a/ext/mssql/config.m4
+++ b/ext/mssql/config.m4
@@ -38,8 +38,8 @@ if test "$PHP_MSSQL" != "no"; then
fi
fi

- if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
- AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so])
+ if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.$SHLIB_SUFFIX_NAME"; then
+ AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|$SHLIB_SUFFIX_NAME])
fi

PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR)
--
2.41.0