changeset 176:7e1ce22dde64

python/python2: initial import, closes #1284
author David Demelier <markand@malikania.fr>
date Fri, 15 Mar 2019 20:45:32 +0100
parents e78b33377502
children 5f236cd77524
files python/python/python.sh python/python2/python2.sh
diffstat 2 files changed, 69 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/python/python/python.sh	Fri Mar 15 20:47:31 2019 +0100
+++ b/python/python/python.sh	Fri Mar 15 20:45:32 2019 +0100
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2019 FirstName LastName <mailaddress>
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -18,8 +18,8 @@
 PKGNAME=python
 PKGVERSION=3.7.2
 PKGREVISION=1
-PKGLICENSE=""
-PKGSUMMARY=""
+PKGLICENSE="PSF"
+PKGSUMMARY="high-level scripting language"
 PKGDOWNLOAD="https://www.python.org/ftp/python/$PKGVERSION/Python-$PKGVERSION.tar.xz"
 PKGDEPENDS="lib/libffi lib/expat lib/zlib network/openssl"
 PKGOPTIONS="IPV6"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/python2/python2.sh	Fri Mar 15 20:45:32 2019 +0100
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+PKGNAME=python2
+PKGVERSION=2.7.16
+PKGREVISION=1
+PKGLICENSE="PSF"
+PKGSUMMARY="high-level scripting language"
+PKGDOWNLOAD="https://www.python.org/ftp/python/$PKGVERSION/Python-$PKGVERSION.tar.xz"
+PKGDEPENDS="lib/libffi lib/expat lib/zlib network/openssl"
+PKGOPTIONS="IPV6"
+
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CC:=gcc}
+: ${CFLAGS:=-O2}
+: ${LDFLAGS:=}
+: ${LIBS:=}
+: ${IPV6:=yes}
+
+if [ "$IPV6" = "yes" ]; then
+	with_ipv6="--enable-ipv6"
+else
+	with_ipv6="--disable-ipv6"
+fi
+
+build()
+{
+	rm -rf Python-$PKGVERSION
+	tar xvaf Python-$PKGVERSION.tar.xz
+	pushd Python-$PKGVERSION
+
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--disable-static \
+		--enable-shared \
+		--with-system-expat \
+		--with-system-ffi \
+		$with_ipv6
+	make
+	make altinstall DESTDIR=$DESTDIR
+	ln -sf python2.7 $DESTDIR/usr/bin/python2
+
+	popd
+	rm -rf Python-$PKGVERSION
+}