add readline support

This commit is contained in:
crazywhalecc 2023-04-30 15:43:08 +08:00
parent b3296842b7
commit 2d597ed690
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
15 changed files with 54 additions and 19 deletions

View File

@ -18,7 +18,7 @@
"ncurses": {
"source": "ncurses",
"static-libs-unix": [
"libncursesw.a"
"libncurses.a"
]
},
"readline": {

View File

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
/**
* gmp is a template library class for unix
*/
class ncurses extends LinuxLibraryBase
{
use \SPC\builder\unix\library\ncurses;
public const NAME = 'ncurses';
}

View File

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
/**
* gmp is a template library class for unix
*/
class readline extends LinuxLibraryBase
{
use \SPC\builder\unix\library\readline;
public const NAME = 'readline';
}

View File

@ -17,7 +17,7 @@ trait ncurses
'--with-curses-h ' .
'--enable-pc-files ' .
'--enable-echo ' .
'--enable-widec ' .
// '--enable-widec ' .
'--with-normal ' .
'--with-ticlib ' .
'--without-tests ' .

View File

@ -82,6 +82,9 @@ class SourcePatcher
if ($event = $builder->getExt('event')) {
$patch[] = ['event check', '/-levent_openssl/', $event->getLibFilesString()];
}
if ($readline = $builder->getExt('readline')) {
$patch[] = ['readline patch', '/-lncurses/', $readline->getLibFilesString()];
}
$patch[] = ['disable capstone', '/have_capstone="yes"/', 'have_capstone="no"'];
foreach ($patch as $item) {
logger()->info('Patching configure: ' . $item[0]);

View File

@ -4,5 +4,4 @@
declare(strict_types=1);
bcscale(3);
exit(bcdiv('105', '6.55957') === '16.007' ? 0 : 1);
assert(function_exists('bcscale'));

View File

@ -3,4 +3,6 @@
declare(strict_types=1);
$str = 'This is bz2 extension test';
exit(bzdecompress(bzcompress($str, 9)) === $str ? 0 : 1);
assert(function_exists('bzdecompress'));
assert(function_exists('bzcompress'));
assert(bzdecompress(bzcompress($str, 9)) === $str);

View File

@ -1,7 +1,6 @@
<?php
/** @noinspection PhpComposerExtensionStubsInspection */
declare(strict_types=1);
exit(function_exists('cal_info') && is_array(cal_info(0)) ? 0 : 1);
assert(function_exists('cal_info'));
assert(is_array(cal_info(0)));

View File

@ -2,4 +2,4 @@
declare(strict_types=1);
exit(function_exists('curl_init') ? 0 : 1);
assert(function_exists('curl_init'));

View File

@ -1,10 +1,10 @@
<?php
/** @noinspection PhpComposerExtensionStubsInspection */
declare(strict_types=1);
if (!class_exists('\\DOMDocument')) {
exit(1);
}
assert(class_exists('\\DOMDocument'));
$doc = new DOMDocument();
$doc->loadHtml("<html><head><meta charset=\"UTF-8\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body id='app'>Hello</body></html>");
exit($doc->getElementById('app')->nodeValue === 'Hello' ? 0 : 1);
assert($doc->getElementById('app')->nodeValue === 'Hello');

View File

@ -2,4 +2,4 @@
declare(strict_types=1);
exit(function_exists('filter_var') ? 0 : 1);
assert(function_exists('filter_var'));

View File

@ -2,6 +2,8 @@
declare(strict_types=1);
assert(function_exists('gd_info'));
$info = gd_info();
$true = ($true ?? true) && ($info['PNG Support'] ?? false);
exit($true ? 0 : 1);
assert($info['PNG Support'] ?? false);
assert($info['GIF Create Support'] ?? false);
assert($info['GIF Read Support'] ?? false);

View File

@ -2,4 +2,4 @@
declare(strict_types=1);
exit(class_exists('\\Redis') ? 0 : 1);
assert(class_exists('\\Redis'));

View File

@ -2,4 +2,4 @@
declare(strict_types=1);
exit(class_exists('\\ZipArchive') ? 0 : 1);
assert(class_exists('\\ZipArchive'));

View File

@ -2,4 +2,4 @@
declare(strict_types=1);
exit(function_exists('gzcompress') ? 0 : 1);
assert(function_exists('gzcompress'));