#!/bin/bash # Build script for readline # GNU readline library for command line editing set -e cd "$SRCDIR" # Set library path for ncurses (installed under $PREFIX, not /usr) # Note: no tputs cast needed — readline depends on ncurses (build dep), which # uses `int(*)(int)`, matching _rl_output_character_function's signature. export LDFLAGS="-L$PREFIX/lib -R$PREFIX/lib -lncurses" export CPPFLAGS="-I$PREFIX/include -I$PREFIX/include/ncurses" export SHLIB_LIBS="-L$PREFIX/lib -lncursesw" # Configure readline with shared library support ./configure \ --build=$BUILD_TRIPLE \ --host=$BUILD_TRIPLE \ --prefix=$PREFIX \ --libdir=$PREFIX/lib \ --with-curses \ --enable-shared gmake -j${JOBS:-1} gmake install DESTDIR="$PKGDIR" # readline's shobj-conf for illumos installs only libreadline.so.8 with no # libreadline.so symlink, so `-lreadline` falls through to the static archive # (which then needs explicit -lncurses/-ltermcap to resolve tputs/tgetent). # Add the canonical .so → .so.8 symlinks so consumers link dynamically. ln -sf libreadline.so.8 "$PKGDIR$PREFIX/lib/libreadline.so" ln -sf libhistory.so.8 "$PKGDIR$PREFIX/lib/libhistory.so" # readline - GNU readline library # https://tiswww.case.edu/php/chet/readline/rltop.html [package] name = "readline" version = "8.2" release = 1 description = "GNU readline library for command line editing" url = "https://tiswww.case.edu/php/chet/readline/rltop.html" license = "GPL-3.0" maintainer = "Chris Tusa " arch = "x86_64" [dependencies] runtime = ["ncurses"] build = ["ncurses"] [[source]] file = "readline-8.2.tar.gz" urls = ["https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz"] checksum = "3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" [build] parallel = true jobs = 0