Magellan Linux

Diff of /trunk/include/python.sminc

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

branches/magellan-next/include/python.sminc revision 8673 by niro, Wed Jul 27 18:34:11 2011 UTC trunk/include/python.sminc revision 21029 by niro, Thu Mar 6 08:40:01 2014 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3    SDEPEND="${SDEPEND}
4     >= dev-lang/python-2.7"
5    
6  # get the major.minor current installed python version  # get the major.minor current installed python version
7  # -> ex 2.4  # -> ex 2.4
8  get_python_version()  get_python_version()
9  {  {
10  # PYVER="$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)"   local pyver
11   PYVER=$(python -c "import sys ; print sys.version[:3]")  # pyver="$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)"
12   [[ -z ${PYVER} ]] && return 1   pyver=$(python -c "import sys ; print sys.version[:3]")
13   echo "${PYVER}"   [[ -z ${pyver} ]] && return 1
14     echo "${pyver}"
15   return 0   return 0
16  }  }
17    
# Line 15  get_python_libdir() Line 19  get_python_libdir()
19  {  {
20   local pylib   local pylib
21   pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()')   pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()')
22     [[ -z ${pylib} ]] && return 1
23   echo "${pylib}"   echo "${pylib}"
24   return 0   return 0
25  }  }
# Line 23  get_python_includedir() Line 28  get_python_includedir()
28  {  {
29   local pyinc   local pyinc
30   pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()')   pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()')
31     [[ -z ${pyinc} ]] && return 1
32   echo "${pyinc}"   echo "${pyinc}"
33   return 0   return 0
34  }  }
# Line 45  python_docompile() Line 51  python_docompile()
51   then   then
52   mconfigure $@ || die   mconfigure $@ || die
53   mmake || die   mmake || die
54     elif [[ -e install.py ]]
55     then
56     echo "install.py found - nothing to compile here."
57   else   else
58   mmake || die   mmake || die
59   fi   fi
# Line 58  python_doinstall() Line 67  python_doinstall()
67   elif [[ -e waf ]]   elif [[ -e waf ]]
68   then   then
69   python waf install --destdir=${BINDIR} $@ || die   python waf install --destdir=${BINDIR} $@ || die
70     elif [[ -e install.py ]]
71     then
72     python install.py --prefix=/usr --files-only --destdir=${BINDIR} $@ || die
73   else   else
74   mmake DESTDIR=${BINDIR} install || die   mmake DESTDIR=${BINDIR} install || die
75   fi   fi
# Line 69  python_src_compile() Line 81  python_src_compile()
81   python_docompile || die   python_docompile || die
82  }  }
83    
84    python_multilib_src_compile()
85    {
86     local abi
87     local saved_SRCDIR="${SRCDIR}"
88    
89     for abi in ${MULTILIB_ABIS}
90     do
91     SRCDIR="${saved_SRCDIR}-${abi}/${SRCSUBDIR}"
92     cd ${SRCDIR}
93     abi-${abi} python_docompile || die
94     done
95     SRCDIR="${saved_SRCDIR}"
96    }
97    
98  python_src_install()  python_src_install()
99  {  {
100   cd ${SRCDIR}   cd ${SRCDIR}
# Line 85  python_src_install() Line 111  python_src_install()
111   done   done
112  }  }
113    
114  export_inherits python src_prepare src_compile src_install  python_multilib_src_install()
115    {
116     local abi
117     local saved_SRCDIR="${SRCDIR}"
118    
119     for abi in ${MULTILIB_ABIS}
120     do
121     SRCDIR="${saved_SRCDIR}-${abi}/${SRCSUBDIR}"
122     cd ${SRCDIR}
123     abi-${abi} python_doinstall || die
124    
125     local i
126     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
127     FAQ LICENSE NEWS README TODO
128     do
129     if [ -f ${SRCDIR}/${i} ]
130     then
131     oldminstalldocs ${i} || die
132     fi
133     done
134     done
135     SRCDIR="${saved_SRCDIR}"
136    }
137    
138    export_inherits python src_prepare src_check
139    if [[ ${MULTILIB_BUILD} = true ]]
140    then
141     export_inherits python_multilib src_compile src_install
142    else
143     export_inherits python src_compile src_install
144    fi

Legend:
Removed from v.8673  
changed lines
  Added in v.21029