Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2204 - pyncurses-0.3.ebuild (New Ebuild)
Summary: pyncurses-0.3.ebuild (New Ebuild)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Ryan Phillips (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-28 18:30 UTC by Gontran Zepeda
Modified: 2006-03-10 02:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Revised Gentoo Patchfile (pyncurses-0.3-gentoo-r1.diff,3.13 KB, patch)
2006-03-10 01:58 UTC, joern
Details | Diff
ebuild for revised patch (pyncurses-0.3-r1.ebuild,709 bytes, text/plain)
2006-03-10 02:01 UTC, joern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gontran Zepeda 2002-04-28 18:30:05 UTC
# 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/*
}
Comment 1 Gontran Zepeda 2002-04-28 18:31:19 UTC
% 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 *);
Comment 2 Gontran Zepeda 2002-04-29 01:19:21 UTC
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/*
}
Comment 3 Ryan Phillips (RETIRED) gentoo-dev 2002-04-29 01:53:32 UTC
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/
Comment 4 Gontran Zepeda 2002-04-29 02:35:48 UTC
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.
Comment 5 Gontran Zepeda 2002-04-29 02:54:30 UTC
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'],
Comment 6 Ryan Phillips (RETIRED) gentoo-dev 2002-04-30 01:40:54 UTC
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.
Comment 7 Gontran Zepeda 2002-04-30 10:37:37 UTC
Right there.  Closing.
Comment 8 joern 2006-03-10 01:58:16 UTC
Created attachment 81823 [details, diff]
Revised Gentoo Patchfile
Comment 9 joern 2006-03-10 02:01:44 UTC
Created attachment 81824 [details]
ebuild for revised patch