1 # Build recipe for python3.
3 # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
23 tarname=${program}-${version}.tgz
26 fetch=http://www.python.org/ftp/python/${version}/$tarname
31 Multi-paradigm programming language (v3).
33 Python is an interpreted, interactive object-oriented programming
34 language suitable (amongst other uses) for distributed application
35 development, scripting, numeric computing and system testing. Python
36 is often compared to Tcl, Perl, Java, JavaScript, Visual Basic or
40 homepage=http://www.python.org/
41 license="Python Software Foundation License"
43 # Source documentation
44 docs="LICENSE README.rst"
45 docsdir="${docdir}/${pkgname}-${version}"
51 unpack "${tardir}/$tarname"
55 # Use system libraries instead of the bundle ones
56 rm -rf Modules/expat Modules/zlib Modules/_ctypes/libffi*
58 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" OPT="" \
60 --libdir=/usr/lib${libSuffix} \
63 --build="$(cc -dumpmachine)" \
65 --enable-loadable-sqlite-extensions \
67 --with-ensurepip=yes \
74 make -j${jobs} DESTDIR="$destdir" install
76 # Include the Python tools under site-packages
77 TOOL_DIR=/usr/lib/python${short_version}
81 # Do not clobber README file in site-packages directory
82 test -f README && mv -f README README.Tools
84 cp -rP ./* "${destdir}${TOOL_DIR}/"
87 # Make some useful symlinks at usr/bin
89 cd "${destdir}/usr/bin" || exit 2
91 ln -sf "${TOOL_DIR}/i18n/msgfmt.py" msgfmt${short_version}.py
92 ln -sf "${TOOL_DIR}/i18n/pygettext.py" pygettext${short_version}.py
93 ln -sf "${TOOL_DIR}/pynche/pynche" pynche${short_version}
97 # Compress and link man pages (if needed)
98 if test -d "${destdir}/$mandir"
101 cd "${destdir}/$mandir"
102 find . -type f -exec lzip -9 '{}' +
103 find . -type l | while read -r file
105 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
112 mkdir -p "${destdir}${docsdir}"
118 cp -p $file "${destdir}${docsdir}"