summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 52b7d0aa8d79a7d801e61d35fbdfd4bf463a3f0a (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer:  <yatsen71@oarchbox1>
pkgname=zy-player-bin
_pkgname=zy-player
pkgver=2.8.5
_pkgver=$(echo $pkgver | sed 's/\./-/3')
pkgrel=1
epoch=
pkgdesc="跨平台视频资源播放器, 简洁免费无广告"
arch=('x86_64')
url="https://github.com/Hunlongyu/ZY-Player/"
license=('MIT')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=('zy-player')
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
noextract=()
options=(!strip)
source=("https://github.com/Hunlongyu/ZY-Player/releases/download/v${_pkgver}/ZY-Player-${_pkgver}.AppImage"
        'zy-player.sh')
sha256sums=('c5ed1ef42418049123c450d2f2d58628e37bf54263e1bbc6c656e87e8e66fe8b'
            '4ef23f78868eaa861b979039102529779d6714e5faa1cf865ded1da8b3b83baf')

_filename=ZY-Player-${_pkgver}.AppImage

# dont compress for test, from /etc/makepkg.conf
#PKGEXT='.pkg.tar'
#PKGEXT='.pkg.tar.zst'

prepare() {
  cd "$srcdir"
  chmod +x $_filename
  "./$_filename" --appimage-extract >/dev/null 2>&1
  if [ -d "$srcdir/$pkgname-$pkgver" ]; then
    rm -rf "$srcdir/$pkgname-$pkgver"
  fi
  mv squashfs-root "$srcdir/$pkgname-$pkgver"

  cd "$srcdir/$pkgname-$pkgver"
  sed -i 's/AppRun/zy-player.sh/' zy.desktop
  #patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  #./configure --prefix=/usr
  #make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"

  #make -k check
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  #make DESTDIR="$pkgdir/" install

  mkdir -p "$pkgdir/opt/zy-player/"
  find "usr/share/" -type f -exec install -vDm 644 {} "$pkgdir/{}" \;
  find "locales/" -type f -exec install -vDm 644 {} "$pkgdir/opt/zy-player/{}" \;
  find "resources/" -type f -exec install -vDm 644 {} "$pkgdir/opt/zy-player/{}" \;
  #find "usr/lib/" -type f -exec install -vDm 755 {} "$pkgdir/opt/zy-player/{}" \;
  #find -type f -exec install -vDm 755 {} "$pkgdir/opt/zy-player/{}" \;
  #rm -f "$pkgdir/opt/zy-player/zy"
  for f in `echo "chrome_100_percent.pak
      chrome_200_percent.pak
      resources.pak
      LICENSE.electron.txt
      LICENSES.chromium.html"`; do
    echo "$f $PWD"
    install -vDm 644 "$f" "$pkgdir/opt/zy-player/"
  done
  for f in `echo "snapshot_blob.bin
      v8_context_snapshot.bin
      icudtl.dat
      libffmpeg.so"`; do
    echo "$f $PWD"
    install -vDm 755 "$f" "$pkgdir/opt/zy-player/"
  done
  install -vDm 755 zy.desktop "$pkgdir/usr/share/applications/${_pkgname}.desktop"
  install -vDm 755 "$srcdir/$_pkgname.sh" "$pkgdir/usr/bin/zy-player.sh"
  install -vDm 755 zy "$pkgdir/opt/zy-player/zy-player"
  sed -i 's/StartupWMClass=ZY Player/StartupWMClass=zy/' "$pkgdir/usr/share/applications/zy-player.desktop"
}

# vim:set ts=2 sw=2 et: