Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: ncurses: more pkg-config files?
To:
Stuart Henderson <stu@spacehopper.org>
Cc:
tech@openbsd.org
Date:
Wed, 28 Jan 2026 17:18:42 +0100

Download raw body.

Thread
On Tue, Jan 27, 2026 at 10:36:51AM +0000, Stuart Henderson wrote:
> For 7.7 I added a pkg-config file for curses (ncurses.pc) because some
> ports were not picking it up correctly (notably Python).
> 
> I've now run into a problem where some Python functions are disabled
> because it thinks we don't have ncursesw so I'd like to add at least
> a pkg-config file for that.
> 
> A build of ncurses from the normal upstream distribution also gives
> pkg-config files for the other libraries (form/formw, menu/menuw,
> panel/panelw) as well as those for the libraries that we don't
> provide - ncurses++/ncurses++w, tic, tinfo.
> 
> I'm wondering whether it would just make sense to add the .pc file
> that I've identified a need for, or proactively do the others as well.
> Any thoughts?

I can't think of a downside to install them all, except possibly a bit
of ports churn when we add them. They're tiny, easy to maintain and
might well save some easily avoidable headache down the road (similar
to the cplay case below).

> (I have a ports infrastructure diff to log pkg-config calls; I'll use
> it on my next i386 bulk build to see what's actually looking for it).

I'm ok with moving forward with the diff below unless your bulk ran into
anything.

> If we just want the pc file for ncursesw, here's a possible diff and
> test method. (The others are trivial to add too of course, the question
> is identifying which ones we want).
> 
> To test in Python, remove the BROKEN marker from audio/cplay and
> build/install, run it, cursor down -> crash because getwch is not
> available. Apply the diff or create /usr/lib/pkgconfig/ncursesw.pc
> by hand then rebuild and reinstall lang/python/3 and retry cplay,
> it will start working.

Confirmed.

> 
> $ cat << EOF | doas tee /usr/lib/pkgconfig/ncursesw.pc
> prefix=/usr
> exec_prefix=${prefix}
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
> abi_version=6
> major_version=6
> version=6.4.20230826
> 
> Name: ncursesw
> Description: ncursesw library
> Version: 6.4.20230826
> Requires.private:
> Libs: -lncurses
> Cflags:
> EOF
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/src/lib/libcurses/Makefile,v
> diff -u -p -r1.77 Makefile
> --- Makefile	21 Feb 2025 18:16:45 -0000	1.77
> +++ Makefile	27 Jan 2026 10:18:43 -0000
> @@ -73,7 +73,7 @@ MAN=	curs_add_wch.3 curs_add_wchstr.3 cu
>  GENERATED= codes.c comp_captab.c comp_userdefs.c expanded.c fallback.c \
>  	init_keytry.h keys.list lib_gen.c lib_keyname.c make_hash make_keys \
>  	names.c unctrl.c
> -PC_FILES= ncurses.pc
> +PC_FILES= ncurses.pc ncursesw.pc
> 
>  CAPLIST	= ${.CURDIR}/Caps
>  USE_BIG_STRINGS	= 1
> Index: generate_pkgconfig.sh
> ===================================================================
> RCS file: /cvs/src/lib/libcurses/generate_pkgconfig.sh,v
> diff -u -p -r1.1 generate_pkgconfig.sh
> --- generate_pkgconfig.sh	21 Feb 2025 18:16:45 -0000	1.1
> +++ generate_pkgconfig.sh	27 Jan 2026 10:18:43 -0000
> @@ -75,3 +75,21 @@ Requires.private:
>  Libs: -lncurses
>  Cflags:
>  __EOF__
> +
> +pc_file="${objdir}/ncursesw.pc"
> +cat > ${pc_file} << __EOF__
> +prefix=/usr
> +exec_prefix=\${prefix}
> +libdir=\${exec_prefix}/lib
> +includedir=\${prefix}/include
> +abi_version=${abi_version}
> +major_version=${abi_version}
> +version=${lib_version}
> +
> +Name: ncursesw
> +Description: ncursesw library
> +Version: ${lib_version}
> +Requires.private:
> +Libs: -lncursesw
> +Cflags:
> +__EOF__
>