Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Python 2.3 Ebuild + General Ebuilding(:D) Questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
manonthespoon
n00b
n00b


Joined: 06 Jan 2003
Posts: 33

PostPosted: Fri Aug 01, 2003 4:48 pm    Post subject: Python 2.3 Ebuild + General Ebuilding(:D) Questions Reply with quote

I'm a huge python fan, and I have been waiting very impatiently the last few days for a Python2.3 Ebuild to become available. I finally got tired of wasting bandwidth with emerge sync.

I'm currently trying to modify or create an ebuild for it myself. As I am very new to portage and writing ebuilds I have a few questions.

First off, for python at least I've been able to get the package, get it compiled, and even begin installing it just by changing the name of the python-2.2.3.ebuild to python-2.3.ebuild. This seemed almost ridiculously easy, but I was suprised when it actually downloaded and successfully compiled python2.3 (Installing has not been successful yet, so I'm assuming I have some actual work to do.)

I'm wondering if this sort of small modifications to ebuilds are reasonable, and if one can actually expect the kind of behavior I'm seeing, or is it only working the way it is because of luck? I assume that it's just a testimony of the flexibility and quality of portage, but I'm curious what more experienced ebuild'ers (packagers?) think.
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Fri Aug 01, 2003 6:58 pm    Post subject: Reply with quote

For most packages, simply renaming the ebuild works. For packages that have greater changes in between releases, such as Gnome, Mozilla etc., you'd be lucky.

I imagine there is going to be quite a bit of testing on Python 2.3 before they put it into portage since it is such a vital package on Gentoo.

You could probably safely install 2.3 manually, if you're careful and put the interpreter in /usr/local/bin and wait for the official portage version.
Back to top
View user's profile Send private message
manonthespoon
n00b
n00b


Joined: 06 Jan 2003
Posts: 33

PostPosted: Fri Aug 01, 2003 6:58 pm    Post subject: Successfully installed python2.3: installing modules Reply with quote

I now have a semi-working ebuild,

and I'm trying to verify it works by installing modules. However whenever I attempt to install a module, for instance Numeric, I get the following errors on the installation step:

Code:

ACCESS DENIED  unlink:    /usr/lib/python2.3/string.pyc
ACCESS DENIED  open_wr:   /usr/lib/python2.3/string.pyc
ACCESS DENIED  unlink:    /usr/lib/python2.3/re.pyc
ACCESS DENIED  open_wr:   /usr/lib/python2.3/re.pyc
...


There are quite a lot of these errors, especially with distutils. Any idea how one might fix something like this? I guess I'll be sticking with 2.2 for a little while longer.
Back to top
View user's profile Send private message
aja
l33t
l33t


Joined: 26 Aug 2002
Posts: 705
Location: Edmonton, Canada

PostPosted: Fri Aug 01, 2003 7:09 pm    Post subject: Reply with quote

At the top of the python ebuild, you will see:
Code:

PYVER_MAJOR="`echo ${PV%_*} | cut -d '.' -f 1`"
PYVER_MINOR="`echo ${PV%_*} | cut -d '.' -f 2`"
PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"

S="${WORKDIR}/Python-${PV}"
DESCRIPTION="A really great language"
SRC_URI="http://www.python.org/ftp/python/${PV%_*}/Python-${PV}.tgz"


Note that it parses the variable PV for names and locations.

Now,
Code:
man 5 ebuild
tells us that:

Code:

       PV     Contains the version number without the revision.
                xfree-4.2.1-r2.ebuild --> $PV=='4.2.1'


Which is parsed from the ebuild name (this is why the actually name of an ebuild is critical - see the Gentoo Linux Developers HOWTO).

So, in this particular ebuild, it will try to download code for whichever version is specified in the ebuild name. However:

(1) This depends on the source maintainers not changing the location/naming convention for source.

(2) Not all ebuilds implement this sort of structure (but good ones do :-))

(3) It is somewhat brittle for major version number revisions.

So, I guess the short answer is that just changing the name of the ebuild will often work, particularly if it is a minor version number change and it is a well-known package (with standards around source locations). However, it is a good idea to not just blindly change ebuild names but actually inspect the ebuild itself.
Back to top
View user's profile Send private message
manonthespoon
n00b
n00b


Joined: 06 Jan 2003
Posts: 33

PostPosted: Fri Aug 01, 2003 7:34 pm    Post subject: Reply with quote

Cool:

That's mostly what I expected. And it's what I've been trying to do. And as I said, I was able to install python2.3 in parallel with 2.2.3. Just no luck installing modules, and I don't know where to go in the ebuild to attempt to fix that.

Thanks a lot for the long response, a lot of info in there that I was kind of guessing, and some I had gleaned from the dev-docs. It's nice to have someone take the time to confirm it.

Thanks!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Fri Aug 01, 2003 7:35 pm    Post subject: Reply with quote

There was a link to the 2.3 ebuild, but since the cvs server was changed around its gone. Does anyone know if developers have their private stuff in a new location now?

http://cvs.gentoo.org/~liquidx/local/tree-liquidx/dev-lang/python/

https://bugs.gentoo.org/show_bug.cgi?id=22037

EDIT:
Ah ha. After some snooping around I found the new location:
http://dev.gentoo.org/~liquidx/local/liquidx/dev-lang/python/
Back to top
View user's profile Send private message
manonthespoon
n00b
n00b


Joined: 06 Jan 2003
Posts: 33

PostPosted: Fri Aug 01, 2003 8:24 pm    Post subject: Reply with quote

Pythonhead, your name is so fitting.

Thanks a lot!
Back to top
View user's profile Send private message
karl11
Guru
Guru


Joined: 25 Jun 2002
Posts: 469
Location: Raleigh, NC

PostPosted: Mon Aug 11, 2003 10:17 pm    Post subject: Reply with quote

I actually migrated everything to Python 2.3, but there was a problem in the aux_get function of portage that I couldn't fix, so I backed down to 2.2.3. It's easy enough to install them in parallel, but does anyone have an idea of when the new aux_get function will be in place? Maybe it's already there?

Karl
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum