Magellan Linux

Diff of /branches/R11-unstable/include/pypi.sminc

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

revision 20740 by niro, Tue Feb 4 16:02:29 2014 UTC revision 30182 by niro, Thu Nov 2 13:14:58 2017 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2  # Pypi functions  # Pypi functions
3    
4    # default to build modules for multiple python versions (atm python2 and python3)
5    : ${PYPI_MULTIPLE_PYTHON_VERSIONS=1}
6    
7  # needs python  # needs python
8  sminclude python  sminclude python
9    
10    : ${SPLIT_PNAME="${PNAME}"}
11  : ${PYPI_MODULE="${PNAME}"}  : ${PYPI_MODULE="${PNAME}"}
12  : ${PYPI_ARCHIVE="gz"}  : ${PYPI_ARCHIVE="gz"}
13    
# Line 13  sminclude python Line 17  sminclude python
17  : ${HOMEPAGE="http://pypi.python.org/pypi/${PYPI_MODULE}"}  : ${HOMEPAGE="http://pypi.python.org/pypi/${PYPI_MODULE}"}
18    
19  case ${PYPI_ARCHIVE} in  case ${PYPI_ARCHIVE} in
20   gz|bz2) : ${SRCFILE="${PYPI_MODULE}-${PVER}.tar.${PYPI_ARCHIVE}"} ;;   gz|bz2|xz) : ${SRCFILE="${PYPI_MODULE}-${PVER}.tar.${PYPI_ARCHIVE}"} ;;
21   *) : ${SRCFILE="${PYPI_MODULE}-${PVER}.${PYPI_ARCHIVE}"} ;;   *) : ${SRCFILE="${PYPI_MODULE}-${PVER}.${PYPI_ARCHIVE}"} ;;
22  esac  esac
23    
24  : ${SRCDIR="${BUILDDIR}/${PYPI_MODULE}-${PVER}"}  : ${SRCDIR="${BUILDDIR}/${PYPI_MODULE}-${PVER}"}
25    
26  DEPEND="${DEPEND}  
27   >= dev-lang/python-2.7"  if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
28    then
29     sminclude python2 python3
30     SPLIT_PACKAGES="python2-${SPLIT_PNAME} python3-${SPLIT_PNAME}"
31    
32     eval "split_info_python2-${SPLIT_PNAME}()
33     {
34     DEPEND=\"\${DEPEND}
35     \${PYTHON2_DEPEND}
36     >= dev-lang/python2-2.7\"
37     }"
38    
39     eval "split_info_python3-${SPLIT_PNAME}()
40     {
41     DEPEND=\"\${DEPEND}
42     \${PYTHON3_DEPEND}
43     >= dev-lang/python3-3.6\"
44     }"
45    
46    else
47     DEPEND="${DEPEND}
48     >= dev-lang/python-2.7"
49    fi
50    
51  SRC_URI=(  SRC_URI=(
52   ${SRC_URI[*]}   ${SRC_URI[*]}
53   https://pypi.python.org/packages/source/${PYPI_MODULE:0:1}/${PYPI_MODULE}/${SRCFILE}   https://pypi.io/packages/source/${PYPI_MODULE:0:1}/${PYPI_MODULE}/${SRCFILE}
54     #https://pypi.python.org/packages/source/${PYPI_MODULE:0:1}/${PYPI_MODULE}/${SRCFILE}
55   mirror://${PNAME}/${SRCFILE}   mirror://${PNAME}/${SRCFILE}
56  )  )
57    
58  # we cannot sort with C=M;O=A  UP2SUBSTITUTE=".asc"
59  : ${UP2TARBALL="${PYPI_MODULE}"}  UP2DATE="updatecmd_pypi ${PYPI_MODULE} ${PYPI_ARCHIVE}"
 : ${UP2SEPERATOR="-"}  
 UP2DATE="updatecmd -listonly https://pypi.python.org/packages/source/${PYPI_MODULE:0:1}/${PYPI_MODULE}/ | grep ${PYPI_MODULE} | sed 's:.*${UP2TARBALL}${UP2SEPERATOR}\(.*\):\1:' | sort -n | sed 's:^:-:g' | lasttarball ${PYPI_ARCHIVE}"  
60    
61  pypi_src_prepare()  pypi_src_prepare()
62  {  {
63   python_src_prepare || die   if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
64     then
65     python2_src_prepare || die
66     python3_src_prepare || die
67     else
68     python_src_prepare || die
69     fi
70    }
71    
72    pypi_multilib_src_prepare()
73    {
74     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
75     then
76     python2_multilib_src_prepare || die
77     python3_multilib_src_prepare || die
78     else
79     python_multilib_src_prepare || die
80     fi
81  }  }
82    
83  pypi_src_compile()  pypi_src_compile()
84  {  {
85   local configure_opts="$@"   local configure_opts="$@"
86   python_src_compile ${configure_opts} || die  
87     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
88     then
89     python2_src_compile ${configure_opts} || die
90     python3_src_compile ${configure_opts} || die
91     else
92     python_src_compile ${configure_opts} || die
93     fi
94    }
95    
96    pypi_multilib_src_compile()
97    {
98     local configure_opts="$@"
99    
100     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
101     then
102     python2_multilib_src_compile ${configure_opts} || die
103     python3_multilib_src_compile ${configure_opts} || die
104     else
105     python_multilib_src_compile ${configure_opts} || die
106     fi
107  }  }
108    
109  pypi_src_install()  pypi_src_install()
# Line 49  pypi_src_install() Line 111  pypi_src_install()
111   python_src_install || die   python_src_install || die
112  }  }
113    
114  export_inherits pypi src_prepare src_compile src_install  eval "pypi_src_install_python2-${SPLIT_PNAME}()
115    {
116     python2_src_install || die
117    }"
118    
119    eval "pypi_src_install_python3-${SPLIT_PNAME}()
120    {
121     python3_src_install || die
122    }"
123    
124    pypi_multilib_src_install()
125    {
126     python_multilib_src_install || die
127    }
128    
129    eval "pypi_multilib_src_install_python2-${SPLIT_PNAME}()
130    {
131     python2_multilib_src_install || die
132    }"
133    
134    eval "pypi_multilib_src_install_python3-${SPLIT_PNAME}()
135    {
136     python3_multilib_src_install || die
137    }"
138    
139    if [[ ${MULTILIB_BUILD} = true ]]
140    then
141     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
142     then
143     export_inherits pypi_multilib src_prepare src_compile src_install_python2-${SPLIT_PNAME} src_install_python3-${SPLIT_PNAME}
144     else
145     export_inherits pypi_multilib src_prepare src_compile src_install
146     fi
147    else
148     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
149     then
150     export_inherits pypi src_prepare src_compile src_install_python2-${SPLIT_PNAME} src_install_python3-${SPLIT_PNAME}
151     else
152     export_inherits pypi src_prepare src_compile src_install
153     fi
154    fi

Legend:
Removed from v.20740  
changed lines
  Added in v.30182