Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #12605 (new defect)

Opened 12 months ago

Last modified 10 months ago

BUG: devel/ncurses does not provide libcurses and <curses.h>

Reported by: master@… Owned by: imajes@…
Priority: Normal Milestone: Port Bugs
Component: ports Version: 1.5.0
Keywords: Cc: imajes@…, mww@…, pipping@…, nox@…
Port:

Description

As of now, if an applications is trying to use curses "by the book", #include <curses.h> and -lcurses, then system (not macports) library is used, since libcurses symlink is not created in /opt/local/lib and curses.h is not in /opt/local/include.

But IMHO the whole idea of having both wide and not-wide ncurses is BAD. The bug report #6602 was complaining about incorrect _naming_ of libraries, but the fix brought us two sets of headers (wide being compatible extension of normal) and two sets of libraries (they are binary incompatible, but appications using non-wide API can be linked against wide libraries without modification). I think the better approach is that of Apple (as can be seen at http://www.opensource.apple.com/darwinsource/10.4.9.ppc/ncurses-15/Makefile ) - install wide version of ncurses as libncurses (without w suffix). The approach in the attached Portfile-new is even better

  • install libncursesw and create symlinks libcurses and libncurses.

In this way we do not create a new portability obstacle, the canonical -lcurses works, and avoid extra work configuring/patching programs that for some reason want -lncurses or -lncursesw.

As a second-best solution I attach patches for two now existing Portfiles (ncurses and ncursesw), to put headers into /opt/local/include and make the libcurses symlink to libncurses. But in this case an application linking -lcurses and wishing to use wide API won't be happy.

The termcap-related additions are there to mimic how Apple configures system ncurses.

Attachments

Portfile-new (2.0 kB) - added by master@… 12 months ago.
Proposed new port to replace ncurse and ncursesw
patch-ncurses-Portfile (0.9 kB) - added by master@… 12 months ago.
do not install headers and make libcurses symlink
patch-ncursesw-Portfile (434 bytes) - added by master@… 12 months ago.
install headers to /opt/local/include
Portfile (456 bytes) - added by master@… 10 months ago.
Portfile for a test port for Ryan
tclock-1.tar.gz (2.4 kB) - added by master@… 10 months ago.
test program for Ryan

Change History

Changed 12 months ago by master@…

Proposed new port to replace ncurse and ncursesw

Changed 12 months ago by master@…

do not install headers and make libcurses symlink

Changed 12 months ago by master@…

install headers to /opt/local/include

Changed 11 months ago by master@…

Anybody there?

Changed 10 months ago by nox@…

  • cc imajes@…, nox@… added

Changed 10 months ago by ryandesign@…

This sounds fine in theory, I'd like to see an actual port that demonstrates the problem. A port which, with the *curses* ports the way they are, visibly links against the system's libraries (visible with otool -L I suppose) but links with MacPorts libraries using your new port, or your patches. Preferably your example port would be small and not have many other dependencies. I don't mean you need to create an example port; I mean, presumably you were originally trying to install some other software and you noticed it linked against the wrong curses libraries. What was that other software?

Changed 10 months ago by master@…

Dear Ryan,

here is the test port you wanted, but really in boils down to a program with

#include <curses.h> /* as per ncurses(3) */

and compiled as cc -o progname -I/opt/local/include -L/opt/local/lib -lcurses progname.c

uses system header files and libraries.

Comment: (Although ncurses(3) says one must link with -lncurses,

in personal communication author of ncurses states that

====

How would the ideal world without workarounds for other workarounds for ancient bugs look like?

#include <curses.h>

-lcurses

(but the non-ideal world has different implementations and versions of curses) ===== Also "The Single UNIX ® Specification" says -lcurses ;)

Changed 10 months ago by master@…

Portfile for a test port for Ryan

Changed 10 months ago by master@…

test program for Ryan

Changed 10 months ago by master@…

Ryan wrote

you were originally trying to install some other software and you noticed it linked against the wrong curses libraries. What was that other software?

Irrelevant, since 1) I have not ported it yet (waiting for the ncurses problem to be sorted out and TeXLive to become base TeX port) 2) Sent a patch to the developer to look for ncurses before curses and it was accepted.

Note: See TracTickets for help on using tickets.