summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 059bb4340d07856a8538936b4339734e31a6ec96 (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
# Maintainer: Brian Allred <brian.d.allred@gmail.com>

pkgname=gpmdp-git
_name=Google-Play-Music-Desktop-Player-UNOFFICIAL-
pkgver=4.7.1
pkgrel=1
pkgdesc="A beautiful cross platform Desktop Player for Google Play Music."
arch=('i686' 'x86_64')
url="http://www.googleplaymusicdesktopplayer.com"
license=('MIT')
depends=('desktop-file-utils' 'hicolor-icon-theme' 'nss' 'libxss' 'gtk3')
makedepends=('nodejs' 'electron' 'npm' 'git' 'gcc' 'libx11')
optdepends=('apparmor' 'avahi' 'libgnome-keyring')
provides=('gpmdp')
replaces=('google-play-music-desktop-player-git')
conflicts=('google-play-music-desktop-player-git' 'gpmdp')
install=gpmdp-git.install
source=("git+https://github.com/MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-.git"
        "gpmdp.desktop"
        "gpmdp-git.install")
md5sums=('SKIP'
         '8d23ff434999f7ec1e6e35d3344a1bb2'
         'bca71957329125ca4c55929f07091cce')

pkgver() {
  cd "$srcdir/$_name"
  git describe --tags | sed 's/^v//' | sed 's/-/./g'
}

build() {
  cd "$srcdir/$_name"
  rm -rf node_modules
  npm install

  if [ $CARCH = "x86_64" ]
  then
     npm run package:linux:64
  elif [ $CARCH = "i686" ]
  then
     npm run package:linux:32
  fi 

}

package() {
  # remarks: this package structure is based on a debtap conversion of the .deb output of 'npm run make:linux'

  cd "$pkgdir"

  # remarks: is there a way to keep npm from building for both architectures?
  if [ $CARCH = "x86_64" ]
  then
    dist_dir="$srcdir/$_name/dist/Google Play Music Desktop Player-linux-x64"
  elif [ $CARCH = "i686" ]
  then
    dist_dir="$srcdir/$_name/dist/Google Play Music Desktop Player-linux-ia32"
  fi

  # make directories
  mkdir -p usr/bin usr/share/applications/ usr/share/doc/gpmdp/ usr/share/pixmaps/ usr/share/gpmdp/

  # copy license
  cp "$dist_dir/LICENSE" usr/share/doc/gpmdp/
  # copy icon
  cp "$dist_dir/../../build/assets/img/main.png" usr/share/pixmaps/gpmdp.png
  # copy application
  cp -r "$dist_dir"/* usr/share/gpmdp
  # link binary
  ln -s "/usr/share/gpmdp/Google Play Music Desktop Player" "usr/bin/gpmdp"
  # create desktop entry
  cp $srcdir/gpmdp.desktop usr/share/applications/
}