1 ################################################################################
3 # python3-distutils.cygclass - for building Python 3.x modules with Distutils
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 warning "python3-distutils.cygclass: python distutils is deprecated. Please migrate to the python-wheel cygclass."
26 #****h* Cygclasses/python3-distutils.cygclass
28 # Distutils is the most common method for building and installing Python
29 # libraries and programs. The build is defined by a setup.py file in the
30 # top source directory, which controls the installation of files and the
31 # building of C Python extensions. Many such packages are hosted on the
32 # Python Package Index (PyPI, previously known as Cheeseshop).
34 # This cygclass handles the building of Python 3.x distutils-based packages.
36 # python.org.cygclass, python3.cygclass
40 ORIG_PN=${ORIG_PN:-${PN#python3-}}
42 inherit python.org python3
44 #****C* python3-distutils.cygclass/python3_distutils_compile
46 # python3_distutils_compile [OPTIONS]
48 # Runs the setup.py 'build' command, to which any arguments are passed.
50 python3_distutils_compile() {
53 error "No Python Distutils module detected"
56 ${PYTHON3} setup.py build "${@}" || error "setup.py build failed"
59 #****I* python3-distutils.cygclass/python3_distutils_install
61 # python3_distutils_install [OPTIONS]
63 # Runs the setup.py 'install' phase, setting the root argument to install
64 # into $D. All arguments are passed to the setup.py 'install' command.
66 python3_distutils_install() {
69 error "No Python Distutils module detected"
72 ${PYTHON3} setup.py "${@}" install --no-compile --root=${D} || error "setup.py install failed"
75 #****o* python3-distutils.cygclass/src_compile (python3-distutils)
80 python3_distutils_compile
84 #****o* python3-distutils.cygclass/src_install (python3-distutils)
88 python3_distutils_install
92 readonly -f python3_distutils_compile python3_distutils_install