2023-09-03 15:49:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
2023-09-03 18:59:00 +02:00
|
|
|
use SPC\builder\macos\MacOSBuilder;
|
|
|
|
|
use SPC\store\FileSystem;
|
2023-09-03 15:49:15 +02:00
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('snappy')]
|
|
|
|
|
class snappy extends Extension
|
|
|
|
|
{
|
2023-09-03 18:59:00 +02:00
|
|
|
public function patchBeforeConfigure(): bool
|
|
|
|
|
{
|
|
|
|
|
FileSystem::replaceFileRegex(
|
|
|
|
|
SOURCE_PATH . '/php-src/configure',
|
|
|
|
|
'/-lsnappy/',
|
2023-09-03 19:22:10 +02:00
|
|
|
$this->getLibFilesString() . ($this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++')
|
2023-09-03 18:59:00 +02:00
|
|
|
);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-27 11:12:19 +07:00
|
|
|
public function getUnixConfigureArg(bool $shared = false): string
|
2023-09-03 15:49:15 +02:00
|
|
|
{
|
|
|
|
|
return '--enable-snappy --with-snappy-includedir="' . BUILD_ROOT_PATH . '"';
|
|
|
|
|
}
|
|
|
|
|
}
|