2021-02-27 11:29:20 +01:00
|
|
|
{ lib, buildPecl, fetchFromGitHub, writeText, libcouchbase, zlib, php }:
|
2020-10-11 17:44:38 +02:00
|
|
|
let
|
|
|
|
pname = "couchbase";
|
2020-10-24 09:55:57 +02:00
|
|
|
version = "2.6.2";
|
2020-10-11 17:44:38 +02:00
|
|
|
in
|
|
|
|
buildPecl {
|
|
|
|
inherit pname version;
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
src = fetchFromGitHub {
|
2020-10-11 17:44:38 +02:00
|
|
|
owner = "couchbase";
|
|
|
|
repo = "php-couchbase";
|
|
|
|
rev = "v${version}";
|
2020-10-24 09:55:57 +02:00
|
|
|
sha256 = "0ymrymnz91qg9b2ns044qg46wc65dffhxx402wpx1b5cj2vr4ma3";
|
2020-10-11 17:44:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [ "--with-couchbase" ];
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
buildInputs = [ libcouchbase zlib ];
|
2021-04-15 03:47:42 +02:00
|
|
|
internalDeps = lib.optionals (lib.versionOlder php.version "8.0") [ php.extensions.json ];
|
2020-10-11 17:44:38 +02:00
|
|
|
peclDeps = [ php.extensions.igbinary ];
|
|
|
|
|
|
|
|
patches = [
|
2021-02-27 11:29:20 +01:00
|
|
|
(writeText "php-couchbase.patch" ''
|
2020-10-11 17:44:38 +02:00
|
|
|
--- a/config.m4
|
|
|
|
+++ b/config.m4
|
|
|
|
@@ -9,7 +9,7 @@ if test "$PHP_COUCHBASE" != "no"; then
|
|
|
|
LIBCOUCHBASE_DIR=$PHP_COUCHBASE
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING(for libcouchbase in default path)
|
|
|
|
- for i in /usr/local /usr; do
|
2021-02-27 11:29:20 +01:00
|
|
|
+ for i in ${libcouchbase}; do
|
2020-10-11 17:44:38 +02:00
|
|
|
if test -r $i/include/libcouchbase/couchbase.h; then
|
|
|
|
LIBCOUCHBASE_DIR=$i
|
|
|
|
AC_MSG_RESULT(found in $i)
|
|
|
|
@@ -154,6 +154,8 @@ COUCHBASE_FILES=" \
|
|
|
|
igbinary_inc_path="$phpincludedir"
|
|
|
|
elif test -f "$phpincludedir/ext/igbinary/igbinary.h"; then
|
|
|
|
igbinary_inc_path="$phpincludedir"
|
|
|
|
+ elif test -f "${php.extensions.igbinary.dev}/include/ext/igbinary/igbinary.h"; then
|
|
|
|
+ igbinary_inc_path="${php.extensions.igbinary.dev}/include"
|
|
|
|
fi
|
|
|
|
if test "$igbinary_inc_path" = ""; then
|
|
|
|
AC_MSG_WARN([Cannot find igbinary.h])
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
2021-06-08 11:50:05 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Couchbase Server PHP extension";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://docs.couchbase.com/php-sdk/current/project-docs/sdk-release-notes.html";
|
|
|
|
maintainers = teams.php.members;
|
|
|
|
broken = versionAtLeast php.version "8.0";
|
|
|
|
};
|
2020-10-11 17:44:38 +02:00
|
|
|
}
|