php.extensions.imap: Fetch from PECL

PHP 8.4 will remove it from tree:

987417e2e0

Keeping in-tree versions for PHP < 8.3 since the PECL version does not build there.
This commit is contained in:
Jan Tojnar 2024-08-10 23:29:27 +02:00
parent b92fa30124
commit a15c71f684
2 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,60 @@
{
buildPecl,
fetchFromGitHub,
fetchpatch,
lib,
libkrb5,
openssl,
pam,
pcre2,
pkg-config,
uwimap,
}:
let
version = "1.0.2";
in
buildPecl {
inherit version;
pname = "imap";
src = fetchFromGitHub {
owner = "php";
repo = "pecl-mail-imap";
rev = version;
hash = "sha256-QVeimxm3rfWMvMpSgadhMKd24yPdDGVuhXIOs8668do=";
};
patches = [
# Fix compilation with PHP 8.4.
(fetchpatch {
url = "https://github.com/php/pecl-mail-imap/commit/4fc9970a29c205ec328f36edc8c119c158129324.patch";
hash = "sha256-MxEaEe4YVeP7W5gDSNJb0thwAhxDj/yRr3qvjlJjRL4=";
})
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
uwimap
openssl
pam
pcre2
libkrb5
];
configureFlags = [
"--with-imap=${uwimap}"
"--with-imap-ssl"
"--with-kerberos"
];
doCheck = true;
meta = with lib; {
description = "PHP extension for checking the spelling of a word";
homepage = "https://pecl.php.net/package/imap";
license = licenses.php301;
maintainers = teams.php.members;
};
}

View File

@ -265,6 +265,9 @@ in {
imagick = callPackage ../development/php-packages/imagick { }; imagick = callPackage ../development/php-packages/imagick { };
# Shadowed by built-in version on PHP < 8.3.
imap = callPackage ../development/php-packages/imap { };
inotify = callPackage ../development/php-packages/inotify { }; inotify = callPackage ../development/php-packages/inotify { };
ioncube-loader = callPackage ../development/php-packages/ioncube-loader { }; ioncube-loader = callPackage ../development/php-packages/ioncube-loader { };
@ -453,6 +456,8 @@ in {
name = "imap"; name = "imap";
buildInputs = [ uwimap openssl pam pcre2 libkrb5 ]; buildInputs = [ uwimap openssl pam pcre2 libkrb5 ];
configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" "--with-kerberos" ]; configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" "--with-kerberos" ];
# Using version from PECL on new PHP versions.
enable = lib.versionOlder php.version "8.3";
} }
{ {
name = "intl"; name = "intl";