summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 91ce3d5596f25e66fdd1b5a7c17938392a714b1d (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=guiscrcpy-git
pkgver=2023.1.1.r6.g9a912f9
pkgrel=1
epoch=1
pkgdesc="Open Source GUI based Android Screen Mirroring System"
arch=('any')
url="https://guiscrcpy.srev.in"
license=('GPL3')
depends=(
  'libxinerama'
  'pyside2'
  'python-cairosvg'
  'python-click'
  'python-colorama'
  'python-psutil'
  'python-pynput'
  'python-qtpy'
  'scrcpy'
)
makedepends=(
  'desktop-file-utils'
  'git'
  'python-build'
  'python-installer'
  'python-poetry-core'
)
checkdepends=('appstream-glib')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/srevinsaju/guiscrcpy.git')
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"
  git describe --long --tags --exclude continuous | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${pkgname%-git}"

  # Add non-localized key "Comment"
  desktop-file-edit --set-key=Comment --set-value="Comment=Screen mirroring application for Android" \
    "appimage/${pkgname%-git}.desktop"

  # Force launching with PySide2
  desktop-file-edit --set-key=Exec --set-value="env QT_API=pyside2 ${pkgname%-git}" \
    "appimage/${pkgname%-git}.desktop"
}

build() {
  cd "${pkgname%-git}"
  GIT_DIR='.' python -m build --wheel --no-isolation
}

check() {
  cd "${pkgname%-git}"
  appstream-util validate-relax --nonet "appimage/${pkgname%-git}.appdata.xml" || :
  desktop-file-validate "appimage/${pkgname%-git}.desktop" || :
}

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

  install -Dm644 "appimage/${pkgname%-git}.appdata.xml" -t "$pkgdir/usr/share/metainfo/"
  install -Dm644 "appimage/${pkgname%-git}.desktop" -t "$pkgdir/usr/share/applications/"

  for size in 128 256; do
    install -Dm644 appimage/${pkgname%-git}-${size}.png -t \
      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/"
  done
}