lol
1{ buildPecl, lib, gpgme, file, gnupg, php }:
2
3buildPecl {
4 pname = "gnupg";
5
6 version = "1.5.1";
7 sha256 = "sha256-qZBvRlqyNDyy8xJ+4gnHJ2Ajh0XDSHjZu8FXZIYhklI=";
8
9 buildInputs = [ gpgme ];
10 checkInputs = [ gnupg ];
11
12 postPhpize = ''
13 substituteInPlace configure \
14 --replace '/usr/bin/file' '${file}/bin/file' \
15 --replace 'SEARCH_PATH="/usr/local /usr /opt"' 'SEARCH_PATH="${gpgme.dev}"'
16 '';
17
18 postConfigure = with lib; ''
19 substituteInPlace Makefile \
20 --replace 'run-tests.php' 'run-tests.php -q --offline'
21 substituteInPlace tests/gnupg_res_init_file_name.phpt \
22 --replace '/usr/bin/gpg' '${gnupg}/bin/gpg' \
23 --replace 'string(12)' 'string(${toString (stringLength "${gnupg}/bin/gpg")})'
24 substituteInPlace tests/gnupg_oo_init_file_name.phpt \
25 --replace '/usr/bin/gpg' '${gnupg}/bin/gpg' \
26 --replace 'string(12)' 'string(${toString (stringLength "${gnupg}/bin/gpg")})'
27 '';
28
29 doCheck = true;
30
31 meta = with lib; {
32 broken = lib.versionOlder php.version "8.1"; # Broken on PHP older than 8.1.
33 description = "PHP wrapper for GpgME library that provides access to GnuPG";
34 license = licenses.bsd3;
35 homepage = "https://pecl.php.net/package/gnupg";
36 maintainers = with maintainers; [ taikx4 ] ++ teams.php.members;
37 };
38}