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
86 lines (75 loc) · 2.16 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
79
80
81
82
83
84
85
86
pkg_name=python37
pkg_distname=Python
pkg_version=3.7.11
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="b4fba32182e16485d0a6022ba83c9251e6a1c14676ec243a9a07d3722cd4661a"
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)
pkg_include_dirs=(include)
pkg_interpreters=(bin/python bin/python3 bin/python3.7)
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/pkg-config
core/coreutils
core/diffutils
core/gcc
core/linux-headers
core/make
core/util-linux
)
do_setup_environment() {
export LDFLAGS="$LDFLAGS -lgcc_s"
}
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-loadable-sqlite-extensions \
--enable-shared \
--with-system-expat \
--with-ensurepip \
--enable-optimizations
make
}
do_check() {
make test
}
do_install() {
do_default_install
# link pythonx.x to python for pkg_interpreters
local minor=${pkg_version%.*}
local major=${minor%.*}
ln -rs "$pkg_prefix/bin/pip$minor" "$pkg_prefix/bin/pip"
ln -rs "$pkg_prefix/bin/pydoc$minor" "$pkg_prefix/bin/pydoc"
ln -rs "$pkg_prefix/bin/python$minor" "$pkg_prefix/bin/python"
ln -rs "$pkg_prefix/bin/python$minor-config" "$pkg_prefix/bin/python-config"
# Remove idle as we are not building with Tk/x11 support so it is useless
rm -vf "$pkg_prefix/bin/idle$major"
rm -vf "$pkg_prefix/bin/idle$minor"
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
}