summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD90
1 files changed, 66 insertions, 24 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1cdaad83c1c4..135e507abfc0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,72 @@
-# Maintainer: Mikel Pintado <mikelaitornube2010@gmail.com>
-
+# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
+# Contributor: Mikel Pintado <mikelaitornube2010@gmail.com>
pkgname=nuclear-player
-pkgver=0.4.3
-pkgrel=1
+_pkgname="Nuclear Player"
+pkgver=0.6.30
+_electronversion=12
+_nodeversion=18
+pkgrel=6
pkgdesc="A free, multiplatform music player app that streams from multiple sources."
-arch=('x86_64')
+arch=('any')
url="http://nuclear.gumblert.tech/"
-install=nuclear-player.install
-license=('GPL3')
-depends=('gconf' 'libnotify' 'libappindicator-gtk3' 'libxtst' 'nss')
-source=(
- https://github.com/nukeop/nuclear/releases/download/v${pkgver}/nuclear_${pkgver}_amd64.deb
- nuclear.desktop
+_ghurl="https://github.com/nukeop/nuclear"
+license=('AGPL-3.0-only')
+depends=(
+ "electron${_electronversion}-bin"
+)
+makedepends=(
+ 'gendesk'
+ 'npm'
+ 'nvm'
+ 'base-devel'
+ 'gcc'
+ 'git'
+ 'python>=3'
)
-md5sums=(
- '96806f286f8613042e2b860d7e8e22d9'
- '02328fb5995b2e92b3ee11dca5c6b262'
+source=(
+ "${pkgname}.git::git+${_ghurl}#tag=v${pkgver}"
+ "${pkgname}.sh"
)
-
-package() {
- tar xf data.tar.xz
-
- cp --preserve=mode -r usr "${pkgdir}"
- cp --preserve=mode -r opt "${pkgdir}"
-
- find "${pkgdir}" -type d -exec chmod 755 {} +
-
- cp --preserve=mode ${srcdir}/nuclear.desktop ${pkgdir}/usr/share/applications
+sha256sums=('SKIP'
+ 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
+_ensure_local_nvm() {
+ export NVM_DIR="${srcdir}/.nvm"
+ source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
+ nvm install "${_nodeversion}"
+ nvm use "${_nodeversion}"
+}
+build() {
+ sed -e "s|@electronversion@|${_electronversion}|" \
+ -e "s|@appname@|${pkgname}|g" \
+ -e "s|@runname@|app.asar|g" \
+ -e "s|@options@||g" \
+ -i "${srcdir}/${pkgname}.sh"
+ _ensure_local_nvm
+ gendesk -q -f -n --categories="AudioVideo" --name="${_pkgname}" --exec="${pkgname} %U"
+ cd "${srcdir}/${pkgname}.git"
+ export npm_config_build_from_source=true
+ export npm_config_cache="${srcdir}/.npm_cache"
+ export ELECTRON_SKIP_BINARY_DOWNLOAD=1
+ export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
+ export npm_config_target="${SYSTEM_ELECTRON_VERSION}"
+ export ELECTRONVERSION="${_electronversion}"
+ export npm_config_disturl=https://electronjs.org/headers
+ HOME="${srcdir}/.electron-gyp"
+ if [ `curl ifconfig.co/country` = "China" ];then
+ echo 'registry="https://registry.npmmirror.com/"' >> .npmrc
+ echo 'electron_mirror="https://registry.npmmirror.com/-/binary/electron/"' >> .npmrc
+ echo 'electron_builder_binaries_mirror="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"' >> .npmrc
+ else
+ echo "Your network is OK."
+ fi
+ sed "s|--linux --publish onTag|build --dir|g;s|env.VERSION|version|g" -i package.json
+ npm install --legacy-peer-deps
+ npm run build:linux
}
+package() {
+ install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm755 "${srcdir}/${pkgname}.git/release/linux-"*/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname}"
+ cp -r "${srcdir}/${pkgname}.git/release/linux-"*/resources/{bin,media,musicgenresicons} "${pkgdir}/usr/lib/${pkgname}"
+ install -Dm644 "${srcdir}/${pkgname}.git/build/icons/512x512.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
+ install -Dm644 "${srcdir}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
+} \ No newline at end of file