summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2330b88f0106fe393dd3fd3cfadff0d519ca95e4 (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
# Maintainer:
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: Skykey <zcxzxlc@163.com>
pkgname=qtscrcpy-git
_pkgname=QtScrcpy
pkgver=1.7.1.r0.g543e22d
pkgrel=1
pkgdesc="Android real-time screencast control tool"
arch=('x86_64')
url="https://github.com/barry-ran/QtScrcpy"
license=('Apache')
depends=('android-tools' 'ffmpeg' 'qt5-x11extras')
makedepends=('cmake' 'git' 'qt5-tools')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}" 'qt-scrcpy')
backup=("etc/${pkgname%-git}/config.ini")
source=('git+https://github.com/barry-ran/QtScrcpy.git'
        'path-fix.patch'
        "${pkgname%-git}.desktop"
        "${pkgname%-git}.sh")
sha256sums=('SKIP'
            '19a9dae14c041715ee96cb6357c9f46ff7a9c5342f7e0d798bb17d6244347bfe'
            '0dc5b08698162c8a0172a9c2e92b18fa7cd9df4b295bd350329b1e4dbd892a6e'
            '26335d1e208c47ddfc4abaabce3f32734788a80a6663577b3ff462346d8dec6f')

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

prepare() {
  cd "$srcdir/$_pkgname"

  # Use system packages instead of static bundled tools
  rm -rf third_party/{adb,ffmpeg}

  cd "$_pkgname"
  patch < "$srcdir/path-fix.patch"
}

build() {
  cmake -B build -S "$_pkgname" \
    -DCMAKE_BUILD_TYPE='None' \
    -Wno-dev
  make -C build
}

package() {
  cd "$srcdir/$_pkgname"
  install -Dm755 "output/linux/release/$_pkgname" -t "$pkgdir/opt/${pkgname%-git}"
  install -Dm644 backup/logo.png "$pkgdir/usr/share/pixmaps/${pkgname%-git}.png"
  install -Dm644 config/config.ini -t "$pkgdir/etc/${pkgname%-git}"
  install -Dm644 third_party/scrcpy-server -t "$pkgdir/opt/${pkgname%-git}"

  cp -r keymap "$pkgdir/opt/${pkgname%-git}"
  chmod 666 "$pkgdir/opt/${pkgname%-git}/keymap"

  install -d "$pkgdir/usr/share/doc/${pkgname%-git}"
  cp -r docs/* "$pkgdir/usr/share/doc/${pkgname%-git}"

  install -Dm755 "$srcdir/${pkgname%-git}.sh" "$pkgdir/usr/bin/${pkgname%-git}"
  install -Dm644 "$srcdir/${pkgname%-git}.desktop" -t "$pkgdir/usr/share/applications"
}