Magellan Linux

Diff of /trunk/include/pypi.sminc

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

revision 29665 by niro, Tue Aug 29 12:33:04 2017 UTC revision 29846 by niro, Mon Oct 16 09:52:30 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 19  esac Line 23  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     >= dev-lang/python2-2.7\"
36     }"
37    
38     eval "split_info_python3-${SPLIT_PNAME}()
39     {
40     DEPEND=\"\${DEPEND}
41     >= dev-lang/python3-3.6\"
42     }"
43    
44    else
45     DEPEND="${DEPEND}
46     >= dev-lang/python-2.7"
47    fi
48    
49  SRC_URI=(  SRC_URI=(
50   ${SRC_URI[*]}   ${SRC_URI[*]}
# Line 33  UP2DATE="updatecmd_pypi ${PYPI_MODULE} $ Line 57  UP2DATE="updatecmd_pypi ${PYPI_MODULE} $
57    
58  pypi_src_prepare()  pypi_src_prepare()
59  {  {
60   python_src_prepare || die   if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
61     then
62     python2_src_prepare || die
63     python3_src_prepare || die
64     else
65     python_src_prepare || die
66     fi
67    }
68    
69    pypi_multilib_src_prepare()
70    {
71     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
72     then
73     python2_multilib_src_prepare || die
74     python3_multilib_src_prepare || die
75     else
76     python_multilib_src_prepare || die
77     fi
78  }  }
79    
80  pypi_src_compile()  pypi_src_compile()
81  {  {
82   local configure_opts="$@"   local configure_opts="$@"
83   python_src_compile ${configure_opts} || die  
84     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
85     then
86     python2_src_compile ${configure_opts} || die
87     python3_src_compile ${configure_opts} || die
88     else
89     python_src_compile ${configure_opts} || die
90     fi
91    }
92    
93    pypi_multilib_src_compile()
94    {
95     local configure_opts="$@"
96    
97     if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
98     then
99     python2_multilib_src_compile ${configure_opts} || die
100     python3_multilib_src_compile ${configure_opts} || die
101     else
102     python_multilib_src_compile ${configure_opts} || die
103     fi
104  }  }
105    
106  pypi_src_install()  pypi_src_install()
# Line 47  pypi_src_install() Line 108  pypi_src_install()
108   python_src_install || die   python_src_install || die
109  }  }
110    
111  pypi_multilib_src_compile()  eval "pypi_src_install_python2-${SPLIT_PNAME}()
112  {  {
113   local configure_opts="$@"   python2_src_install || die
114   python_multilib_src_compile ${configure_opts} || die  }"
115  }  
116    eval "pypi_src_install_python3-${SPLIT_PNAME}()
117    {
118     python3_src_install || die
119    }"
120    
121  pypi_multilib_src_install()  pypi_multilib_src_install()
122  {  {
123   python_multilib_src_install || die   python_multilib_src_install || die
124  }  }
125    
126  export_inherits pypi src_prepare  eval "pypi_multilib_src_install_python2-${SPLIT_PNAME}()
127    {
128     python2_multilib_src_install || die
129    }"
130    
131    eval "pypi_multilib_src_install_python3-${SPLIT_PNAME}()
132    {
133     python3_multilib_src_install || die
134    }"
135    
136  if [[ ${MULTILIB_BUILD} = true ]]  if [[ ${MULTILIB_BUILD} = true ]]
137  then  then
138   export_inherits pypi_multilib src_compile src_install   if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
139     then
140     export_inherits pypi_multilib src_prepare src_compile src_install_python2-${SPLIT_PNAME} src_install_python3-${SPLIT_PNAME}
141     else
142     export_inherits pypi_multilib src_prepare src_compile src_install
143     fi
144  else  else
145   export_inherits pypi src_compile src_install   if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]]
146     then
147     export_inherits pypi src_prepare src_compile src_install_python2-${SPLIT_PNAME} src_install_python3-${SPLIT_PNAME}
148     else
149     export_inherits pypi src_prepare src_compile src_install
150     fi
151  fi  fi

Legend:
Removed from v.29665  
changed lines
  Added in v.29846