fix(readline)

linux doesn't show the ncurses linkage
This commit is contained in:
Jacob Heider 2023-12-16 21:37:17 -05:00 committed by Jacob Heider
parent 45ba1857c3
commit 2e88145e8c

View file

@ -14,12 +14,21 @@ dependencies:
invisible-island.net/ncurses: ^6 invisible-island.net/ncurses: ^6
build: build:
script: | script:
./configure --prefix={{ prefix }} --with-curses - ./configure --prefix={{ prefix }} --with-curses
make --jobs {{ hw.concurrency }} install - make --jobs {{ hw.concurrency }} install
env:
linux:
# otherwise it weirdly omits the linkage
# https://stackoverflow.com/a/65623630
LDFLAGS: '$LDFLAGS -lncursesw'
test: test:
script: | - run: ldd {{prefix}}/lib/libreadline.so | grep ncurses
cc -lreadline -lncurses fixture.c if: linux
- run: otool -L {{prefix}}/lib/libreadline.dylib | grep ncurses
if: darwin
- cc -lreadline -lncurses fixture.c
- |
test "$(echo "Hello, World!" | ./a.out)" = "test> Hello, World! test "$(echo "Hello, World!" | ./a.out)" = "test> Hello, World!
Hello, World!\\n" Hello, World!\\n"