# Compiling Time: 0.01 SBU
# Maintainer: DeX77 <dex77@frugalware.org>

pkgname=cpod
pkgver=1.27.1
pkgrel=1
pkgdesc="A simple, beautiful podcast app"
archs=('x86_64')
groups=('xapps-extra')
depends=('gconf' 'dbus-glib')
makedepends=('gulp' 'nodejs' 'yarn' 'nvm' 'x11-protos' 'dbus-python' 'dbus-python-devel' 'dbus-c++' 'dbus-x11')
_nodejsver=8.16.0
_F_github_author="z-------------"
_F_github_tag_v=y
Finclude github
sha1sums=('2e2b9341985e96a0d7c0663a66c538552043ce33')
_F_cd_path="CPod-$pkgver"

build() {
	Fcd
	
	export HOME="$Fsrcdir/$pkgname"
	export LC_ALL=en_US.UTF8
	export LANG=en_US.UTF8
	
	# Use a specific Node.js version
	export NVM_DIR="$Fsrcdir/$pkgname/.nvm"
	source /usr/share/nvm/nvm.sh
	Fexec nvm install $_nodejsver || Fdie
	Fexec nvm use $_nodejsver || Fdie
	
	Fexec yarn || Fdie
	
	Fexec gulp || Fdie
	Fexec yarn dist --linux --x64 deb || Fdie

	cd dist
	Fexec bsdtar xf CPod_*.deb data.tar.xz || Fdie
  	Fexec bsdtar xf data.tar.xz --directory "$Fdestdir" || Fdie
	
	Fln /opt/CPod/cpod usr/bin/$pkgname
}

# optimization OK
