annotate python/python2/python2.sh @ 176:7e1ce22dde64

python/python2: initial import, closes #1284
author David Demelier <markand@malikania.fr>
date Fri, 15 Mar 2019 20:45:32 +0100
parents
children 9e95fda0e5c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
176
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #!/bin/sh
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 PKGNAME=python2
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 PKGVERSION=2.7.16
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 PKGREVISION=1
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PKGLICENSE="PSF"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PKGSUMMARY="high-level scripting language"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 PKGDOWNLOAD="https://www.python.org/ftp/python/$PKGVERSION/Python-$PKGVERSION.tar.xz"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 PKGDEPENDS="lib/libffi lib/expat lib/zlib network/openssl"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 PKGOPTIONS="IPV6"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
26
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 : ${CHOST:=$(uname -m)-linux-musl}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 : ${CBUILD:=$(uname -m)-linux-musl}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 : ${CC:=gcc}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 : ${CFLAGS:=-O2}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 : ${LDFLAGS:=}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 : ${LIBS:=}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 : ${IPV6:=yes}
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
34
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 if [ "$IPV6" = "yes" ]; then
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 with_ipv6="--enable-ipv6"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 else
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 with_ipv6="--disable-ipv6"
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 fi
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 build()
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 {
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 rm -rf Python-$PKGVERSION
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 tar xvaf Python-$PKGVERSION.tar.xz
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 pushd Python-$PKGVERSION
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
46
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 CC="$CC" \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 CFLAGS="$CFLAGS" \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 LDFLAGS="$LDFLAGS" \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 LIBS="$LIBS" \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 ./configure \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 --build=$CBUILD \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 --host=$CHOST \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 --prefix=/usr \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 --disable-static \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 --enable-shared \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 --with-system-expat \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 --with-system-ffi \
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 $with_ipv6
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
60 make
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 make altinstall DESTDIR=$DESTDIR
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 ln -sf python2.7 $DESTDIR/usr/bin/python2
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
63
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
64 popd
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
65 rm -rf Python-$PKGVERSION
7e1ce22dde64 python/python2: initial import, closes #1284
David Demelier <markand@malikania.fr>
parents:
diff changeset
66 }