tidal-hifi-git/PKGBUILD

75 lines
2.8 KiB
Bash
Raw Permalink Normal View History

# Maintainer: Rick van Lieshout <info@rickvanlieshout.com>
2021-06-26 16:03:22 +02:00
pkgname=tidal-hifi-git
2022-11-03 13:36:59 +01:00
pkgrel=2
pkgver=4.3.1.r1.gcd2a068
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)
url="https://github.com/Mastermindzh/tidal-hifi"
license=("custom:MIT")
depends=(libxss nss gtk3 libxcrypt-compat)
2022-05-12 08:53:00 +02:00
makedepends=(git nvm)
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-09-11 23:29:20 +02:00
'20dc16dfd79cd00686b29bc621c64568b6557d73da5b7c1fba7dee0277784cc6f133520ca55d83fb878c3e5cc6734b6fd1b47502366a8907113625ce4e362bbc'
2022-08-07 16:54:53 +02:00
"e06fce55c2d9fcaeff514b97e8b003dca4c1a0aa8c8e14c3e3b99febbc2e8af7402d2e2009147f3f57a9b6447fafd23dd69e7b4de63cf43c5d67825836ebecb5")
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'
}
prepare() {
2022-05-12 08:59:12 +02:00
# This PKGBUILD is meant to run in a build container, so we can do this
# every time.
source /usr/share/nvm/init-nvm.sh
2022-04-21 18:24:00 +02:00
cd "${srcdir}/${pkgname%-git}" || exit
2021-12-04 13:04:17 +01:00
# use correct nodejs/npm versions
nvm install lts/gallium
nvm use lts/gallium
# install build dependencies
npm install
}
build() {
2023-01-14 09:15:31 +01:00
# Each function needs this separately
source /usr/share/nvm/init-nvm.sh
2022-04-21 18:24:00 +02:00
cd "${srcdir}/${pkgname%-git}" || exit
# 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
}
package() {
2022-04-21 18:24:00 +02:00
cd "${srcdir}/${pkgname%-git}" || exit
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"
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"
2021-06-26 16:03:22 +02:00
ln -s "/opt/tidal-hifi/tidal-hifi" "${pkgdir}/usr/bin/tidal-hifi"
2021-06-26 16:03:22 +02:00
install -Dm 644 "build/icon.png" "${pkgdir}/usr/share/pixmaps/tidal-hifi.png"
2022-11-03 13:36:59 +01:00
install -Dm 644 "build/icon.png" "${pkgdir}/usr/share/icons/${pkgname%-git}/tidal-hifi.png"
2022-08-07 16:54:53 +02:00
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"
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"
}