mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
add readline support
This commit is contained in:
parent
d73cefc280
commit
b3296842b7
@ -235,13 +235,9 @@
|
||||
},
|
||||
"readline": {
|
||||
"type": "builtin",
|
||||
"arg-type": "with",
|
||||
"arg-type": "with-prefix",
|
||||
"lib-depends": [
|
||||
"readline"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"libedit",
|
||||
"ncurses"
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
|
||||
@ -15,6 +15,21 @@
|
||||
"brotli"
|
||||
]
|
||||
},
|
||||
"ncurses": {
|
||||
"source": "ncurses",
|
||||
"static-libs-unix": [
|
||||
"libncursesw.a"
|
||||
]
|
||||
},
|
||||
"readline": {
|
||||
"source": "readline",
|
||||
"static-libs-unix": [
|
||||
"libreadline.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"ncurses"
|
||||
]
|
||||
},
|
||||
"bzip2": {
|
||||
"source": "bzip2",
|
||||
"static-libs-unix": [
|
||||
|
||||
@ -41,6 +41,24 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ncurses": {
|
||||
"type": "filelist",
|
||||
"url": "https://ftp.gnu.org/pub/gnu/ncurses/",
|
||||
"regex": "/href=\"(?<file>ncurses-(?<version>[^\"]+)\\.tar\\.gz)\"/",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"readline": {
|
||||
"type": "filelist",
|
||||
"url": "https://ftp.gnu.org/pub/gnu/readline/",
|
||||
"regex": "/href=\"(?<file>readline-(?<version>[^\"]+)\\.tar\\.gz)\"/",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"ext-zstd": {
|
||||
"type": "git",
|
||||
"path": "php-src/ext/zstd",
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
| phar | yes | yes | |
|
||||
| posix | yes | yes | |
|
||||
| protobuf | yes | yes | |
|
||||
| readline | | | |
|
||||
| readline | yes, untested | yes, untested | |
|
||||
| redis | yes | yes | |
|
||||
| session | yes | yes | |
|
||||
| shmop | yes | yes | |
|
||||
|
||||
15
src/SPC/builder/macos/library/ncurses.php
Normal file
15
src/SPC/builder/macos/library/ncurses.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class ncurses extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\ncurses;
|
||||
|
||||
public const NAME = 'ncurses';
|
||||
}
|
||||
15
src/SPC/builder/macos/library/readline.php
Normal file
15
src/SPC/builder/macos/library/readline.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class readline extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\readline;
|
||||
|
||||
public const NAME = 'readline';
|
||||
}
|
||||
36
src/SPC/builder/unix/library/ncurses.php
Normal file
36
src/SPC/builder/unix/library/ncurses.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
trait ncurses
|
||||
{
|
||||
protected function build()
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->exec(
|
||||
"{$this->builder->configure_env} ./configure " .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
'--enable-overwrite ' .
|
||||
'--with-curses-h ' .
|
||||
'--enable-pc-files ' .
|
||||
'--enable-echo ' .
|
||||
'--enable-widec ' .
|
||||
'--with-normal ' .
|
||||
'--with-ticlib ' .
|
||||
'--without-tests ' .
|
||||
'--without-dlsym ' .
|
||||
'--without-debug ' .
|
||||
'-enable-symlinks' .
|
||||
'--bindir=' . BUILD_ROOT_PATH . '/bin ' .
|
||||
'--includedir=' . BUILD_ROOT_PATH . '/include ' .
|
||||
'--libdir=' . BUILD_ROOT_PATH . '/lib ' .
|
||||
'--prefix=' . BUILD_ROOT_PATH
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
}
|
||||
}
|
||||
25
src/SPC/builder/unix/library/readline.php
Normal file
25
src/SPC/builder/unix/library/readline.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
trait readline
|
||||
{
|
||||
protected function build()
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->exec(
|
||||
"{$this->builder->configure_env} ./configure " .
|
||||
'--enable-static=yes ' .
|
||||
'--enable-shared=no ' .
|
||||
'--prefix= ' .
|
||||
'--with-curses ' .
|
||||
'--enable-multibyte=yes'
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['readline.pc']);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user