mk ncurses install its headers namespaced and not (#536)

* mk ncurses install its headers namespaced and not
* adds test for readline
This commit is contained in:
Max Howell 2023-03-10 10:51:03 -05:00 committed by GitHub
parent b38bd2211e
commit 2593cefed7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 6 deletions

View file

@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>
int main() {
printf("%s\\n", readline("test> "));
return 0;
}

View file

@ -4,10 +4,11 @@ distributable:
versions: versions:
#TODO brew has a couple patches we should apply #TODO brew has a couple patches we should apply
- 8.2
- 8.1 - 8.1
dependencies: dependencies:
invisible-island.net/ncurses: 6 invisible-island.net/ncurses: ^6
build: build:
dependencies: dependencies:
@ -18,4 +19,9 @@ build:
make --jobs {{ hw.concurrency }} install make --jobs {{ hw.concurrency }} install
test: 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"

View file

@ -21,9 +21,16 @@ build:
for lib in form menu ncurses panel curses++; do for lib in form menu ncurses panel curses++; do
for ii in $(find . -name lib${lib}w\*); do for ii in $(find . -name lib${lib}w\*); do
# hopefully no new w's will be introduced # 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
done done
# things often expect either no namespace or namespace
cd ../include
mv ncursesw/* .
rmdir ncursesw
ln -sf . ncursesw
env: env:
PCDIR: ${{prefix}}/lib/pkgconfig PCDIR: ${{prefix}}/lib/pkgconfig
ARGS: ARGS:

View file

@ -104,9 +104,6 @@ build:
OPENSSL_INCLUDES: ${{ deps.openssl.org.prefix }}/include OPENSSL_INCLUDES: ${{ deps.openssl.org.prefix }}/include
OPENSSL_LDFLAGS: -L{{ deps.openssl.org.prefix }}/lib 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 pythons modules # required for `setup.py` which is used to detect the libs for pythons modules
diff: | diff: |
diff --git a/setup.py b/setup.py diff --git a/setup.py b/setup.py