diff --git a/pkgs/development/php-packages/swoole/default.nix b/pkgs/development/php-packages/swoole/default.nix index 5c7358630169..595dd33e8312 100644 --- a/pkgs/development/php-packages/swoole/default.nix +++ b/pkgs/development/php-packages/swoole/default.nix @@ -5,11 +5,13 @@ php, valgrind, pcre2, + openssl, + pkg-config, fetchFromGitHub, }: let - version = "6.1.8"; + version = "6.2.3"; in buildPecl { inherit version; @@ -19,10 +21,23 @@ buildPecl { owner = "swoole"; repo = "swoole-src"; tag = "v${version}"; - hash = "sha256-z/f3GLI/PQJJWcY968fOH00btDaKDx3M0Nb/IOjDgeY="; + hash = "sha256-VAtFR90bnS0ipta/BSOmmcEGTB+rzIQ83hm4lmrPJVI="; }; - buildInputs = [ pcre2 ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ valgrind ]; + # sw_usleep is undefined in the non-futex (Darwin) path + # https://github.com/swoole/swoole-src/issues/6243 + postPatch = '' + substituteInPlace src/core/misc.cc \ + --replace-fail "sw_usleep(1000);" "usleep(1000);" + ''; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + openssl + pcre2 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ valgrind ]; # tests require internet access doCheck = false;