From ddc8bce22ef7835c4b06dc64cf634f2fbdbfdb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Poirotte?= Date: Thu, 23 Jul 2026 22:26:37 +0200 Subject: [PATCH] Add lib-pam as a supported system library Register the (Linux-)PAM library so extensions that wrap it (e.g. amishmm/pam) can declare a `lib-pam` dependency in composer.json. Linux-PAM exposes a `pam` pkg-config module, so it is detected the same way as the other supported libraries, and can be auto-installed via apt (libpam0g-dev), apk (linux-pam-dev), and dnf/yum (pkgconfig(pam)). --- docs/extension-maintainers.md | 1 + .../PhpBinaryPathBasedPlatformRepository.php | 1 + .../DependencyInstaller/SystemDependenciesDefinition.php | 7 +++++++ .../PhpBinaryPathBasedPlatformRepositoryTest.php | 1 + 4 files changed, 10 insertions(+) diff --git a/docs/extension-maintainers.md b/docs/extension-maintainers.md index eaa9d8e6..0eb51d79 100644 --- a/docs/extension-maintainers.md +++ b/docs/extension-maintainers.md @@ -396,6 +396,7 @@ is NOT working, then please [report a bug](https://github.com/php/pie/issues). | lib-gdlib | ✅ | ❌ | | lib-gmp | ✅ | ❌ | | lib-gpgme | ✅ | apt, apk, dnf, yum | +| lib-pam | ✅ | apt, apk, dnf, yum | | lib-sasl | ✅ | ❌ | | lib-onig | ✅ | ❌ | | lib-odbc | ✅ | ❌ | diff --git a/src/ComposerIntegration/PhpBinaryPathBasedPlatformRepository.php b/src/ComposerIntegration/PhpBinaryPathBasedPlatformRepository.php index 293df0b3..4e0ad3db 100644 --- a/src/ComposerIntegration/PhpBinaryPathBasedPlatformRepository.php +++ b/src/ComposerIntegration/PhpBinaryPathBasedPlatformRepository.php @@ -172,6 +172,7 @@ private function addLibrariesUsingPkgConfig(): void $this->detectLibraryWithPkgConfig('gdlib', 'gdlib'); $this->detectLibraryWithPkgConfig('gmp', 'gmp'); $this->detectLibraryWithPkgConfig('gpgme', 'gpgme'); + $this->detectLibraryWithPkgConfig('pam', 'pam'); $this->detectLibraryWithPkgConfig('sasl', 'libsasl2'); $this->detectLibraryWithPkgConfig('onig', 'oniguruma'); $this->detectLibraryWithPkgConfig('odbc', 'libiodbc'); diff --git a/src/DependencyResolver/DependencyInstaller/SystemDependenciesDefinition.php b/src/DependencyResolver/DependencyInstaller/SystemDependenciesDefinition.php index 53808ab1..a3cf7dde 100644 --- a/src/DependencyResolver/DependencyInstaller/SystemDependenciesDefinition.php +++ b/src/DependencyResolver/DependencyInstaller/SystemDependenciesDefinition.php @@ -69,6 +69,13 @@ public static function default(): self PackageManager::Microdnf->value => 'pkgconfig(gpgme)', PackageManager::Yum->value => 'pkgconfig(gpgme)', ], + 'pam' => [ + PackageManager::Apt->value => 'libpam0g-dev', + PackageManager::Apk->value => 'linux-pam-dev', + PackageManager::Dnf->value => 'pkgconfig(pam)', + PackageManager::Microdnf->value => 'pkgconfig(pam)', + PackageManager::Yum->value => 'pkgconfig(pam)', + ], ]); } } diff --git a/test/unit/ComposerIntegration/PhpBinaryPathBasedPlatformRepositoryTest.php b/test/unit/ComposerIntegration/PhpBinaryPathBasedPlatformRepositoryTest.php index 9aef2094..184d94c8 100644 --- a/test/unit/ComposerIntegration/PhpBinaryPathBasedPlatformRepositoryTest.php +++ b/test/unit/ComposerIntegration/PhpBinaryPathBasedPlatformRepositoryTest.php @@ -177,6 +177,7 @@ public static function installedLibraries(): array ['gdlib', 'gdlib'], ['gmp', 'gmp'], ['gpgme', 'gpgme'], + ['pam', 'pam'], ['sasl', 'libsasl2'], ['onig', 'oniguruma'], ['odbc', 'libiodbc'],