Skip to content

Commit 911bc74

Browse files
committed
add libedit
1 parent 384ba54 commit 911bc74

File tree

6 files changed

+62
-7
lines changed

6 files changed

+62
-7
lines changed

config/ext.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@
687687
"type": "builtin",
688688
"arg-type": "with-path",
689689
"lib-depends": [
690-
"readline"
690+
"libedit"
691691
],
692692
"target": [
693693
"static"

config/source.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,16 @@
946946
"path": "LICENSE"
947947
}
948948
},
949+
"libedit": {
950+
"type": "filelist",
951+
"url": "https://thrysoee.dk/editline/",
952+
"regex": "/href=\"(?<file>editline-(?<version>[^\"]+)\\.tar\\.gz)\"/",
953+
"provide-pre-built": true,
954+
"license": {
955+
"type": "file",
956+
"path": "COPYING"
957+
}
958+
},
949959
"readline": {
950960
"type": "filelist",
951961
"url": "https://ftp.gnu.org/pub/gnu/readline/",

src/SPC/builder/extension/readline.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ public function patchBeforeConfigure(): bool
2323

2424
public function getUnixConfigureArg(bool $shared = false): string
2525
{
26-
$enable = '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
27-
if ($this->builder->getPHPVersionID() < 84000) {
28-
// the check uses `char rl_pending_input()` instead of `extern int rl_pending_input`, which makes LTO fail
29-
$enable .= ' ac_cv_lib_readline_rl_pending_input=yes';
30-
}
31-
return $enable;
26+
return '--with-libedit=' . BUILD_ROOT_PATH . ' --without-readline';
3227
}
3328

3429
public function buildUnixShared(): void
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\linux\library;
6+
7+
/**
8+
* libedit library class for linux
9+
*/
10+
class libedit extends LinuxLibraryBase
11+
{
12+
use \SPC\builder\unix\library\libedit;
13+
14+
public const NAME = 'libedit';
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\macos\library;
6+
7+
/**
8+
* libedit library class for macOS
9+
*/
10+
class libedit extends MacOSLibraryBase
11+
{
12+
use \SPC\builder\unix\library\libedit;
13+
14+
public const NAME = 'libedit';
15+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\unix\library;
6+
7+
use SPC\util\executor\UnixAutoconfExecutor;
8+
9+
trait libedit
10+
{
11+
protected function build(): void
12+
{
13+
UnixAutoconfExecutor::create($this)
14+
->configure(
15+
'--with-curses'
16+
)
17+
->make();
18+
$this->patchPkgconfPrefix(['libedit.pc']);
19+
}
20+
}

0 commit comments

Comments
 (0)