diff options
author | Dimitris Zlatanidis <dslackw@gmail.com> | 2024-01-08 08:27:18 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-01-08 11:48:51 +0700 |
commit | 3548082ae2d408764e35855924d6f3025707e2df (patch) | |
tree | cd0b7e0089f309c13d53967a010d46460f3de096 /python/python2-pygame | |
parent | 311e0b6ab4b517883f3bfeb3d7bbc4f5befafdf4 (diff) |
python/python2-pygame: Added (python2 version of pygame).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/python2-pygame')
-rw-r--r-- | python/python2-pygame/README | 5 | ||||
-rw-r--r-- | python/python2-pygame/python2-pygame.SlackBuild | 105 | ||||
-rw-r--r-- | python/python2-pygame/python2-pygame.info | 10 | ||||
-rw-r--r-- | python/python2-pygame/setup.patch | 21 | ||||
-rw-r--r-- | python/python2-pygame/slack-desc | 19 |
5 files changed, 160 insertions, 0 deletions
diff --git a/python/python2-pygame/README b/python/python2-pygame/README new file mode 100644 index 0000000000000..d99665afd667a --- /dev/null +++ b/python/python2-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/python2-pygame/python2-pygame.SlackBuild b/python/python2-pygame/python2-pygame.SlackBuild new file mode 100644 index 0000000000000..2370c48666202 --- /dev/null +++ b/python/python2-pygame/python2-pygame.SlackBuild @@ -0,0 +1,105 @@ +#!/bin/bash + +# Slackware build script for python2-pygame + +# Copyright 2024 Dimitris Zlatanidis Orestiada, Greece +# Contribution by B.Watson (urchlay@slackware.uk), 11 apr. 2017. +# +# 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=python2-pygame +SRCNAM=pygame +VERSION=${VERSION:-2.0.3} +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 {} \; + +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 + +# Contributed by B.Watson (urchlay@slackware.uk). +# Gets rid of the call to remove_old_files() during packaging. +# TLDR: Stops packaging scripts from messing with a local PyGame install. +sed -i '/^if "install"/,$d' setup.py + +# Pygame version 2.0.3 is the last that supports python2 +python2 -u buildconfig/config.py +CFLAGS="$SLKCFLAGS" \ +python2 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/python2-pygame/python2-pygame.info b/python/python2-pygame/python2-pygame.info new file mode 100644 index 0000000000000..9b9e951f0522e --- /dev/null +++ b/python/python2-pygame/python2-pygame.info @@ -0,0 +1,10 @@ +PRGNAM="python2-pygame" +VERSION="2.0.3" +HOMEPAGE="http://www.pygame.org/" +DOWNLOAD="https://files.pythonhosted.org/packages/47/a6/bd02c7354ac7e975e52443a24dbd0be8d071c59b75d54db9dfa87cd2979f/pygame-2.0.3.tar.gz" +MD5SUM="04e082d216b3b771b8d52769597b2fb2" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="portmidi" +MAINTAINER="Dimitris Zlatanidis" +EMAIL="dslackw@gmail.com" diff --git a/python/python2-pygame/setup.patch b/python/python2-pygame/setup.patch new file mode 100644 index 0000000000000..687c7588742a7 --- /dev/null +++ b/python/python2-pygame/setup.patch @@ -0,0 +1,21 @@ +--- pygame-2.0.3/setup.orig 2022-02-20 22:52:08.449183353 +0200 ++++ pygame-2.0.3/setup.py 2022-02-20 22:52:57.916188118 +0200 +@@ -75,7 +75,7 @@ + + + # 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 +@@ -95,6 +95,9 @@ + the_system = 'Ubuntu' + elif distro[0].lower() == 'debian': + the_system = 'Debian' ++ elif distro[0].lower() == 'slackware': ++ the_system = 'Slackware' ++ + + help_urls = { + 'Linux': 'https://www.pygame.org/wiki/Compilation', diff --git a/python/python2-pygame/slack-desc b/python/python2-pygame/slack-desc new file mode 100644 index 0000000000000..68208d110897e --- /dev/null +++ b/python/python2-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------------------------------------------------------| +python2-pygame: python2-pygame (a set of Python modules designed for writing games) +python2-pygame: +python2-pygame: Pygame is a free and open-source cross-platform library for the +python2-pygame: development of multimedia applications like video games using Python. +python2-pygame: It uses the Simple DirectMedia Layer library and several other +python2-pygame: popular libraries to abstract the most common functions, making +python2-pygame: writing these programs a more intuitive task. +python2-pygame: +python2-pygame: Homepage: https://www.pygame.org/ +python2-pygame: +python2-pygame: |