Ticket #3924: trac_sage_3924.patch

File trac_sage_3924.patch, 2.2 KB (added by dphilp, 13 years ago)
  • sagebuild.py

    # HG changeset patch
    # User dphilp@ncephpc110.anu.edu.au
    # Date 1219805101 -36000
    # Node ID ddb5e19e535673fcd0ac0c527dcee19968a7fca8
    # Parent  2011c30ecfe0776a6f494f77fb1b6c4685286dd4
    Creates links in correct location for SAGE_PYTHON_FRAMEWORK=yes
    
    diff -r 2011c30ecfe0 -r ddb5e19e5356 sagebuild.py
    a b  
    506506                print cmd
    507507            os.system( cmd )
    508508    #Setup the site-packages symlink if it doesn't already exist
    509     safesymlink('../../../../devel/sage/build/sage','local/lib/python/site-packages/sage')
     509    if os.environ.get('SAGE_PYTHON_FRAMEWORK') != 'yes' :
     510        safesymlink('../../../../devel/sage/build/sage','local/lib/python/site-packages/sage')
     511    else:
     512        safesymlink(
     513            '../../../../../../../../devel/sage/build/sage',
     514            'local/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/sage')
    510515    #Handle DSage
    511516    safemkdirs('local/dsage')
    512517    safesymlink('../../devel/sage/sage/dsage/web', 'local/dsage/web')
  • setup.py

    diff -r 2011c30ecfe0 -r ddb5e19e5356 setup.py
    a b  
    6262        if not os.path.exists(SITE_PACKAGES):       
    6363            raise RuntimeError, "Unable to find site-packages directory (see setup.py file in sage python code)."
    6464
     65# This value is never used.
    6566SITE_PACKAGES_REL=SITE_PACKAGES[len(SAGE_LOCAL)+5:]
    66        
     67
    6768if not os.path.exists('build/sage'):
    6869    os.makedirs('build/sage')
    6970
    7071sage_link = SITE_PACKAGES + '/sage'
    7172if not os.path.islink(sage_link) or not os.path.exists(sage_link):
    7273    os.system('rm -rf "%s"'%sage_link)
    73     os.system('cd %s; ln -sf ../../../../devel/sage/build/sage .'%SITE_PACKAGES)
     74    if os.environ.get('SAGE_PYTHON_FRAMEWORK') != 'yes':
     75        os.system('cd %s; ln -sf ../../../../devel/sage/build/sage .'%SITE_PACKAGES)
     76    else:
     77        # Required because the detected SITE_PACKAGES actually refers to a
     78        # place deep within the framework.
     79        os.system('cd %s; ln -sf ../../../../../../../../devel/sage/build/sage .'%SITE_PACKAGES)
    7480
    7581
    7682def is_newer(file1, file2):