Bump version to 0.36.9
[cygport.git] / cygclass / python3-distutils.cygclass
blobb74390fc249f295f1293da37230505e1c57709ce
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
27 #  DESCRIPTION
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.
35 #  INHERITS
36 #  python.org.cygclass, python3.cygclass
37 #  REQUIRES
38 #  python3
39 #****
40 ORIG_PN=${ORIG_PN:-${PN#python3-}}
42 inherit python.org python3
44 #****C* python3-distutils.cygclass/python3_distutils_compile
45 #  SYNOPSIS
46 #  python3_distutils_compile [OPTIONS]
47 #  DESCRIPTION
48 #  Runs the setup.py 'build' command, to which any arguments are passed.
49 #****
50 python3_distutils_compile() {
51         if [ ! -e setup.py ]
52         then
53                 error "No Python Distutils module detected"
54         fi
56         ${PYTHON3} setup.py build "${@}" || error "setup.py build failed"
59 #****I* python3-distutils.cygclass/python3_distutils_install
60 #  SYNOPSIS
61 #  python3_distutils_install [OPTIONS]
62 #  DESCRIPTION
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.
65 #****
66 python3_distutils_install() {
67         if [ ! -e setup.py ]
68         then
69                 error "No Python Distutils module detected"
70         fi
72         ${PYTHON3} setup.py "${@}" install --no-compile --root=${D} || error "setup.py install failed"
75 #****o* python3-distutils.cygclass/src_compile (python3-distutils)
76 #  DEFINITION
77 src_compile() {
78         lndirs
79         cd ${B}
80         python3_distutils_compile
82 #****
84 #****o* python3-distutils.cygclass/src_install (python3-distutils)
85 #  DEFINITION
86 src_install() {
87         cd ${B}
88         python3_distutils_install
90 #****
92 readonly -f python3_distutils_compile python3_distutils_install