This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plan.sh
78 lines (68 loc) · 1.89 KB
/
plan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# shellcheck disable=SC2148,SC1091
# TODO: Should this be renamed to python27 in accordance with RFC 0003?
# If so, the python2 namespace would need to be deprecated per RFC 0007
pkg_name=python2
pkg_distname=Python
pkg_version=2.7.18
pkg_origin=core
pkg_maintainer="The Habitat Maintainers <[email protected]>"
pkg_license=('Python-2.0')
pkg_description="Python is a programming language that lets you work quickly \
and integrate systems more effectively."
pkg_upstream_url="https://www.python.org"
pkg_dirname="${pkg_distname}-${pkg_version}"
pkg_source="https://www.python.org/ftp/python/${pkg_version}/${pkg_dirname}.tgz"
pkg_shasum="da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814"
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)
pkg_include_dirs=(include)
pkg_deps=(
core/bzip2
core/expat
core/gcc-libs
core/gdbm
core/glibc
core/libffi
core/ncurses
core/openssl
core/readline
core/sqlite
core/zlib
)
pkg_build_deps=(
core/coreutils
core/diffutils
core/gcc
core/linux-headers
core/make
core/util-linux
)
pkg_interpreters=(bin/python bin/python2 bin/python2.7)
do_prepare() {
sed -i.bak 's/#zlib/zlib/' Modules/Setup.dist
sed -i -re "/(SSL=|_ssl|-DUSE_SSL|-lssl).*/ s|^#||" Modules/Setup.dist
}
do_build() {
./configure --prefix="$pkg_prefix" \
--enable-shared \
--enable-unicode=ucs4 \
--with-threads \
--with-system-expat \
--with-system-ffi \
--with-ensurepip \
--enable-optimizations
make
}
do_check() {
make test
}
do_install() {
do_default_install
# Remove idle as we are not building with Tk/x11 support so it is useless
rm -vf "$pkg_prefix/bin/idle"
platlib=$(python -c "import sysconfig;print(sysconfig.get_path('platlib'))")
cat <<EOF > "$platlib/_manylinux.py"
# Disable binary manylinux1(CentOS 5) wheel support
manylinux1_compatible = False
EOF
}