diff --git a/config/ext.json b/config/ext.json index 1ef704a2..5a29d583 100644 --- a/config/ext.json +++ b/config/ext.json @@ -235,13 +235,9 @@ }, "readline": { "type": "builtin", - "arg-type": "with", + "arg-type": "with-prefix", "lib-depends": [ "readline" - ], - "lib-suggests": [ - "libedit", - "ncurses" ] }, "redis": { diff --git a/config/lib.json b/config/lib.json index e79a1036..c1e871a5 100644 --- a/config/lib.json +++ b/config/lib.json @@ -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": [ diff --git a/config/source.json b/config/source.json index 86eeaf86..144b7015 100644 --- a/config/source.json +++ b/config/source.json @@ -41,6 +41,24 @@ "path": "LICENSE" } }, + "ncurses": { + "type": "filelist", + "url": "https://ftp.gnu.org/pub/gnu/ncurses/", + "regex": "/href=\"(?ncurses-(?[^\"]+)\\.tar\\.gz)\"/", + "license": { + "type": "file", + "path": "COPYING" + } + }, + "readline": { + "type": "filelist", + "url": "https://ftp.gnu.org/pub/gnu/readline/", + "regex": "/href=\"(?readline-(?[^\"]+)\\.tar\\.gz)\"/", + "license": { + "type": "file", + "path": "COPYING" + } + }, "ext-zstd": { "type": "git", "path": "php-src/ext/zstd", diff --git a/ext-support.md b/ext-support.md index cd57d2dd..f4e11210 100644 --- a/ext-support.md +++ b/ext-support.md @@ -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 | | diff --git a/src/SPC/builder/macos/library/ncurses.php b/src/SPC/builder/macos/library/ncurses.php new file mode 100644 index 00000000..7c362730 --- /dev/null +++ b/src/SPC/builder/macos/library/ncurses.php @@ -0,0 +1,15 @@ +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'); + } +} diff --git a/src/SPC/builder/unix/library/readline.php b/src/SPC/builder/unix/library/readline.php new file mode 100644 index 00000000..31ea26aa --- /dev/null +++ b/src/SPC/builder/unix/library/readline.php @@ -0,0 +1,25 @@ +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']); + } +}