# vim: ft=make ts=4 sw=4 noet
NAME    = ncurses
VERSION = 6.5
GARTYPE = v2

MASTER_SITES = http://invisible-island.net/archives/ncurses/
DISTFILES   += $(DISTNAME).tar.gz

LICENSE = COPYING

PACKAGES                  += OZSWncurses
SPKG_DESC_OZSWncurses      = GNU ncurses terminal library
CATALOGNAME_OZSWncurses    = ncurses

# Keep static libs (many packages link ncurses statically)
MERGE_EXCLUDE_STATICLIBS =

EXTRA_CONFIGURE_ARGS += --with-shared
EXTRA_CONFIGURE_ARGS += --without-debug
EXTRA_CONFIGURE_ARGS += --enable-pc-files
EXTRA_CONFIGURE_ARGS += --with-pkg-config-libdir=$(libdir)/pkgconfig
# Wide-char support (libncursesw) — needed by modern readline/bash
EXTRA_CONFIGURE_ARGS += --enable-widec
# Avoid conflicting with Solaris /usr/lib/libcurses
EXTRA_CONFIGURE_ARGS += --without-ada
# Solaris: use unsigned for ospeed type
EXTRA_CONFIGURE_ARGS += --with-ospeed=unsigned

# Fix libtool ECHO="print -r --" (ksh93 builtin, fails under bash)
post-configure:
	@if [ -f $(WORKSRC)/libtool ]; then \
	    find $(WORKSRC) -name "libtool" -type f -exec \
	        gsed -i 's/ECHO="print -r --"/ECHO="printf %s\\n"/g' {} \; ; \
	fi
	@$(MAKECOOKIE)

include gar/category.mk
