On 03/12/12 14:12, Thomas Kahle wrote:
> Hi,
> 
> I'm trying to make an ebuild that installes this here into my
> sage-on-gentoo installation: 
> https://bitbucket.org/matroid/sage_matroids
> 
> Their setup.py does the following:
> 
> if not os.environ.has_key('SAGE_ROOT'):
>     print "    ERROR: The environment variable SAGE_ROOT must be defined."
>     sys.exit(1)
> else:
>     SAGE_ROOT  = os.environ['SAGE_ROOT']
>     SAGE_LOCAL = SAGE_ROOT + '/local'
>     SAGE_DEVEL = SAGE_ROOT + '/devel'
>     SAGE_INC   = SAGE_LOCAL + '/include/'
> 
> and I wonder if this is wrong?  Is SAGE_LOCAL="/usr" on Gentoo?  In
> particular, where should python packages go that were installed by such
> an ebuild? Maybe into /usr/lib/python/site-packages ?
> 

Hi Thomas,

this is totally wrong for sage-on-gentoo. I have been pushing for
minimizing the use of SAGE_ROOT as much as possible.
SAGE_LOCAL must not be defined that way on sage-on-gentoo.

My recommendation for sage-on-gentoo (and it wouldn't work with
vanilla sage so don't try to push upstream) would be to replace that
section with:

from sage.misc.variables import SAGE_ROOT, SAGE_LOCAL
SAGE_DEVEL = SAGE_ROOT + '/devel'
SAGE_INC   = SAGE_LOCAL + '/include/'

The package should go in $(python_get_sitedir)/sage/${PN} as the
recommendation on their page is under the sage hierarchy.
I would personally prefer it under $(python_get_sitedir)/${PN} but
you may have to
1) fix some import.
2) adjust the tutorial and manual.
Unless the code is planned to be merged in sage proper in the future
there is no reason to put it in the sage folder in the first place.

I just had a quick look at the code and the variable "INCLUDE" will need
fixing too. They also have a "module_list.py" which mirror (uselessly)
setup.py and will need the same fixes.

Francois


Reply via email to