* [gentoo-dev] python ebuild: use tcltk
@ 2001-06-24 23:42 Tod M. Neidt
2001-06-24 23:55 ` Daniel Robbins
2001-06-24 23:57 ` [gentoo-dev] premature posting :) Tod M. Neidt
0 siblings, 2 replies; 9+ messages in thread
From: Tod M. Neidt @ 2001-06-24 23:42 UTC (permalink / raw
To: gentoo-dev@cvs.gentoo.org
[-- Attachment #1: Type: text/plain, Size: 827 bytes --]
Hi!
Attached is a modified python ebuild (python-2.0-r4.ebuild) that will
include the tkinter module if USE tcltk is set. I made three changes.
First, Modules/Setup.in is sed'ed to uncomment the relevant tkinter
lines if USE tcltk is set.
Second, if USE tcltk is set, then idle is also installed in
/usr/lib/python2.0/tools with a symlink of idle.py into /usr/bin
Third, the Makefile that is installed in /usr/lib/python2.0/config is
sed'ed to put the value of CFLAGS from /etc/make.conf into the OPT
variable. This appears to be the Makefile that the setup.py from
distutils calls when building and installing the python module
extensions for any modules installed later. Note: there is probably a
better way to do it such as putting OPT=$CFLAGS instead of the actual
value.
Constructive criticism is appreciated.
tod
[-- Attachment #2: python-2.0-r4.ebuild --]
[-- Type: text/plain, Size: 4696 bytes --]
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Daniel Robbins <drobbins@gentoo.org>
# Modified Tod M. Neidt <tneidt@fidnet.com>
# /home/cvsroot/gentoo-x86/dev-lang/python/python-2.0-r4.ebuild,v 1.1 2001/06/04 19:49:02 drobbins Exp
S=${WORKDIR}/Python-2.0
S2=${WORKDIR}/python-fchksum-1.1
DESCRIPTION="A really great language"
SRC_URI="http://www.python.org/ftp/python/src/BeOpen-Python-2.0.tar.bz2
http://www.azstarnet.com/~donut/programs/fchksum/python-fchksum-1.1.tar.gz"
HOMEPAGE="http://www.python.org http://www.azstarnet.com/~donut/programs/fchksum/"
#tcltk depends is = becasue need to automate tcltk version number below
DEPEND="virtual/glibc >=sys-libs/zlib-1.1.3
readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
berkdb? ( >=sys-libs/db-3 )
tcltk? ( >=dev-lang/tcl-tk-8.0 )"
RDEPEND="$DEPEND"
PROVIDE="virtual/python-2.0"
src_unpack() {
unpack BeOpen-Python-2.0.tar.bz2
cd ${S}/Modules
if [ "`use readline`" ]
then
sed -e 's/#readline/readline/' -e 's/-lreadline -ltermcap/-lreadline/' \
-e 's/#_curses _cursesmodule.c -lcurses -ltermcap/_curses _cursesmodule.c -lncurses/' \
-e 's/#crypt/crypt/' -e 's/# -lcrypt/-lcrypt/' \
Setup.in > Setup.new
mv Setup.new Setup.in
fi
#Added check for tcltk USE variable, if set build _tkinter
#Need to automate tk and tcl version determination
if [ "`use tcltk`" ]
then
sed -e 's:# _tkinter:_tkinter:' \
-e 's:#[[:blank:]]*-I/usr/local/include:-I/usr/include:' \
-e 's:#[[:blank:]]*-I/usr/X11R6/include:-I/usr/X11R6/include:' \
-e 's:#[[:blank:]]*-L/usr/local/lib:-L/usr/lib:' \
-e 's:#[[:blank:]]*-ltk8.0 -ltcl8.0:-ltk8.4 -ltcl8.4:' \
-e 's:#[[:blank:]]*-L/usr/X11R6/lib:-L/usr/X11R6/lib:' \
-e 's:#[[:blank:]]-lX11:-lX11:' \
Setup.in > Setup.new
mv Setup.new Setup.in
fi
if [ "`use berkdb`" ]
then
sed -e 's:#dbm.*:dbm dbmmodule.c -I/usr/include/db3 -ldb-3.2:' \
Setup.in > Setup.new
mv Setup.new Setup.in
fi
#Removed the commenting out of TKPATH
sed -e 's/#_locale/_locale/' \
-e 's/#syslog/syslog/' \
-e 's:#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz:zlib zlibmodule.c -lz:' \
-e 's:^#termios:termios:' -e 's:^#resource:resource:' \
Setup.in > Setup
echo "fchksum fchksum.c md5_2.c" >> Setup
cd ${S}/Modules
if [ "`use berkdb`" ]
then
#patch the dbmmodule to use db3's dbm compatibility code. That way, we're depending on db3 rather than
#old db1. We'll link with db3, of course.
cp dbmmodule.c dbmmodule.c.orig
sed -e '10,25d' -e '26i\' -e '#define DB_DBM_HSEARCH 1\' -e 'static char *which_dbm = "BSD db";\' -e '#include <db3/db.h>' dbmmodule.c.orig > dbmmodule.c
fi
cp ${FILESDIR}/pfconfig.h .
unpack python-fchksum-1.1.tar.gz
cd python-fchksum-1.1
mv md5.h ../md5_2.h
sed -e 's:"md5.h":"md5_2.h":' md5.c > ../md5_2.c
sed -e 's:"md5.h":"md5_2.h":' fchksum.c > ../fchksum.c
#for some reason, python 2.0 can't find /usr/lib/python2.0 without this fix to the source code.
cd ${S}/Python
cp pythonrun.c pythonrun.c.orig
sed -e 's:static char \*default_home = NULL:static char \*default_home = "/usr":' pythonrun.c.orig > pythonrun.c
}
src_compile() {
cd ${S}
try ./configure --prefix=/usr --without-libdb
#libdb3 support is available from http://pybsddb.sourceforge.net/; the one
#included with python is for db 1.85 only.
cp Makefile Makefile.orig
sed -e "s/-g -O2/${CFLAGS}/" Makefile.orig > Makefile
cd ${S}/Modules
cp Makefile.pre Makefile.orig
sed -e "s:MODOBJS=:MODOBJS=fchksum.o md5_2.o:" \
Makefile.orig > Makefile.pre
# Parallel make does not work
cd ${S}
try make
}
src_install() {
dodir /usr
try make install prefix=${D}/usr
rm ${D}/usr/bin/python
dosym python2.0 /usr/bin/python
dodoc README
#Change OPT setting in /usr/lib/python2.0/config/Makefile
#to CFLAG from /etc/make.conf so optimaization is set for
#subsequent module installs using distutil.
#There is probably a better way :)
cd ${D}/usr/lib/python2.0/config
sed -e "s/OPT=[[:blank:]]*-g -O2 -Wall -Wstrict-prototypes/OPT= ${CFLAGS}/" \ Makefile > Makefile.new
mv Makefile.new Makefile
#If USE tcltk lets install idle
#Need to script the python version in the path
if [ "`use tcltk`" ]
then
mkdir ${D}/usr/lib/python2.0/tools
cd ${S}
mv Tools/idle ${D}/usr/lib/python2.0/tools/
cd ${D}/usr
#don't quit understand dosym; put idle in PATH
ln -s lib/python2.0/tools/idle/idle.py bin/idle.py
fi
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] python ebuild: use tcltk
2001-06-24 23:42 [gentoo-dev] python ebuild: use tcltk Tod M. Neidt
@ 2001-06-24 23:55 ` Daniel Robbins
2001-07-07 9:34 ` Achim Gottinger
2001-06-24 23:57 ` [gentoo-dev] premature posting :) Tod M. Neidt
1 sibling, 1 reply; 9+ messages in thread
From: Daniel Robbins @ 2001-06-24 23:55 UTC (permalink / raw
To: gentoo-dev
On Mon, Jun 25, 2001 at 12:43:53AM -0500, Tod M. Neidt wrote:
> Hi!
>
> Attached is a modified python ebuild (python-2.0-r4.ebuild) that will
> include the tkinter module if USE tcltk is set. I made three changes.
Have you tested it with *and* without tcltk set in USE, and does it compile
OK in both instances? If so, I'll give it quick test over here and if it goes
ok, I'll add it to cvs.
Thanks :)
--
Daniel Robbins <drobbins@gentoo.org>
President/CEO http://www.gentoo.org
Gentoo Technologies, Inc.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] premature posting :)
2001-06-24 23:42 [gentoo-dev] python ebuild: use tcltk Tod M. Neidt
2001-06-24 23:55 ` Daniel Robbins
@ 2001-06-24 23:57 ` Tod M. Neidt
2001-06-25 0:18 ` Daniel Robbins
1 sibling, 1 reply; 9+ messages in thread
From: Tod M. Neidt @ 2001-06-24 23:57 UTC (permalink / raw
To: gentoo-dev
Hi!
It seems I suffered from a bad case of premature posting.
The the python ebuild I posted will result in a dead link for idle.py in
/usr/bin.
Can someone enlighten me as to how to use the dosym command to do it
correctly?
Otherwise the ebuild is fine. The symlink can be corrected by:
rm /usr/bin/idle.py
ln -s /usr/lib/python2.0/tools/idle/idle.py /usr/bin/idle.py
tod
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] premature posting :)
2001-06-24 23:57 ` [gentoo-dev] premature posting :) Tod M. Neidt
@ 2001-06-25 0:18 ` Daniel Robbins
2001-06-25 1:23 ` Tod M. Neidt
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Robbins @ 2001-06-25 0:18 UTC (permalink / raw
To: gentoo-dev
On Mon, Jun 25, 2001 at 12:58:53AM -0500, Tod M. Neidt wrote:
> Can someone enlighten me as to how to use the dosym command to do it
> correctly?
dosym works just like ln -s, except that it prepends ${D} to the target.
Hope that helps,
--
Daniel Robbins <drobbins@gentoo.org>
President/CEO http://www.gentoo.org
Gentoo Technologies, Inc.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] premature posting :)
2001-06-25 0:18 ` Daniel Robbins
@ 2001-06-25 1:23 ` Tod M. Neidt
2001-06-25 12:38 ` Daniel Robbins
0 siblings, 1 reply; 9+ messages in thread
From: Tod M. Neidt @ 2001-06-25 1:23 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
Hi!
Here is a revise ebuild for python using tcltk. It merges ok with and
without USE tcltk set. The idle symlink is fixed although I still don't
get dosym. What is the dosym equivalent of ln -s
/usr/lib/python2.0/tools/idle/idle.py ${D}/usr/bin/idle.py
Constructive criticism is appreciated
tod
[-- Attachment #2: python-2.0-r4.ebuild --]
[-- Type: text/plain, Size: 4698 bytes --]
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Daniel Robbins <drobbins@gentoo.org>
# Modified Tod M. Neidt <tneidt@fidnet.com>
# /home/cvsroot/gentoo-x86/dev-lang/python/python-2.0-r4.ebuild,v 1.1 2001/06/04 19:49:02 drobbins Exp
S=${WORKDIR}/Python-2.0
S2=${WORKDIR}/python-fchksum-1.1
DESCRIPTION="A really great language"
SRC_URI="http://www.python.org/ftp/python/src/BeOpen-Python-2.0.tar.bz2
http://www.azstarnet.com/~donut/programs/fchksum/python-fchksum-1.1.tar.gz"
HOMEPAGE="http://www.python.org http://www.azstarnet.com/~donut/programs/fchksum/"
#tcltk depends is = becasue need to automate tcltk version number below
DEPEND="virtual/glibc >=sys-libs/zlib-1.1.3
readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
berkdb? ( >=sys-libs/db-3 )
tcltk? ( >=dev-lang/tcl-tk-8.0 )"
RDEPEND="$DEPEND"
PROVIDE="virtual/python-2.0"
src_unpack() {
unpack BeOpen-Python-2.0.tar.bz2
cd ${S}/Modules
if [ "`use readline`" ]
then
sed -e 's/#readline/readline/' -e 's/-lreadline -ltermcap/-lreadline/' \
-e 's/#_curses _cursesmodule.c -lcurses -ltermcap/_curses _cursesmodule.c -lncurses/' \
-e 's/#crypt/crypt/' -e 's/# -lcrypt/-lcrypt/' \
Setup.in > Setup.new
mv Setup.new Setup.in
fi
#Added check for tcltk USE variable, if set build _tkinter
#Need to automate tk and tcl version determination
if [ "`use tcltk`" ]
then
sed -e 's:# _tkinter:_tkinter:' \
-e 's:#[[:blank:]]*-I/usr/local/include:-I/usr/include:' \
-e 's:#[[:blank:]]*-I/usr/X11R6/include:-I/usr/X11R6/include:' \
-e 's:#[[:blank:]]*-L/usr/local/lib:-L/usr/lib:' \
-e 's:#[[:blank:]]*-ltk8.0 -ltcl8.0:-ltk8.4 -ltcl8.4:' \
-e 's:#[[:blank:]]*-L/usr/X11R6/lib:-L/usr/X11R6/lib:' \
-e 's:#[[:blank:]]-lX11:-lX11:' \
Setup.in > Setup.new
mv Setup.new Setup.in
fi
if [ "`use berkdb`" ]
then
sed -e 's:#dbm.*:dbm dbmmodule.c -I/usr/include/db3 -ldb-3.2:' \
Setup.in > Setup.new
mv Setup.new Setup.in
fi
#Removed the commenting out of TKPATH
sed -e 's/#_locale/_locale/' \
-e 's/#syslog/syslog/' \
-e 's:#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz:zlib zlibmodule.c -lz:' \
-e 's:^#termios:termios:' -e 's:^#resource:resource:' \
Setup.in > Setup
echo "fchksum fchksum.c md5_2.c" >> Setup
cd ${S}/Modules
if [ "`use berkdb`" ]
then
#patch the dbmmodule to use db3's dbm compatibility code. That way, we're depending on db3 rather than
#old db1. We'll link with db3, of course.
cp dbmmodule.c dbmmodule.c.orig
sed -e '10,25d' -e '26i\' -e '#define DB_DBM_HSEARCH 1\' -e 'static char *which_dbm = "BSD db";\' -e '#include <db3/db.h>' dbmmodule.c.orig > dbmmodule.c
fi
cp ${FILESDIR}/pfconfig.h .
unpack python-fchksum-1.1.tar.gz
cd python-fchksum-1.1
mv md5.h ../md5_2.h
sed -e 's:"md5.h":"md5_2.h":' md5.c > ../md5_2.c
sed -e 's:"md5.h":"md5_2.h":' fchksum.c > ../fchksum.c
#for some reason, python 2.0 can't find /usr/lib/python2.0 without this fix to the source code.
cd ${S}/Python
cp pythonrun.c pythonrun.c.orig
sed -e 's:static char \*default_home = NULL:static char \*default_home = "/usr":' pythonrun.c.orig > pythonrun.c
}
src_compile() {
cd ${S}
try ./configure --prefix=/usr --without-libdb
#libdb3 support is available from http://pybsddb.sourceforge.net/; the one
#included with python is for db 1.85 only.
cp Makefile Makefile.orig
sed -e "s/-g -O2/${CFLAGS}/" Makefile.orig > Makefile
cd ${S}/Modules
cp Makefile.pre Makefile.orig
sed -e "s:MODOBJS=:MODOBJS=fchksum.o md5_2.o:" \
Makefile.orig > Makefile.pre
# Parallel make does not work
cd ${S}
try make
}
src_install() {
dodir /usr
try make install prefix=${D}/usr
rm ${D}/usr/bin/python
dosym python2.0 /usr/bin/python
dodoc README
#Change OPT setting in /usr/lib/python2.0/config/Makefile
#to CFLAG from /etc/make.conf so optimaization is set for
#subsequent module installs using distutil.
#There is probably a better way :)
cd ${D}/usr/lib/python2.0/config
sed -e "s/OPT=[[:blank:]]*-g -O2 -Wall -Wstrict-prototypes/OPT= ${CFLAGS}/" \ Makefile > Makefile.new
mv Makefile.new Makefile
#If USE tcltk lets install idle
#Need to script the python version in the path
if [ "`use tcltk`" ]
then
mkdir ${D}/usr/lib/python2.0/tools
cd ${S}
mv Tools/idle ${D}/usr/lib/python2.0/tools/
#don't quit understand dosym; put idle in PATH
ln -s /usr/lib/python2.0/tools/idle/idle.py ${D}/usr/bin/idle.py
fi
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] premature posting :)
2001-06-25 1:23 ` Tod M. Neidt
@ 2001-06-25 12:38 ` Daniel Robbins
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Robbins @ 2001-06-25 12:38 UTC (permalink / raw
To: gentoo-dev
On Mon, Jun 25, 2001 at 02:24:52AM -0500, Tod M. Neidt wrote:
> Here is a revise ebuild for python using tcltk. It merges ok with and
> without USE tcltk set. The idle symlink is fixed although I still don't
> get dosym. What is the dosym equivalent of ln -s
> /usr/lib/python2.0/tools/idle/idle.py ${D}/usr/bin/idle.py
dosym /usr/lib/python2.0/tools/idle/idle.py /usr/bin/idle.py
:)
You can use ln -s with ${D} if you prefer; that's legal too.
--
Daniel Robbins <drobbins@gentoo.org>
President/CEO http://www.gentoo.org
Gentoo Technologies, Inc.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] python ebuild: use tcltk
2001-06-24 23:55 ` Daniel Robbins
@ 2001-07-07 9:34 ` Achim Gottinger
2001-07-07 14:31 ` Achim Gottinger
0 siblings, 1 reply; 9+ messages in thread
From: Achim Gottinger @ 2001-07-07 9:34 UTC (permalink / raw
To: gentoo-dev
Daniel Robbins wrote:
>
> On Mon, Jun 25, 2001 at 12:43:53AM -0500, Tod M. Neidt wrote:
> > Hi!
> >
> > Attached is a modified python ebuild (python-2.0-r4.ebuild) that will
> > include the tkinter module if USE tcltk is set. I made three changes.
>
> Have you tested it with *and* without tcltk set in USE, and does it compile
> OK in both instances? If so, I'll give it quick test over here and if it goes
> ok, I'll add it to cvs.
>
> Thanks :)
Well someone must fix all the packages that had to be hacked manually in
the past to work with all
combinations of USE flags for python.
bye achim~
>
> --
> Daniel Robbins <drobbins@gentoo.org>
> President/CEO http://www.gentoo.org
> Gentoo Technologies, Inc.
>
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@cvs.gentoo.org
> http://cvs.gentoo.org/mailman/listinfo/gentoo-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] python ebuild: use tcltk
2001-07-07 9:34 ` Achim Gottinger
@ 2001-07-07 14:31 ` Achim Gottinger
2001-07-07 19:45 ` Daniel Robbins
0 siblings, 1 reply; 9+ messages in thread
From: Achim Gottinger @ 2001-07-07 14:31 UTC (permalink / raw
To: gentoo-dev
Achim Gottinger wrote:
>
> Daniel Robbins wrote:
> >
> > On Mon, Jun 25, 2001 at 12:43:53AM -0500, Tod M. Neidt wrote:
> > > Hi!
> > >
> > > Attached is a modified python ebuild (python-2.0-r4.ebuild) that will
> > > include the tkinter module if USE tcltk is set. I made three changes.
> >
> > Have you tested it with *and* without tcltk set in USE, and does it compile
> > OK in both instances? If so, I'll give it quick test over here and if it goes
> > ok, I'll add it to cvs.
> >
> > Thanks :)
>
> Well someone must fix all the packages that had to be hacked manually in
> the past to work with all
> combinations of USE flags for python.
Well I added portag-2.0-r4(with tcltk support) to the cvs tree and fixed
all packages depending on python.
python-2.0-r4 now installs a simple python-config script which only
outputs the libs used to build python.
I used this srcript in new revs of xchat,entity and koffice ebuilds.
achim~
>
> bye achim~
>
> >
> > --
> > Daniel Robbins <drobbins@gentoo.org>
> > President/CEO http://www.gentoo.org
> > Gentoo Technologies, Inc.
> >
> > _______________________________________________
> > gentoo-dev mailing list
> > gentoo-dev@cvs.gentoo.org
> > http://cvs.gentoo.org/mailman/listinfo/gentoo-dev
>
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@cvs.gentoo.org
> http://cvs.gentoo.org/mailman/listinfo/gentoo-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] python ebuild: use tcltk
2001-07-07 14:31 ` Achim Gottinger
@ 2001-07-07 19:45 ` Daniel Robbins
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Robbins @ 2001-07-07 19:45 UTC (permalink / raw
To: gentoo-dev
On Sat, Jul 07, 2001 at 09:12:03PM +0200, Achim Gottinger wrote:
> Well I added portag-2.0-r4(with tcltk support) to the cvs tree and fixed all
> packages depending on python. python-2.0-r4 now installs a simple
> python-config script which only outputs the libs used to build python. I
> used this srcript in new revs of xchat,entity and koffice ebuilds.
nice :)
--
Daniel Robbins <drobbins@gentoo.org>
President/CEO http://www.gentoo.org
Gentoo Technologies, Inc.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-07-08 1:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-24 23:42 [gentoo-dev] python ebuild: use tcltk Tod M. Neidt
2001-06-24 23:55 ` Daniel Robbins
2001-07-07 9:34 ` Achim Gottinger
2001-07-07 14:31 ` Achim Gottinger
2001-07-07 19:45 ` Daniel Robbins
2001-06-24 23:57 ` [gentoo-dev] premature posting :) Tod M. Neidt
2001-06-25 0:18 ` Daniel Robbins
2001-06-25 1:23 ` Tod M. Neidt
2001-06-25 12:38 ` Daniel Robbins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox