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:
|
||||
type: library
|
||||
artifact:
|
||||
source:
|
||||
type: filelist
|
||||
url: 'https://ftp.gnu.org/pub/gnu/ncurses/'
|
||||
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
||||
binary: hosted
|
||||
metadata:
|
||||
license-files: [COPYING]
|
||||
artifact: ncurses
|
||||
static-libs@unix:
|
||||
- libncurses.a
|
||||
ncursesw:
|
||||
type: library
|
||||
artifact: ncurses
|
||||
static-libs@unix:
|
||||
- libncursesw.a
|
||||
|
||||
@ -13,6 +13,7 @@ use StaticPHP\Util\DirDiff;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
#[Library('ncurses')]
|
||||
#[Library('ncursesw')]
|
||||
class ncurses
|
||||
{
|
||||
#[BuildFor('Darwin')]
|
||||
@ -21,37 +22,48 @@ class ncurses
|
||||
{
|
||||
$dirdiff = new DirDiff(BUILD_BIN_PATH);
|
||||
|
||||
UnixAutoconfExecutor::create($package)
|
||||
$ac = UnixAutoconfExecutor::create($package)
|
||||
->appendEnv([
|
||||
'LDFLAGS' => $toolchain->isStatic() ? '-static' : '',
|
||||
])
|
||||
->configure(
|
||||
'--enable-overwrite',
|
||||
'--with-curses-h',
|
||||
'--enable-pc-files',
|
||||
'--enable-echo',
|
||||
'--disable-widec',
|
||||
'--with-normal',
|
||||
'--with-ticlib',
|
||||
'--without-tests',
|
||||
'--without-dlsym',
|
||||
'--without-debug',
|
||||
'--enable-symlinks',
|
||||
"--bindir={$package->getBinDir()}",
|
||||
"--includedir={$package->getIncludeDir()}",
|
||||
"--libdir={$package->getLibDir()}",
|
||||
"--prefix={$package->getBuildRootPath()}",
|
||||
)
|
||||
]);
|
||||
$wide = $package->getName() === 'ncurses' ? ['--disable-widec'] : [];
|
||||
// Include standard system terminfo paths as fallback so binaries linking this ncurses
|
||||
// (e.g. htop) can find terminfo on any target system without needing TERMINFO_DIRS set.
|
||||
$terminfo_dirs = implode(':', [
|
||||
"{$package->getBuildRootPath()}/share/terminfo",
|
||||
'/etc/terminfo',
|
||||
'/lib/terminfo',
|
||||
'/usr/share/terminfo',
|
||||
]);
|
||||
$ac->configure(
|
||||
'--enable-overwrite',
|
||||
'--with-curses-h',
|
||||
'--enable-pc-files',
|
||||
'--enable-echo',
|
||||
'--with-normal',
|
||||
'--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();
|
||||
$new_files = $dirdiff->getIncrementFiles(true);
|
||||
foreach ($new_files as $file) {
|
||||
@unlink(BUILD_BIN_PATH . '/' . $file);
|
||||
}
|
||||
|
||||
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 share/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);
|
||||
|
||||
foreach ($pkgconf_list as $pkgconf) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user