Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Use pypy with portage without the pypy package
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
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Thu Mar 14, 2013 5:26 pm    Post subject: Use pypy with portage without the pypy package Reply with quote

In my recent endeavor to make portage as fast as possible, I found I can run on pypy. Sadly, pypy needs to 2GB or ram to compile, something I don't have, so I installed the pypy binary off their website (eww binaries...). Will enabling the pypy use flag and adding pypy to package.provided still work? I really don't want to mess with portage with knowing what I'm doing won't screw it up.
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Thu Mar 14, 2013 6:34 pm    Post subject: Reply with quote

I don't think that will work. The emerge script will look at the path where pypy was supposed to be built at... If you put the binary in the compiled location that might work, but once you enable the flag an emerge would pull the package in because it was never compiled...
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Thu Mar 14, 2013 10:05 pm    Post subject: Reply with quote

eyoung100 wrote:
I don't think that will work. The emerge script will look at the path where pypy was supposed to be built at... If you put the binary in the compiled location that might work

I'll take a look at the ebuild and try to understand where to stick the binary. Hopefully it isn't too complicated.

eyoung100 wrote:
once you enable the flag an emerge would pull the package in because it was never compiled...

That's what package.provided is for. It fools portage into thinking the package is already compiled, thus removing the need to pull it in. I used to stick the vanilla sources in there and manage the kernel sources on my own.
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Thu Mar 14, 2013 10:34 pm    Post subject: Reply with quote

Quote:
88 src_install() {
89 local INSDESTTREE=/usr/$(get_libdir)/pypy${SLOT}
90 doins -r include lib_pypy lib-python pypy-c
91 fperms a+x ${INSDESTTREE}/pypy-c
92 dosym ../$(get_libdir)/pypy${SLOT}/pypy-c /usr/bin/pypy-c${SLOT}
93 dodoc README

_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Fri Mar 15, 2013 2:16 pm    Post subject: Reply with quote

Alright I seem to have everything in the right place, the only thing missing now is to show portage that pypy is a valid python interpreter. I believe this is done with python_export in the ebuild. How do I emulate this with bash?

E: portage's ebuild calls python_set_active_version() and tries to set to pypy:2.0 and the dies. That's what I'm trying to fix
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Fri Mar 15, 2013 2:23 pm    Post subject: Reply with quote

try:
Code:
eselect python list

is pypy listed?
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Fri Mar 15, 2013 2:40 pm    Post subject: Reply with quote

nope:
Code:
# eselect python list   
Available Python interpreters:
  [1]   python2.7
  [2]   python3.2 *
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Fri Mar 15, 2013 3:27 pm    Post subject: Reply with quote

What about after:
Code:
env-update && source /etc/profile

_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Fri Mar 15, 2013 3:58 pm    Post subject: Reply with quote

Nope, nothing. I didn't install pypy through portage, so it doesn't show up in eselect. How do you manually add things to eselect?
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Fri Mar 15, 2013 5:14 pm    Post subject: Reply with quote

thats the issue here, i dont think we can...
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Sat Mar 16, 2013 12:20 am    Post subject: Reply with quote

From the looks of it, eselect uses /usr/share/eselect/modules/python.eselect to set the default python version. The script itself seems to be hardcoded to look for "python?.?" in $PATH or something, which isn't what we're looking for.
Portage has to have a list of all the python interpreters somewhere, it's just matter of finding the list and finding a way to edit it...
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Mon Mar 18, 2013 5:40 pm    Post subject: Reply with quote

Updating the script will do no good, as the next time the eselect tool is updated during an emerge, it will overwrite your modification
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
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