2019-12-02 22:24:29 +01:00
# Maintainer: Rick van Lieshout <info@rickvanlieshout.com>
2021-06-26 16:03:22 +02:00
pkgname = tidal-hifi-git
2022-08-07 16:54:53 +02:00
pkgrel = 1
2022-08-23 22:04:03 +02:00
pkgver = 4.1.1.r0.g4941aae
2021-11-29 23:38:52 +01:00
pkgdesc = "The web version of listen.tidal.com running in electron with hifi support thanks to widevine. If the install fails use nvm to temporarily downgrade npm"
2021-06-26 16:03:22 +02:00
arch = ( x86_64)
2019-12-02 22:24:29 +01:00
url = "https://github.com/Mastermindzh/tidal-hifi"
license = ( "custom:MIT" )
2022-02-23 17:17:20 +01:00
depends = ( libxss nss gtk3 libxcrypt-compat)
2021-12-04 13:04:17 +01:00
makedepends = ( git)
2021-06-26 16:03:22 +02:00
provides = ( tidal-hifi)
conflicts = ( tidal-hifi)
source = ( "git+https://github.com/Mastermindzh/tidal-hifi.git"
2022-08-07 16:54:53 +02:00
"tidal-hifi.desktop"
"tidal-hifi.xml" )
2021-06-26 16:03:22 +02:00
sha512sums = ( 'SKIP'
2022-08-07 16:54:53 +02:00
'402a73f4bc4c543208d518044607af8b71da428d58b37397a2d74bad1f0d4b854a0a037fd2d29ac157e7185165afe13865a87c57abe8019617de73a767087918'
"e06fce55c2d9fcaeff514b97e8b003dca4c1a0aa8c8e14c3e3b99febbc2e8af7402d2e2009147f3f57a9b6447fafd23dd69e7b4de63cf43c5d67825836ebecb5" )
2021-06-26 16:03:22 +02:00
2021-12-04 13:04:17 +01:00
getnvm( ) {
2022-06-18 11:23:50 +02:00
if command -v nvm; then
2021-12-04 13:04:17 +01:00
echo "nvm command found, using system version.."
else
2022-06-18 11:23:50 +02:00
if test -f "/usr/share/nvm/init-nvm.sh" ; then
2021-12-19 13:44:15 +01:00
echo "found init-nvm.sh in /usr/share/nvm, sourcing..."
2021-12-28 17:57:13 +01:00
unset npm_config_prefix
2021-12-19 13:44:15 +01:00
source "/usr/share/nvm/init-nvm.sh"
else
echo "nvm could not be found, installing"
unset npm_config_prefix
folderName = $( cat /dev/urandom | tr -cd 'a-f0-9' | head -c 12)
git clone https://aur.archlinux.org/nvm.git " $folderName "
2022-04-21 18:24:00 +02:00
cd " $folderName " || exit
2021-12-19 13:44:15 +01:00
makepkg -si --asdeps
source /usr/share/nvm/init-nvm.sh
cd ../
rm -rf " $folderName "
fi
2021-12-04 13:04:17 +01:00
fi
}
2021-06-26 16:03:22 +02:00
pkgver( ) {
2022-04-21 18:24:00 +02:00
cd " ${ srcdir } / ${ pkgname %-git } " || exit
2021-06-26 16:03:22 +02:00
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
2019-12-02 22:24:29 +01:00
}
prepare( ) {
2021-12-04 13:04:17 +01:00
getnvm
2022-06-18 11:23:50 +02:00
2022-04-21 18:24:00 +02:00
cd " ${ srcdir } / ${ pkgname %-git } " || exit
2022-06-18 11:23:50 +02:00
2021-12-04 13:04:17 +01:00
# use correct nodejs/npm versions
nvm install lts/gallium
nvm use lts/gallium
2022-06-18 11:23:50 +02:00
2019-12-02 22:24:29 +01:00
# install build dependencies
npm install
}
build( ) {
2021-12-23 17:57:53 +01:00
getnvm
2022-06-18 11:23:50 +02:00
2022-04-21 18:24:00 +02:00
cd " ${ srcdir } / ${ pkgname %-git } " || exit
2022-06-18 11:23:50 +02:00
2019-12-02 22:24:29 +01:00
# We are not using the systems Electron as we need castlab's Electron.
2020-10-05 11:19:22 +02:00
npm run build-arch
2019-12-02 22:24:29 +01:00
}
package( ) {
2022-04-21 18:24:00 +02:00
cd " ${ srcdir } / ${ pkgname %-git } " || exit
2022-06-18 11:23:50 +02:00
2021-06-26 16:03:22 +02:00
install -d " ${ pkgdir } /opt/tidal-hifi/ " " ${ pkgdir } /usr/bin " " ${ pkgdir } /usr/share/doc " " ${ pkgdir } /usr/share/licenses "
2022-06-18 11:23:50 +02:00
2021-06-26 16:03:22 +02:00
cp -r dist/linux-unpacked/* " ${ pkgdir } /opt/tidal-hifi/ "
chmod +x " ${ pkgdir } /opt/tidal-hifi/tidal-hifi "
2022-06-18 11:23:50 +02:00
2021-06-26 16:03:22 +02:00
ln -s "/opt/tidal-hifi/tidal-hifi" " ${ pkgdir } /usr/bin/tidal-hifi "
2022-06-18 11:23:50 +02:00
2021-06-26 16:03:22 +02:00
install -Dm 644 "build/icon.png" " ${ pkgdir } /usr/share/pixmaps/tidal-hifi.png "
2022-08-07 16:54:53 +02:00
install -Dm 644 "build/icon.png" " ${ pkgdir } /usr/share/icons/ ${ _pkgname } /tidal-hifi.png "
install -Dm 644 "build/icon.png" " ${ pkgdir } /usr/share/icons/hicolor/0x0/apps/tidal-hifi.png "
2021-06-26 16:03:22 +02:00
install -Dm 644 " ${ srcdir } /tidal-hifi.desktop " " ${ pkgdir } /usr/share/applications/tidal-hifi.desktop "
2022-08-07 16:54:53 +02:00
install -Dm 644 " ${ srcdir } /tidal-hifi.xml " " ${ pkgdir } /usr/share/mime/packages/tidal-hifi.xml "
2022-06-18 11:23:50 +02:00
2019-12-02 22:24:29 +01:00
install -Dm 644 "README.md" " ${ pkgdir } /usr/share/doc/ ${ pkgname } /README.md "
install -Dm 644 "LICENSE" " ${ pkgdir } /usr/share/licenses/ ${ pkgname } /LICENSE "
2021-06-27 22:17:51 +02:00
install -Dm 644 "build/icon.png" " ${ pkgdir } /usr/share/icons/hicolor/0x0/apps/tidal-hifi.png "
2022-08-07 16:54:53 +02:00
2021-06-26 16:03:22 +02:00
ln -s "/opt/tidal-hifi/LICENSE.electron.txt" " ${ pkgdir } /usr/share/licenses/ ${ pkgname } /LICENSE.electron.txt "
ln -s "/opt/tidal-hifi/LICENSES.chromium.html" " ${ pkgdir } /usr/share/licenses/ ${ pkgname } /LICENSES.chromium.html "
2019-12-02 22:24:29 +01:00
}