add readline support

This commit is contained in:
crazywhalecc
2023-04-30 15:04:50 +08:00
parent d73cefc280
commit b3296842b7
8 changed files with 126 additions and 6 deletions

View 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';
}

View 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';
}

View 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');
}
}

View 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']);
}
}