1 ################################################################################
3 # pypy-distutils.cygclass - for building PyPy 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 #****ih* Cygclasses/pypy-distutils.cygclass
26 # Distutils is the most common method for building and installing PyPy
27 # libraries and programs. The build is defined by a setup.py file in the
28 # top source directory, which controls the installation of files. Many such
29 # packages are hosted on the Python Package Index (PyPI, previously known as
32 # This cygclass handles the building of PyPy distutils-based packages.
34 # python.org.cygclass, pypy.cygclass
39 ORIG_PN=${ORIG_PN:-${PN#pypy-}}
41 inherit python.org pypy
43 #****iC* pypy-distutils.cygclass/pypy_distutils_compile
45 # pypy_distutils_compile [OPTIONS]
47 # Runs the setup.py 'config' and 'build' commands. All arguments are passed
48 # to the setup.py 'build' command.
50 pypy_distutils_compile() {
53 error "No PyPy Distutils module detected"
56 ${PYPY} setup.py config || error "setup.py config failed"
57 ${PYPY} setup.py build "${@}" || error "setup.py build failed"
60 #****iI* pypy-distutils.cygclass/pypy_distutils_install
62 # pypy_distutils_install [OPTIONS]
64 # Runs the setup.py 'install' phase, setting the root argument to install
65 # into $D, followed by pypy_optimize. All arguments are passed to the
66 # setup.py 'install' command.
68 pypy_distutils_install() {
71 error "No Python Distutils module detected"
74 ${PYPY} setup.py "${@}" install --no-compile --root=${D} || error "setup.py install failed"
76 if [ -d ${D}${PYPY_SITELIB} ]
78 pypy_optimize ${PYPY_SITELIB}
82 #****io* pypy-distutils.cygclass/src_compile (pypy-distutils)
87 pypy_distutils_compile
91 #****io* pypy-distutils.cygclass/src_install (pypy-distutils)
95 pypy_distutils_install
99 readonly -f pypy_distutils_compile pypy_distutils_install