From 649fdcdc4a313161e1f4ad09ed2ccd32e435ba65 Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sun, 11 Oct 2020 17:44:38 +0200 Subject: [PATCH] phpExtensions.couchbase: Move to separate directory --- .../php-packages/couchbase/default.nix | 48 +++++++++++++++++++ pkgs/top-level/php-packages.nix | 48 +------------------ 2 files changed, 49 insertions(+), 47 deletions(-) create mode 100644 pkgs/development/php-packages/couchbase/default.nix diff --git a/pkgs/development/php-packages/couchbase/default.nix b/pkgs/development/php-packages/couchbase/default.nix new file mode 100644 index 000000000000..a46bbea817a8 --- /dev/null +++ b/pkgs/development/php-packages/couchbase/default.nix @@ -0,0 +1,48 @@ +{ buildPecl, lib, pkgs, php }: +let + pname = "couchbase"; + version = "2.6.1"; +in +buildPecl { + inherit pname version; + + src = pkgs.fetchFromGitHub { + owner = "couchbase"; + repo = "php-couchbase"; + rev = "v${version}"; + sha256 = "0jdzgcvab1vpxai23brmmvizjjq2d2dik9aklz6bzspfb512qjd6"; + }; + + configureFlags = [ "--with-couchbase" ]; + + buildInputs = with pkgs; [ libcouchbase zlib ]; + internalDeps = [ php.extensions.json ]; + peclDeps = [ php.extensions.igbinary ]; + + patches = [ + (pkgs.writeText "php-couchbase.patch" '' + --- 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 + + for i in ${pkgs.libcouchbase}; do + 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]) + '') + ]; + + meta.maintainers = lib.teams.php.members; +} diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 110128622061..22ff7df76ff0 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -70,53 +70,7 @@ in blackfire = pkgs.callPackage ../development/tools/misc/blackfire/php-probe.nix { inherit php; }; - couchbase = buildPecl rec { - version = "2.6.1"; - pname = "couchbase"; - - src = pkgs.fetchFromGitHub { - owner = "couchbase"; - repo = "php-couchbase"; - rev = "v${version}"; - sha256 = "0jdzgcvab1vpxai23brmmvizjjq2d2dik9aklz6bzspfb512qjd6"; - }; - - configureFlags = [ "--with-couchbase" ]; - - buildInputs = [ - pkgs.libcouchbase - pkgs.zlib - ]; - internalDeps = [ php.extensions.json ]; - peclDeps = [ php.extensions.igbinary ]; - - patches = [ - (pkgs.writeText "php-couchbase.patch" '' - --- 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 - + for i in ${pkgs.libcouchbase}; do - 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]) - '') - ]; - - meta.maintainers = lib.teams.php.members; - }; + couchbase = callPackage ../development/php-packages/couchbase { }; event = buildPecl { version = "2.5.3";