# Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Gontran Zepeda <gontran@gontran.net> S=${WORKDIR}/${P} DESCRIPTION="A new ncurses binding for Python." SRC_URI="http://prdownloads.sourceforge.net/pyncurses/pyncurses-0.3.tar.bz2" HOMEPAGE="http://pyncurses.sourceforge.net/" DEPEND="virtual/python >=sys-libs/ncurses-5.2-r3" src_unpack() { unpack ${A} cd ${S} patch -p0 < ${FILESDIR}/${P}-gentoo.diff } src_compile() { python setup.py build || die } src_install() { python setup.py install --root=${D} --prefix=/usr || die dodoc AUTHORS README examples/* }
% cat files/pyncurses-0.3-gentoo.diff --- ncurses/_curses_wrap.c.orig Sat Apr 22 13:52:02 2000 +++ ncurses/_curses_wrap.c Sun Apr 28 16:17:29 2002 @@ -1136,7 +1136,7 @@ extern bool isendwin(); extern bool is_linetouched(WINDOW *,int ); extern bool is_wintouched(WINDOW *); -extern const char *keyname(int ); +//extern const char *keyname(int ); extern int keypad(WINDOW *,bool ); extern char killchar(); extern int leaveok(WINDOW *,bool ); @@ -1147,7 +1147,7 @@ extern int mvwin(WINDOW *,int ,int ); extern int napms(int ); extern WINDOW *newpad(int ,int ); -extern SCREEN *newterm(const char *,FILE *,FILE *); +//extern SCREEN *newterm(const char *,FILE *,FILE *); extern WINDOW *newwin(int ,int ,int ,int ); extern int nl(); extern int nocbreak(); @@ -1197,15 +1197,15 @@ extern int syncok(WINDOW *,bool ); extern chtype termattrs(); extern char *termname(); -extern int tigetflag(const char *); -extern int tigetnum(const char *); -extern char *tigetstr(const char *); +//extern int tigetflag(const char *); +//extern int tigetnum(const char *); +//extern char *tigetstr(const char *); extern int typeahead(int ); extern int ungetch(int ); extern void use_env(bool ); extern int vidattr(chtype ); -extern int vwprintw(WINDOW *,const char *,va_list ); -extern int vwscanw(WINDOW *,const char *,va_list ); +//extern int vwprintw(WINDOW *,const char *,va_list ); +//extern int vwscanw(WINDOW *,const char *,va_list ); extern int waddch(WINDOW *,const chtype ); extern int waddchnstr(WINDOW *,const chtype *,int ); extern int waddnstr(WINDOW *,const char *,int ); --- ncurses/_panel_wrap.c.orig Sat Apr 22 13:52:02 2000 +++ ncurses/_panel_wrap.c Sun Apr 28 16:17:41 2002 @@ -585,8 +585,8 @@ extern PANEL *new_panel(WINDOW *); extern PANEL *panel_above(const PANEL *); extern PANEL *panel_below(const PANEL *); -extern int set_panel_userptr(PANEL *,const void *); -extern const void *panel_userptr(const PANEL *); +//extern int set_panel_userptr(PANEL *,const void *); +//extern const void *panel_userptr(const PANEL *); extern int move_panel(PANEL *,int ,int ); extern int replace_panel(PANEL *,WINDOW *); extern int panel_hidden(const PANEL *);
Fixing typo in SRC_URI. Also, there are some warnings about tuples being created in a depricated fashion in ncurses/curses.py (IIRC) which I don't know how to clean up. hth. # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Gontran Zepeda <gontran@gontran.net> S=${WORKDIR}/${P} DESCRIPTION="A new ncurses binding for Python." SRC_URI="http://prdownloads.sourceforge.net/pyncurses/${P}.tar.bz2" HOMEPAGE="http://pyncurses.sourceforge.net/" DEPEND="virtual/python >=sys-libs/ncurses-5.2-r3" src_unpack() { unpack ${A} cd ${S} patch -p0 < ${FILESDIR}/${P}-gentoo.diff } src_compile() { python setup.py build || die } src_install() { python setup.py install --root=${D} --prefix=/usr || die dodoc AUTHORS README examples/* }
I get an undefined reference to trace from within the library with python 2.2. I'm trying to run the examples found in /usr/share/pyncurses-0.3/
It appears that trace is a debugging routine from ncurses -- possibly available from libncurses_g.a (which doesn't seem to exist on my system with ncurses-5.2-r3). Hoping don't need to modify curses ebuild for this to work -- but on the upside it's a curses debugging, not a core pyncurses, problem I hope. Curses doesn't seem to generate the debugging library -- looking into it.
OK. So if I modify the ncurses ebuild like so: src_compile() { #if [ -z "$DEBUG" ] #then # myconf="${myconf} --without-debug" #fi rm -rf test removing the --without-debug option for ./configure, libncurses_g.a is created. WHERE is DEBUG set anyway? This is fairly serious for pyncurses ebuild, since the trace call is explicitly an 'extern' type in _curses.c ... Maybe have an alternate ncurses-debugging ebuild which only builds and copies the libncurses_g.a lib to /usr/lib and is required by pyncurses? OK. Sorry, I've been writing this while fixing. IF I build and install the debugging curses library AND IF I use this modified pyncurses-gentoo patch (attached). The demo works! w00t! Question is how to get debugging lib for ncurses. help please. :) Here's the additional piece of diff: --- setup.py.orig Mon Apr 29 00:52:14 2002 +++ setup.py Mon Apr 29 00:52:29 2002 @@ -40,7 +40,7 @@ ext_modules = [('ncurses._curses', { 'sources': ['ncurses/_curses_wrap.c'], - 'libraries': ['ncurses'] + 'libraries': ['ncurses', 'ncurses_g'] }), ('ncurses._panel', { 'sources': ['ncurses/_panel_wrap.c'],
this fix requires both debug and release versions of ncurses installed. pyncurses hasn't been updated for two years. Maybe it's time to add optional debug support to the library.
Right there. Closing.
Created attachment 81823 [details, diff] Revised Gentoo Patchfile
Created attachment 81824 [details] ebuild for revised patch