Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions config/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 19 additions & 0 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/SPC/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
final class ConsoleApplication extends Application
{
public const string VERSION = '2.7.7';
public const string VERSION = '2.7.8';

public function __construct()
{
Expand Down
26 changes: 26 additions & 0 deletions src/SPC/builder/extension/maxminddb.php
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('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');
Comment thread
crazywhalecc marked this conversation as resolved.
}
return true;
}
return false;
}
}
12 changes: 12 additions & 0 deletions src/SPC/builder/linux/library/libmaxminddb.php
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 libmaxminddb extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libmaxminddb;

public const NAME = 'libmaxminddb';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/macos/library/libmaxminddb.php
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 libmaxminddb extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libmaxminddb;

public const NAME = 'libmaxminddb';
}
20 changes: 20 additions & 0 deletions src/SPC/builder/unix/library/libmaxminddb.php
Original file line number Diff line number Diff line change
@@ -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();
}
}
16 changes: 8 additions & 8 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

// 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',
];

Expand All @@ -35,7 +35,7 @@
];

// whether enable thread safe
$zts = true;
$zts = false;

$no_strip = false;

Expand All @@ -50,7 +50,7 @@

// 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',
};

Expand All @@ -62,7 +62,7 @@
};

// 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) {
Expand All @@ -74,7 +74,7 @@
// 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',
};

Expand Down