Magellan Linux

Diff of /trunk/include/python.sminc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22416 by niro, Thu Apr 3 23:08:50 2014 UTC revision 29773 by niro, Wed Oct 11 09:27:47 2017 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  SDEPEND="${SDEPEND}  # simulate the old behavior
4   >= dev-lang/python-2.7"  if [[ -z ${MAGE_PYTHON_EXEC} ]]
5    then
6     MAGE_PYTHON_EXEC="python"
7    
8     SDEPEND="${SDEPEND}
9     >= dev-lang/python-2.7"
10    fi
11    if [[ -z ${MAGE_PYTHON_BUILD_VERSIONS} ]]
12    then
13     MAGE_PYTHON_BUILD_VERSIONS="single"
14    fi
15    
16  # get the major.minor current installed python version  # get the major.minor current installed python version
17  # -> ex 2.4  # -> ex 2.4
18  mget-python-version()  mget-python-version()
19  {  {
20   local pyver   local pyver
21  # pyver="$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)"  # pyver="$(${MAGE_PYTHON_EXEC} -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)"
22   pyver=$(python -c "import sys ; print sys.version[:3]")   pyver=$(${MAGE_PYTHON_EXEC} -c "import sys ; (print sys.version[:3])")
23   [[ -z ${pyver} ]] && return 1   [[ -z ${pyver} ]] && return 1
24   echo "${pyver}"   echo "${pyver}"
25   return 0   return 0
# Line 18  mget-python-version() Line 28  mget-python-version()
28  mget-python-libdir()  mget-python-libdir()
29  {  {
30   local pylib   local pylib
31   pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()')   pylib=$(${MAGE_PYTHON_EXEC} -c 'from distutils import sysconfig; print (sysconfig.get_python_lib())')
32   [[ -z ${pylib} ]] && return 1   [[ -z ${pylib} ]] && return 1
33   echo "${pylib}"   echo "${pylib}"
34   return 0   return 0
# Line 27  mget-python-libdir() Line 37  mget-python-libdir()
37  mget-python-includedir()  mget-python-includedir()
38  {  {
39   local pyinc   local pyinc
40   pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()')   pyinc=$(${MAGE_PYTHON_EXEC} -c 'from distutils import sysconfig; print (sysconfig.get_python_inc())')
41   [[ -z ${pyinc} ]] && return 1   [[ -z ${pyinc} ]] && return 1
42   echo "${pyinc}"   echo "${pyinc}"
43   return 0   return 0
# Line 59  python_docompile() Line 69  python_docompile()
69  {  {
70   if [[ -e setup.py ]]   if [[ -e setup.py ]]
71   then   then
72   python setup.py build $@ || die   ${MAGE_PYTHON_EXEC} setup.py build $@ || die
73   elif [[ -e waf ]]   elif [[ -e waf ]]
74   then   then
75   python waf configure --prefix=/usr --libdir=/usr/$(mlibdir) $@ || die   ${MAGE_PYTHON_EXEC} waf configure --prefix=/usr --libdir=/usr/$(mlibdir) $@ || die
76   python waf build $@ || die   ${MAGE_PYTHON_EXEC} waf build $@ || die
77   elif [[ -e configure ]]   elif [[ -e configure ]]
78   then   then
79   mconfigure $@ || die   mconfigure $@ || die
# Line 80  python_doinstall() Line 90  python_doinstall()
90  {  {
91   if [[ -e setup.py ]]   if [[ -e setup.py ]]
92   then   then
93   python setup.py install --no-compile --root ${BINDIR} $@ || die   ${MAGE_PYTHON_EXEC} setup.py install --no-compile --root ${BINDIR} $@ || die
94   elif [[ -e waf ]]   elif [[ -e waf ]]
95   then   then
96   python waf install --destdir=${BINDIR} $@ || die   ${MAGE_PYTHON_EXEC} waf install --destdir=${BINDIR} $@ || die
97   elif [[ -e install.py ]]   elif [[ -e install.py ]]
98   then   then
99   python install.py --prefix=/usr --files-only --destdir=${BINDIR} $@ || die   ${MAGE_PYTHON_EXEC} install.py --prefix=/usr --files-only --destdir=${BINDIR} $@ || die
100   else   else
101   mmake DESTDIR=${BINDIR} install || die   mmake DESTDIR=${BINDIR} install || die
102   fi   fi

Legend:
Removed from v.22416  
changed lines
  Added in v.29773