mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 18:05:36 +08:00
add windows support for dba-qdbm
This commit is contained in:
@@ -43,9 +43,8 @@
|
||||
},
|
||||
"dba": {
|
||||
"type": "builtin",
|
||||
"arg-type-windows": "with",
|
||||
"arg-type-unix": "custom",
|
||||
"lib-suggests-unix": [
|
||||
"arg-type": "custom",
|
||||
"lib-suggests": [
|
||||
"qdbm"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -529,6 +529,12 @@
|
||||
"source": "qdbm",
|
||||
"static-libs-unix": [
|
||||
"libqdbm.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"qdbm_a.lib"
|
||||
],
|
||||
"headers-windows": [
|
||||
"depot.h"
|
||||
]
|
||||
},
|
||||
"readline": {
|
||||
|
||||
@@ -552,8 +552,9 @@
|
||||
}
|
||||
},
|
||||
"qdbm": {
|
||||
"type": "url",
|
||||
"url": "https://master.dl.sourceforge.net/project/qdbm/qdbm/1.8.77/qdbm-1.8.77.tar.gz",
|
||||
"type": "git",
|
||||
"url": "https://github.com/static-php/qdbm.git",
|
||||
"rev": "main",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
|
||||
@@ -15,4 +15,10 @@ class dba extends Extension
|
||||
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . BUILD_ROOT_PATH) : '';
|
||||
return '--enable-dba' . $qdbm;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
{
|
||||
$qdbm = $this->builder->getLib('qdbm') ? ' --with-qdbm' : '';
|
||||
return '--with-dba' . $qdbm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ class WindowsBuilder extends BuilderBase
|
||||
|
||||
// make cmake toolchain
|
||||
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile();
|
||||
|
||||
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);
|
||||
f_mkdir(BUILD_LIB_PATH, recursive: true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
24
src/SPC/builder/windows/library/qdbm.php
Normal file
24
src/SPC/builder/windows/library/qdbm.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\windows\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class qdbm extends WindowsLibraryBase
|
||||
{
|
||||
public const NAME = 'qdbm';
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
cmd()->cd($this->source_dir)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('nmake'),
|
||||
'/f VCMakefile'
|
||||
);
|
||||
copy($this->source_dir . '\qdbm_a.lib', BUILD_LIB_PATH . '\qdbm_a.lib');
|
||||
copy($this->source_dir . '\depot.h', BUILD_INCLUDE_PATH . '\depot.h');
|
||||
// FileSystem::copyDir($this->source_dir . '\include\curl', BUILD_INCLUDE_PATH . '\curl');
|
||||
}
|
||||
}
|
||||
@@ -14,13 +14,13 @@ declare(strict_types=1);
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'dba',
|
||||
'Windows' => 'mbstring,pdo_sqlite,mbregex',
|
||||
'Windows' => 'mbstring,pdo_sqlite,mbregex,dba',
|
||||
};
|
||||
|
||||
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
||||
$with_libs = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'qdbm',
|
||||
'Windows' => '',
|
||||
'Windows' => 'qdbm',
|
||||
};
|
||||
|
||||
// Please change your test base combination. We recommend testing with `common`.
|
||||
|
||||
Reference in New Issue
Block a user