mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add maxminddb extension and libmaxminddb
This commit is contained in:
parent
f24cbcf909
commit
b60ea8e3d6
@ -358,6 +358,18 @@
|
||||
"liblz4"
|
||||
]
|
||||
},
|
||||
"maxminddb": {
|
||||
"support": {
|
||||
"BSD": "wip",
|
||||
"Windows": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
"source": "ext-maxminddb",
|
||||
"arg-type": "with",
|
||||
"lib-depends": [
|
||||
"libmaxminddb"
|
||||
]
|
||||
},
|
||||
"mbregex": {
|
||||
"type": "builtin",
|
||||
"arg-type": "custom",
|
||||
|
||||
@ -506,6 +506,16 @@
|
||||
"liblz4.a"
|
||||
]
|
||||
},
|
||||
"libmaxminddb": {
|
||||
"source": "libmaxminddb",
|
||||
"static-libs-unix": [
|
||||
"libmaxminddb.a"
|
||||
],
|
||||
"headers": [
|
||||
"maxminddb.h",
|
||||
"maxminddb_config.h"
|
||||
]
|
||||
},
|
||||
"libmemcached": {
|
||||
"source": "libmemcached",
|
||||
"cpp-library": true,
|
||||
|
||||
@ -184,6 +184,15 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"ext-maxminddb": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/maxminddb",
|
||||
"filename": "ext-maxminddb.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-memcache": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/memcache",
|
||||
@ -641,6 +650,16 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"libmaxminddb": {
|
||||
"type": "ghrel",
|
||||
"repo": "maxmind/libmaxminddb",
|
||||
"match": "libmaxminddb-.+\\.tar\\.gz",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"libmemcached": {
|
||||
"type": "ghtagtar",
|
||||
"repo": "awesomized/libmemcached",
|
||||
|
||||
26
src/SPC/builder/extension/maxminddb.php
Normal file
26
src/SPC/builder/extension/maxminddb.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('maxminddb')]
|
||||
class maxminddb extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
if (!is_link(SOURCE_PATH . '/php-src/ext/maxminddb')) {
|
||||
$original = $this->source_dir;
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && mklink /D maxminddb ' . $original . '\ext');
|
||||
} else {
|
||||
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && ln -s ' . $original . '/ext maxminddb');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
12
src/SPC/builder/linux/library/libmaxminddb.php
Normal file
12
src/SPC/builder/linux/library/libmaxminddb.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class libmaxminddb extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libmaxminddb;
|
||||
|
||||
public const NAME = 'libmaxminddb';
|
||||
}
|
||||
12
src/SPC/builder/macos/library/libmaxminddb.php
Normal file
12
src/SPC/builder/macos/library/libmaxminddb.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class libmaxminddb extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libmaxminddb;
|
||||
|
||||
public const NAME = 'libmaxminddb';
|
||||
}
|
||||
20
src/SPC/builder/unix/library/libmaxminddb.php
Normal file
20
src/SPC/builder/unix/library/libmaxminddb.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
|
||||
trait libmaxminddb
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
UnixCMakeExecutor::create($this)
|
||||
->addConfigureArgs(
|
||||
'-DBUILD_TESTING=OFF',
|
||||
'-DMAXMINDDB_BUILD_BINARIES=OFF',
|
||||
)
|
||||
->build();
|
||||
}
|
||||
}
|
||||
@ -13,11 +13,11 @@ declare(strict_types=1);
|
||||
|
||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||
$test_php_version = [
|
||||
// '8.1',
|
||||
// '8.2',
|
||||
// '8.3',
|
||||
'8.1',
|
||||
'8.2',
|
||||
'8.3',
|
||||
'8.4',
|
||||
// '8.5',
|
||||
'8.5',
|
||||
// 'git',
|
||||
];
|
||||
|
||||
@ -35,7 +35,7 @@ $test_os = [
|
||||
];
|
||||
|
||||
// whether enable thread safe
|
||||
$zts = true;
|
||||
$zts = false;
|
||||
|
||||
$no_strip = false;
|
||||
|
||||
@ -50,7 +50,7 @@ $prefer_pre_built = false;
|
||||
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'curl',
|
||||
'Linux', 'Darwin' => 'maxminddb',
|
||||
'Windows' => 'bcmath',
|
||||
};
|
||||
|
||||
@ -62,7 +62,7 @@ $shared_extensions = match (PHP_OS_FAMILY) {
|
||||
};
|
||||
|
||||
// If you want to test lib-suggests for all extensions and libraries, set it to true.
|
||||
$with_suggested_libs = true;
|
||||
$with_suggested_libs = false;
|
||||
|
||||
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
||||
$with_libs = match (PHP_OS_FAMILY) {
|
||||
@ -74,7 +74,7 @@ $with_libs = match (PHP_OS_FAMILY) {
|
||||
// You can use `common`, `bulk`, `minimal` or `none`.
|
||||
// note: combination is only available for *nix platform. Windows must use `none` combination
|
||||
$base_combination = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'none',
|
||||
'Linux', 'Darwin' => 'minimal',
|
||||
'Windows' => 'none',
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user