-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
893fa5b
commit cac3ffc
Showing
8 changed files
with
131 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\extension; | ||
|
||
use SPC\builder\Extension; | ||
use SPC\util\CustomExt; | ||
|
||
#[CustomExt('event')] | ||
class event extends Extension | ||
{ | ||
public function getUnixConfigureArg(): string | ||
{ | ||
$arg = '--with-event-core --with-event-extra --with-event-libevent-dir=' . BUILD_ROOT_PATH; | ||
if ($this->builder->getLib('openssl')) { | ||
$arg .= ' --with-event-openssl=' . BUILD_ROOT_PATH; | ||
} | ||
if ($this->builder->getExt('sockets')) { | ||
$arg .= ' --enable-event-sockets'; | ||
} else { | ||
$arg .= ' --disable-event-sockets'; | ||
} | ||
return $arg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\linux\library; | ||
|
||
class libevent extends LinuxLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libevent; | ||
|
||
public const NAME = 'libevent'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\macos\library; | ||
|
||
class libevent extends MacOSLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libevent; | ||
|
||
public const NAME = 'libevent'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\unix\library; | ||
|
||
use SPC\store\FileSystem; | ||
|
||
trait libevent | ||
{ | ||
protected function build() | ||
{ | ||
// CMake needs a clean build directory | ||
FileSystem::resetDir($this->source_dir . '/build'); | ||
// Start build | ||
shell()->cd($this->source_dir . '/build') | ||
->exec( | ||
"{$this->builder->configure_env} cmake " . | ||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . | ||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . | ||
'-DCMAKE_BUILD_TYPE=Release ' . | ||
'-DEVENT__LIBRARY_TYPE=STATIC ' . | ||
'-DEVENT__DISABLE_BENCHMARK=ON ' . | ||
'-DEVENT__DISABLE_THREAD_SUPPORT=ON ' . | ||
'-DEVENT__DISABLE_TESTS=ON ' . | ||
'-DEVENT__DISABLE_SAMPLES=ON ' . | ||
'..' | ||
) | ||
->exec("cmake --build . -j {$this->builder->concurrency}") | ||
->exec('make install'); | ||
// patch pkgconfig | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters