From 2593cefed7df27f57f43353371e337d9e465cd48 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 10 Mar 2023 10:51:03 -0500 Subject: [PATCH] mk ncurses install its headers namespaced and not (#536) * mk ncurses install its headers namespaced and not * adds test for readline --- projects/gnu.org/readline/fixture.c | 7 +++++++ projects/gnu.org/readline/package.yml | 10 ++++++++-- projects/invisible-island.net/ncurses/package.yml | 9 ++++++++- projects/python.org/package.yml | 3 --- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 projects/gnu.org/readline/fixture.c diff --git a/projects/gnu.org/readline/fixture.c b/projects/gnu.org/readline/fixture.c new file mode 100644 index 00000000..5b769d94 --- /dev/null +++ b/projects/gnu.org/readline/fixture.c @@ -0,0 +1,7 @@ +#include +#include +#include +int main() { + printf("%s\\n", readline("test> ")); + return 0; +} diff --git a/projects/gnu.org/readline/package.yml b/projects/gnu.org/readline/package.yml index b23a2cd2..cbf21bec 100644 --- a/projects/gnu.org/readline/package.yml +++ b/projects/gnu.org/readline/package.yml @@ -4,10 +4,11 @@ distributable: versions: #TODO brew has a couple patches we should apply + - 8.2 - 8.1 dependencies: - invisible-island.net/ncurses: 6 + invisible-island.net/ncurses: ^6 build: dependencies: @@ -18,4 +19,9 @@ build: make --jobs {{ hw.concurrency }} install test: - script: true #FIXME + dependencies: + tea.xyz/gx/cc: c99 + script: | + cc -lreadline -lncurses fixture.c + test "$(echo "Hello, World!" | ./a.out)" = "test> Hello, World! + Hello, World!\\n" diff --git a/projects/invisible-island.net/ncurses/package.yml b/projects/invisible-island.net/ncurses/package.yml index 6a4ad83b..4cd4cdb8 100644 --- a/projects/invisible-island.net/ncurses/package.yml +++ b/projects/invisible-island.net/ncurses/package.yml @@ -21,9 +21,16 @@ build: for lib in form menu ncurses panel curses++; do for ii in $(find . -name lib${lib}w\*); do # hopefully no new w's will be introduced - ln -s $ii $(echo $ii | tr -d w) + ln -sf $ii $(echo $ii | tr -d w) done done + + # things often expect either no namespace or namespace + cd ../include + mv ncursesw/* . + rmdir ncursesw + ln -sf . ncursesw + env: PCDIR: ${{prefix}}/lib/pkgconfig ARGS: diff --git a/projects/python.org/package.yml b/projects/python.org/package.yml index 6abed368..8d9771d0 100644 --- a/projects/python.org/package.yml +++ b/projects/python.org/package.yml @@ -104,9 +104,6 @@ build: OPENSSL_INCLUDES: ${{ deps.openssl.org.prefix }}/include OPENSSL_LDFLAGS: -L{{ deps.openssl.org.prefix }}/lib - #FIXME we should get the include path from the ncurses `.pc` files - CPATH: ${{ deps.invisible-island.net/ncurses.prefix }}/include/ncursesw:$CPATH - # required for `setup.py` which is used to detect the libs for python’s modules diff: | diff --git a/setup.py b/setup.py