Fix imap and rar build on macOS bug

This commit is contained in:
crazywhalecc
2024-07-28 14:02:17 +08:00
committed by Jerry Ma
parent 874010f225
commit e67e13e81f
5 changed files with 46 additions and 2 deletions

View File

@@ -6,11 +6,23 @@ namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('imap')]
class imap extends Extension
{
public function patchBeforeBuildconf(): bool
{
if ($this->builder->getLib('openssl')) {
// sometimes imap with openssl does not contain zlib (required by openssl)
// we need to add it manually
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/imap/config.m4', 'TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD"', 'TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD -lz"');
return true;
}
return false;
}
/**
* @throws WrongUsageException
*/