Skip to content

Commit

Permalink
phpExtensions.mssql: fix for PHP56 on Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jul 23, 2023
1 parent 3942c3a commit bff5d9a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
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

0 comments on commit bff5d9a

Please sign in to comment.