changeset 156:7158e24ad76d

python/python: initial import, closes #1093
author David Demelier <markand@malikania.fr>
date Wed, 13 Mar 2019 12:55:00 +0100
parents 7e885b73d8b1
children 8f5c82e50554
files python/python/python.sh
diffstat 1 files changed, 66 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/python/python.sh	Wed Mar 13 12:55:00 2019 +0100
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 FirstName LastName <mailaddress>
+#
+# 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=python
+PKGVERSION=3.7.2
+PKGREVISION=1
+PKGLICENSE=""
+PKGSUMMARY=""
+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 install DESTDIR=$DESTDIR
+	ln -sf python3.7 $DESTDIR/usr/bin/python
+
+	popd
+	rm -rf Python-$PKGVERSION
+}