aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDimitris Zlatanidis <dslackw@gmail.com>2024-01-08 08:27:31 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-01-08 11:49:44 +0700
commitadb0a547da2a261d7a56a0c5de61885c03ed2399 (patch)
treed63bfdc74832c9ac23cd284866024b3992ff636e /python
parent3548082ae2d408764e35855924d6f3025707e2df (diff)
python/python3-pygame: Added (python3 version of pygame).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python')
-rw-r--r--python/python3-pygame/README5
-rw-r--r--python/python3-pygame/python3-pygame.SlackBuild102
-rw-r--r--python/python3-pygame/python3-pygame.info10
-rw-r--r--python/python3-pygame/setup.patch54
-rw-r--r--python/python3-pygame/slack-desc19
5 files changed, 190 insertions, 0 deletions
diff --git a/python/python3-pygame/README b/python/python3-pygame/README
new file mode 100644
index 000000000000..d99665afd667
--- /dev/null
+++ b/python/python3-pygame/README
@@ -0,0 +1,5 @@
+Pygame is a free and open-source cross-platform library for the
+development of multimedia applications like video games using
+Python. It uses the Simple DirectMedia Layer library and several
+other popular libraries to abstract the most common functions,
+making writing these programs a more intuitive task.
diff --git a/python/python3-pygame/python3-pygame.SlackBuild b/python/python3-pygame/python3-pygame.SlackBuild
new file mode 100644
index 000000000000..4223d5e5711d
--- /dev/null
+++ b/python/python3-pygame/python3-pygame.SlackBuild
@@ -0,0 +1,102 @@
+#!/bin/bash
+
+# Slackware build script for python3-pygame
+
+# Copyright 2024 Dimitris Zlatanidis Orestiada, Greece
+#
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=python3-pygame
+SRCNAM=pygame
+VERSION=${VERSION:-2.5.2}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $SRCNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
+cd $SRCNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# Fix distro name for Slackware
+patch -p1 < $CWD/setup.patch
+
+# Since portmidi 2.0.2, libporttime is included in libportmidi.
+# Therfore use config-settings like for Fedora.
+sed -i 's;/etc/redhat-release;/etc/slackware-version;' buildconfig/config_unix.py
+
+# Remove unused command for Slackware
+sed -i 's/"dpkg-architecture -qDEB_HOST_MULTIARCH",//' buildconfig/config_unix.py
+
+python3 -u buildconfig/config.py
+CFLAGS="$SLKCFLAGS" \
+python3 setup.py install --root=$PKG
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README.rst docs/LGPL.txt docs/README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/python/python3-pygame/python3-pygame.info b/python/python3-pygame/python3-pygame.info
new file mode 100644
index 000000000000..48f2eae0986e
--- /dev/null
+++ b/python/python3-pygame/python3-pygame.info
@@ -0,0 +1,10 @@
+PRGNAM="python3-pygame"
+VERSION="2.5.2"
+HOMEPAGE="http://www.pygame.org/"
+DOWNLOAD="https://files.pythonhosted.org/packages/c6/aa/2c0c867d6cff00966cfc2152b25f61599f87e88b239e4dcb8ad5357f0f69/pygame-2.5.2.tar.gz"
+MD5SUM="bf45bc5288fa244a0dde60095bf4afb8"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="portmidi"
+MAINTAINER="Dimitris Zlatanidis"
+EMAIL="dslackw@gmail.com"
diff --git a/python/python3-pygame/setup.patch b/python/python3-pygame/setup.patch
new file mode 100644
index 000000000000..c8c0782f792a
--- /dev/null
+++ b/python/python3-pygame/setup.patch
@@ -0,0 +1,54 @@
+--- pygame-2.5.2/setup.orig 2024-01-06 19:06:26.065813273 +0200
++++ pygame-2.5.2/setup.py 2024-01-06 19:29:38.623909698 +0200
+@@ -7,6 +7,7 @@
+ # python setup.py install
+
+ import glob
++import distro
+ import platform
+ import sysconfig
+
+@@ -125,7 +126,7 @@
+ distutils.ccompiler.CCompiler.spawn = spawn
+
+ # A (bit hacky) fix for https://github.com/pygame/pygame/issues/2613
+-# This is due to the fact that distutils uses command line args to
++# This is due to the fact that distutils uses command line args to
+ # export PyInit_* functions on windows, but those functions are already exported
+ # and that is why compiler gives warnings
+ from distutils.command.build_ext import build_ext
+@@ -140,12 +141,10 @@
+ """
+ the_system = platform.system()
+ if the_system == 'Linux':
+- if hasattr(platform, 'linux_distribution'):
+- distro = platform.linux_distribution()
+- if distro[0].lower() == 'ubuntu':
+- the_system = 'Ubuntu'
+- elif distro[0].lower() == 'debian':
+- the_system = 'Debian'
++ if distro.name().lower() == 'ubuntu':
++ the_system = 'Ubuntu'
++ elif distro.name().lower() == 'slackware':
++ the_system = 'Slackware'
+
+ help_urls = {
+ 'Linux': 'https://www.pygame.org/wiki/Compilation',
+@@ -299,7 +298,7 @@
+ for i, kwargs in enumerate(queue):
+ kwargs['progress'] = f'[{i + 1}/{count}] '
+ cythonize_one(**kwargs)
+-
++
+ if cython_only:
+ sys.exit(0)
+
+@@ -458,7 +457,7 @@
+
+ if "freetype" in e.name and sys.platform not in ("darwin", "win32"):
+ # TODO: fix freetype issues here
+- if sysconfig.get_config_var("MAINCC") != "clang":
++ if sysconfig.get_config_var("MAINCC") != "clang":
+ e.extra_compile_args.append("-Wno-error=unused-but-set-variable")
+
+ if "mask" in e.name and sys.platform == "win32":
diff --git a/python/python3-pygame/slack-desc b/python/python3-pygame/slack-desc
new file mode 100644
index 000000000000..93586bdf939b
--- /dev/null
+++ b/python/python3-pygame/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+python3-pygame: python3-pygame (a set of Python modules designed for writing games)
+python3-pygame:
+python3-pygame: Pygame is a free and open-source cross-platform library for the
+python3-pygame: development of multimedia applications like video games using Python.
+python3-pygame: It uses the Simple DirectMedia Layer library and several other
+python3-pygame: popular libraries to abstract the most common functions, making
+python3-pygame: writing these programs a more intuitive task.
+python3-pygame:
+python3-pygame: Homepage: https://www.pygame.org/
+python3-pygame:
+python3-pygame: