mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Add ncursesw
This commit is contained in:
parent
c1f2fd49a6
commit
c81146bf18
9
config/artifact/ncurses.yml
Normal file
9
config/artifact/ncurses.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
ncurses:
|
||||||
|
binary: hosted
|
||||||
|
metadata:
|
||||||
|
license-files:
|
||||||
|
- COPYING
|
||||||
|
source:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftp.gnu.org/pub/gnu/ncurses/'
|
||||||
|
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
@ -1,12 +1,10 @@
|
|||||||
ncurses:
|
ncurses:
|
||||||
type: library
|
type: library
|
||||||
artifact:
|
artifact: ncurses
|
||||||
source:
|
|
||||||
type: filelist
|
|
||||||
url: 'https://ftp.gnu.org/pub/gnu/ncurses/'
|
|
||||||
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
|
||||||
binary: hosted
|
|
||||||
metadata:
|
|
||||||
license-files: [COPYING]
|
|
||||||
static-libs@unix:
|
static-libs@unix:
|
||||||
- libncurses.a
|
- libncurses.a
|
||||||
|
ncursesw:
|
||||||
|
type: library
|
||||||
|
artifact: ncurses
|
||||||
|
static-libs@unix:
|
||||||
|
- libncursesw.a
|
||||||
|
|||||||
@ -13,6 +13,7 @@ use StaticPHP\Util\DirDiff;
|
|||||||
use StaticPHP\Util\FileSystem;
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
#[Library('ncurses')]
|
#[Library('ncurses')]
|
||||||
|
#[Library('ncursesw')]
|
||||||
class ncurses
|
class ncurses
|
||||||
{
|
{
|
||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
@ -21,37 +22,48 @@ class ncurses
|
|||||||
{
|
{
|
||||||
$dirdiff = new DirDiff(BUILD_BIN_PATH);
|
$dirdiff = new DirDiff(BUILD_BIN_PATH);
|
||||||
|
|
||||||
UnixAutoconfExecutor::create($package)
|
$ac = UnixAutoconfExecutor::create($package)
|
||||||
->appendEnv([
|
->appendEnv([
|
||||||
'LDFLAGS' => $toolchain->isStatic() ? '-static' : '',
|
'LDFLAGS' => $toolchain->isStatic() ? '-static' : '',
|
||||||
])
|
]);
|
||||||
->configure(
|
$wide = $package->getName() === 'ncurses' ? ['--disable-widec'] : [];
|
||||||
'--enable-overwrite',
|
// Include standard system terminfo paths as fallback so binaries linking this ncurses
|
||||||
'--with-curses-h',
|
// (e.g. htop) can find terminfo on any target system without needing TERMINFO_DIRS set.
|
||||||
'--enable-pc-files',
|
$terminfo_dirs = implode(':', [
|
||||||
'--enable-echo',
|
"{$package->getBuildRootPath()}/share/terminfo",
|
||||||
'--disable-widec',
|
'/etc/terminfo',
|
||||||
'--with-normal',
|
'/lib/terminfo',
|
||||||
'--with-ticlib',
|
'/usr/share/terminfo',
|
||||||
'--without-tests',
|
]);
|
||||||
'--without-dlsym',
|
$ac->configure(
|
||||||
'--without-debug',
|
'--enable-overwrite',
|
||||||
'--enable-symlinks',
|
'--with-curses-h',
|
||||||
"--bindir={$package->getBinDir()}",
|
'--enable-pc-files',
|
||||||
"--includedir={$package->getIncludeDir()}",
|
'--enable-echo',
|
||||||
"--libdir={$package->getLibDir()}",
|
'--with-normal',
|
||||||
"--prefix={$package->getBuildRootPath()}",
|
'--with-ticlib',
|
||||||
)
|
'--without-tests',
|
||||||
|
'--without-dlsym',
|
||||||
|
'--without-debug',
|
||||||
|
'--enable-symlinks',
|
||||||
|
"--with-terminfo-dirs={$terminfo_dirs}",
|
||||||
|
"--bindir={$package->getBinDir()}",
|
||||||
|
"--includedir={$package->getIncludeDir()}",
|
||||||
|
"--libdir={$package->getLibDir()}",
|
||||||
|
"--prefix={$package->getBuildRootPath()}",
|
||||||
|
...$wide,
|
||||||
|
)
|
||||||
->make();
|
->make();
|
||||||
$new_files = $dirdiff->getIncrementFiles(true);
|
$new_files = $dirdiff->getIncrementFiles(true);
|
||||||
foreach ($new_files as $file) {
|
foreach ($new_files as $file) {
|
||||||
@unlink(BUILD_BIN_PATH . '/' . $file);
|
@unlink(BUILD_BIN_PATH . '/' . $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
shell()->cd(BUILD_ROOT_PATH)->exec('rm -rf share/terminfo');
|
// shell()->cd(BUILD_ROOT_PATH)->exec('rm -rf share/terminfo');
|
||||||
shell()->cd(BUILD_ROOT_PATH)->exec('rm -rf lib/terminfo');
|
// shell()->cd(BUILD_ROOT_PATH)->exec('rm -rf lib/terminfo');
|
||||||
|
|
||||||
$pkgconf_list = ['form.pc', 'menu.pc', 'ncurses++.pc', 'ncurses.pc', 'panel.pc', 'tic.pc'];
|
$suffix = $package->getName() === 'ncursesw' ? 'w' : '';
|
||||||
|
$pkgconf_list = ["form{$suffix}.pc", "menu{$suffix}.pc", "ncurses++{$suffix}.pc", "ncurses{$suffix}.pc", "panel{$suffix}.pc", "tic{$suffix}.pc"];
|
||||||
$package->patchPkgconfPrefix($pkgconf_list);
|
$package->patchPkgconfPrefix($pkgconf_list);
|
||||||
|
|
||||||
foreach ($pkgconf_list as $pkgconf) {
|
foreach ($pkgconf_list as $pkgconf) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user