SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "python-pygame"

# SliTaz package receipt.

PACKAGE="python-pygame"
SOURCE="pygame"
VERSION="1.9.1release"
CATEGORY="development"
SHORT_DESC="Python game library."
MAINTAINER="claudinei@slitaz.org"
LICENSE="LGPL"
TARBALL="$SOURCE-$VERSION.tar.gz"
WEB_SITE="https://pypi.org/project/pygame/"
WGET_URL="https://github.com/pygame/pygame/archive/refs/tags/release_${VERSION//./_}.tar.gz"

DEPENDS="python libsdl libsdl-image libsdl-mixer libsdl-ttf python-numpy \
libsmpeg gcc-lib-base"
BUILD_DEPENDS="python-dev libsmpeg-dev libsdl-dev libsdl-image-dev \
libsdl-mixer-dev libsdl-ttf-dev libv4l-dev"

# What is the latest version available today?
current_version()
{
    wget -O - https://github.com/pygame/pygame/releases 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    patch -Np0 -i $stuff/config.patch
    sed -i "s|linux/videodev.h|libv4l1-videodev.h|" src/camera.h
    python config.py -auto &&
    python setup.py install --root=$DESTDIR
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    PYTHON_LIB=python$(grep ^VERSION= $WOK/python/receipt | sed 's/.*"\(...\).*/\1/')
    mkdir -p $fs/usr
    cp -a $install/usr/lib $fs/usr
    chmod 644 $fs/usr/lib/$PYTHON_LIB/site-packages/pygame/freesansbold.ttf
    # examples and tests in python-pygame-dev
    rm -rf $fs/usr/lib/$PYTHON_LIB/site-packages/pygame/examples
    rm -rf $fs/usr/lib/$PYTHON_LIB/site-packages/pygame/tests
}

# Remove old package.
post_install()
{
    [ ! -d "$1/var/lib/tazpkg/installed/pygame/examples" ] ||
    rm -rf "$1/var/lib/tazpkg/installed/pygame/examples"
}
6047 packages and 209931 files in current database (Mon Jul 1 15:25:36 2024)