summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a0c515fd38f0268f915bd1dbd220c1b35acfecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=python-steam
_name=${pkgname#python-}
_pkgver=2.0.0-alpha1
pkgver=${_pkgver//-/.}
pkgrel=2
pkgdesc="Python package for interacting with Steam"
arch=('any')
url="https://github.com/solsticegamestudios/steam"
license=('MIT')
depends=(
  'python'
  'python-cachetools'
  'python-certifi'
  'python-gevent'
  'python-lxml'
  'python-protobuf'
  'python-pycryptodomex'
  'python-requests'
  'python-six'
  'python-vdf'
  'python-wsproto'
  'python-zstandard'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-gevent-eventemitter'
  'python-pytest'
  'python-vcrpy'
)
replaces=('python-steam-solstice')
source=("$_name-${_pkgver}.tar.gz::$url/archive/refs/tags/v${_pkgver}.tar.gz"
        'https://github.com/solsticegamestudios/steam/pull/14.patch'
        'pkg_resources.patch')
sha256sums=('6447a3c97248885b44b73fec3bdcaee0421fe3e6e062d1bb195b9de3acc7eb0a'
            '70d3ba6f86f341c9b00ba43fa5feec76870bc4421e6b528e3378f9b2a7d30221'
            '91fee1a59979dd29ee9667b60bd3b20e542923b98a129e90db1cbdddc3a68827')

prepare() {
  cd "$_name-${_pkgver}"

  # Regenerate protos
  sed -i 's/protoc3/protoc/g' Makefile
  make pb_compile
  make pb_services
  make pb_gen_enums

  # cdn: Add ZSTD support
  # https://github.com/solsticegamestudios/steam/issues/13
  patch -Np1 -i ../14.patch

  # pkg_resources deprecated in Setuptools 82+
  # https://archlinux.org/todo/python-pkg_resources-deprecation/
  patch -Np1 -i ../pkg_resources.patch
}

build() {
  cd "$_name-${_pkgver}"
  python -m build --wheel --no-isolation
}

check() {
  cd "$_name-${_pkgver}"
  pytest || :
}

package() {
  cd "$_name-${_pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}