[arch-commits] Commit in python2-pygame-sdl2/trunk (PKGBUILD)

Maxime Gauduin alucryd at archlinux.org
Mon Jan 4 09:14:29 UTC 2021


    Date: Monday, January 4, 2021 @ 09:14:28
  Author: alucryd
Revision: 806834

upgpkg: python-pygame-sdl2 1:2.1.0.r387.2eee9b2-1

Modified:
  python2-pygame-sdl2/trunk/PKGBUILD

----------+
 PKGBUILD |   54 ++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 16 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-01-04 09:14:10 UTC (rev 806833)
+++ PKGBUILD	2021-01-04 09:14:28 UTC (rev 806834)
@@ -1,9 +1,13 @@
 # Maintainer: Maxime Gauduin <alucryd at archlinux.org>
 # Contributor: Cravix <dr.neemous at gmail.com>
 
-pkgname=python2-pygame-sdl2
-pkgver=2.1.0.r357.6474370
-pkgrel=2
+pkgbase=python-pygame-sdl2
+pkgname=(
+  python-pygame-sdl2
+  python2-pygame-sdl2
+)
+pkgver=2.1.0.r387.2eee9b2
+pkgrel=1
 epoch=1
 pkgdesc='Reimplementation of portions of the pygame API using SDL2'
 arch=(x86_64)
@@ -13,17 +17,20 @@
   zlib
 )
 depends=(
-  python2
   sdl2_image
   sdl2_mixer
   sdl2_ttf
 )
 makedepends=(
+  cython
   cython2
   git
+  python
+  python2
 )
+_commit=2eee9b25dae04cedf98c8c4c4254f3dc970354df
 source=(
-  git+https://github.com/renpy/pygame_sdl2.git#commit=6474370f2e67ed392c4685c98f2eb88dce79cff6
+  git+https://github.com/renpy/pygame_sdl2.git#commit=${_commit}
   cython.patch
 )
 sha256sums=(
@@ -31,27 +38,42 @@
   fe2ec4d84444ee72c3607ac9e02bf309f069c2b289b5f3d43483db145d741b01
 )
 
-pkgver() {
-  cd pygame_sdl2
-
- echo "2.1.0.r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
-}
-
 prepare() {
-  cd pygame_sdl2
+  cp -r pygame_sdl2 python2-pygame_sdl2
+  mv pygame_sdl2 python-pygame_sdl2
 
+  cd python2-pygame_sdl2
   patch -Np1 -i ../cython.patch
 }
 
+pkgver() {
+  cd python-pygame_sdl2
+  version="$(cat src/pygame_sdl2/version.py | grep '^vernum = ' | sed 's/^vernum = //; s/(//; s/)//; s/, /./g')"
+  echo "${version}.r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
+}
+
 build() {
-  cd pygame_sdl2
+  for p in python{,2}; do
+    pushd $p-pygame_sdl2
+    $p setup.py build
+    popd
+  done
+}
 
-  python2 setup.py build
+package_python-pygame-sdl2() {
+  depends+=(python)
+
+  cd python-pygame_sdl2
+
+  python setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1 --skip-build
+  install -Dm 644 COPYING.ZLIB -t "${pkgdir}"/usr/share/licenses/python-pygame-sdl2/
 }
 
-package() {
-  cd pygame_sdl2
+package_python2-pygame-sdl2() {
+  depends+=(python2)
 
+  cd python2-pygame_sdl2
+
   python2 setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1 --skip-build
   install -Dm 644 COPYING.ZLIB -t "${pkgdir}"/usr/share/licenses/python2-pygame-sdl2/
 }



More information about the arch-commits mailing list