1 ################################################################################
3 # distutils.cygclass - wrapper for various py*-distutils cygclasses
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****ih* Cygclasses/distutils.cygclass
28 # Compatibility wrapper for python-distutils.cygclass. python3-distutils.cygclass.
29 # or pypy-distutils.cygclass.
31 # python-distutils.cygclass in most scenarios, OR python3-distutils.cygclass
32 # if PN begins with "python3-*" or python3.cygclass has already been inherit()ed,
33 # OR pypy-distutils.cygclass if PN begins with "pypy-*" or pypy.cygclass has
34 # already been inherit()ed.
36 # distutils.cygclass can only be used with one of python, python3, or pypy.
37 # If you wish to build a module for both python and python3 from the same
38 # source simultaneously, use distutils-multi.cygclass.
46 inform "Using Python 3.x ..."
50 inform "Using PyPy ..."
53 *) if inherited python && ! inherited python3 && ! inherited pypy
56 elif inherited python3 && ! inherited python && ! inherited pypy
58 inform "Using Python 3.x ..."
60 elif inherited pypy && ! inherited python && ! inherited python3
62 inform "Using PyPy ..."
64 elif inherited python && inherited python3
66 warning "Both python.cygclass and python3.cygclass have been inherited!"
67 warning "Perhaps you want to use distutils-multi.cygclass instead?"
68 error "distutils.cygclass: incompatible use of both python and python3"
74 inherit ${_pyinterp}-distutils
76 #****iC* distutils.cygclass/distutils_compile
78 # Wrapper for python_distutils_compile/python3_distutils_compile/pypy_distutils_compile
81 ${_pyinterp}_distutils_compile "$@"
84 #****iI* distutils.cygclass/distutils_install
86 # Wrapper for python_distutils_install/python3_distutils_install/pypy_distutils_install
89 ${_pyinterp}_distutils_install "$@"
92 readonly -f distutils_compile distutils_install