summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a9e2f62f3b118944d73b37ce47b131bacb123aad (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
pkgname=kawaii-player-git
_pkgname=kawaii-player
pkgver=v3.1.1.0.r66.gb9f0f55
pkgrel=1
pkgdesc="An Audio/Video Manager and Front End for mpv/mplayer along with functionalities of portable media server"
arch=(any)
conflicts=('kawaii-player')
license=('GPL3')
depends=('python' 'qt5-webengine' 'python-pyqt5' 'python-pycurl' 'curl' 'libnotify' 'python-dbus' 'libtorrent-rasterbar' 'python-pytaglib' 'python-mutagen' 'python-beautifulsoup4' 'python-pillow' 'python-lxml' 'mpv' 'mplayer' 'ffmpegthumbnailer' 'sqlite3' 'youtube-dl' 'wget')
#optdepends=('livestreamer' 'youtube-dl' 'wget')
makedepends=('git')

source=("git+https://github.com/kanishka-linux/kawaii-player.git")
#source=("git+https://github.com/kanishka-linux/kawaii-player.git#branch=devel")
md5sums=('SKIP')
_gitname=kawaii_player

pkgver() {
  cd "$srcdir/kawaii-player"
  # cutting off 'foo-' prefix that presents in the git tag
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {

  _bpath="${srcdir}/kawaii-player/${_gitname}"

  install -d "${pkgdir}/usr/share/${_pkgname}/"
  install -d "${pkgdir}/usr/share/applications/"
  install -d "${pkgdir}/usr/bin/"
  
  for file in "${_bpath}/"*;do
  	nm=$(echo $file | rev | cut -d'/' -f1 | rev)
  	if [ -d "$file" ];then
		install -d "${pkgdir}/usr/share/${_pkgname}/${nm}/"
		_plugin_path="$file/"
		for plugins in "${_plugin_path}"*;do
			plugin_name=$(echo $plugins | rev | cut -d'/' -f1 | rev)
            if [ $plugin_name == 'kawaii-player.desktop' ]; then
                echo $plugins
                echo 'desktop file copying'
                cat "${_plugin_path}kawaii-player.desktop" | sed 's/Exec=/Exec=python -B \/usr\/share\/kawaii-player\/kawaii_player.py \%f/g' > "${pkgdir}/usr/share/applications/kawaii-player.desktop"
			elif [ $plugin_name != 'installPlugins.py' ];then
				echo $plugins
				echo 'Plugins copying'
				install -Dm755 "$plugins" "${pkgdir}/usr/share/${_pkgname}/${nm}/"
			fi
		done
  	else
		if [ $nm == 'kawaii-player' ];then
			echo $file
			echo 'kawaii-player script'
			install -Dm755 "$file" "${pkgdir}/usr/bin/kawaii-player"
			chmod +x "${pkgdir}/usr/bin/kawaii-player"
		else 
            echo $file
            echo 'source files copying'
            install -Dm755 "$file" "${pkgdir}/usr/share/${_pkgname}/"
		fi
	fi
  done
  
}