diff --git a/config/ext.json b/config/ext.json index 303e0dde..e8f69339 100644 --- a/config/ext.json +++ b/config/ext.json @@ -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", diff --git a/config/lib.json b/config/lib.json index 48a674c7..47f3c7b8 100644 --- a/config/lib.json +++ b/config/lib.json @@ -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, diff --git a/config/source.json b/config/source.json index 76bf1835..06aa5c6f 100644 --- a/config/source.json +++ b/config/source.json @@ -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", diff --git a/src/SPC/builder/extension/maxminddb.php b/src/SPC/builder/extension/maxminddb.php new file mode 100644 index 00000000..7d7ee096 --- /dev/null +++ b/src/SPC/builder/extension/maxminddb.php @@ -0,0 +1,26 @@ +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; + } +} diff --git a/src/SPC/builder/linux/library/libmaxminddb.php b/src/SPC/builder/linux/library/libmaxminddb.php new file mode 100644 index 00000000..06e309c4 --- /dev/null +++ b/src/SPC/builder/linux/library/libmaxminddb.php @@ -0,0 +1,12 @@ +addConfigureArgs( + '-DBUILD_TESTING=OFF', + '-DMAXMINDDB_BUILD_BINARIES=OFF', + ) + ->build(); + } +} diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index dddcc0f2..1d31d520 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -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', };