summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD103
1 files changed, 67 insertions, 36 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9f3de7d65772..bc7743a1454a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,56 +2,87 @@
pkgname=cider
_pkgname=Cider
-pkgver=1.5.1
+pkgver=1.5.0
pkgrel=1
-pkgdesc="Project Cider. An open-source Apple Music client built from the ground up with Vue.js and Electron. Installed using the debian release builds from CircleCI."
+pkgdesc="Project Cider. An open-source Apple Music client built from the ground up with Vue.js and Electron. Compiled from the GitHub repositories stable branch."
arch=("armv7h" "i686" "x86_64")
url="https://github.com/CiderApp/${_pkgname}.git"
-_url="https://api.github.com/repos/ciderapp/cider-releases/releases/latest"
-license=('GPL')
-depends=('gtk3' 'nss' 'wget')
+license=("GPL")
+depends=('gtk3' 'nss')
+makedepends=('git' 'npm' 'yarn')
optdepends=('libnotify: Playback notifications')
-source=("cider.desktop")
-sha256sums=('7bf97dfa92b312ceb95d005a8aa7f225af079ee450f38b58b894e951a529d997')
+source=(
+ "git+https://github.com/CiderApp/${_pkgname}.git#branch=stable"
+ "cider.desktop"
+)
+sha256sums=('SKIP'
+ 'c41e9b1019411019fce8509e32f770edf33c9e864bf707c30ffe2e3f2dcf1571')
pkgver() {
- curl -s $_url | grep tag_name | cut -d '"' -f 4 | sed 's/v//' | sed 's/\-/./g' | xargs
+ cd "$srcdir/$_pkgname"
+ LATEST_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep sha | cut -d '"' -f 4 | sed 's/v//' | xargs | cut -d' ' -f1)
+ COMMITSINCESTABLE=$(git rev-list $LATEST_SHA..HEAD --count)
+ CURRENT_VERSION=$(node -p -e "require('./package.json').version")
+ if [[ $COMMITSINCESTABLE -gt 0 ]]; then
+ if [[ $CURRENT_VERSION == *"beta"* ]]; then
+ NEW_VERSION="${CURRENT_VERSION%.*}.$COMMITSINCESTABLE"
+ else
+ NEW_VERSION="${CURRENT_VERSION}-beta.${COMMITSINCESTABLE}"
+ fi
+ echo ${NEW_VERSION//-/.}
+ sed -i "0,/$CURRENT_VERSION/s//$NEW_VERSION/" package.json
+ else
+ echo ${CURRENT_VERSION/0/$COMMITSINCESTABLE}
+ fi
+
}
build() {
- cd "$srcdir"
-
- # Download the latest debian package
- echo "Building ${_pkgname} on v${pkgver} : [Downloading Debian Package] | Extracting Package | Done"
- curl -s $_url |
- grep "browser_download_url.*deb" |
- cut -d : -f 2,3 |
- tr -d \" |
- wget -qi -
-
- # Extract the package
- echo "Building ${_pkgname} on v${pkgver} : Downloading Debian Package | [Extracting Package] | Done"
- ar vx *.deb
- echo "Building ${_pkgname} on v${pkgver} : Downloading Debian Package | Extracting Package | [Done]"
-
- # Fetch the Various Useful Files
- echo "Fetching additional Files"
- curl -s https://raw.githubusercontent.com/CiderApp/cider/master/README.md > README
- curl -s https://raw.githubusercontent.com/CiderApp/cider/master/LICENSE > LICENSE
- curl -s https://raw.githubusercontent.com/CiderApp/cider/master/resources/icons/cider.png > icon.png
+ cd "${srcdir}/${_pkgname}"
+
+ if [ -f cider.lock ]; then
+ mv cider.lock yarn.lock
+ fi
+
+ echo "Building ${_pkgname} on v${pkgver} : [Install Build Dependencies] | Build | Done"
+ yarn install --non-interactive --pure-lockfile --cache-folder "${srcdir}/yarn-cache"
+
+ echo "Building : Install Build Dependencies | [Build] | Done"
+ if [[ ${CARCH} == "armv7h" ]]; then
+ yarn build
+ yarn electron-builder build --armv7l --linux dir
+ elif [[ ${CARCH} == "i686" ]]; then
+ yarn build
+ yarn electron-builder build --ia32 --linux dir
+ elif [[ ${CARCH} == "x86_64" ]]; then
+ yarn build
+ yarn electron-builder build --x64 --linux dir
+ fi
+
+ echo "Building : Install Build Dependencies | Build | [Done]"
}
package() {
- # Extract package data
- tar -xJ -f data.tar.xz -C "${pkgdir}"
+ cd "${srcdir}/${_pkgname}"
- install -d "$pkgdir/usr/bin/"
- ln -sf "/opt/${_pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ echo "Packaging : [Desktop Shortcut] | Icon | Build Files | Other Files | Done"
+ install -Dm644 "${srcdir}/${pkgname%-git}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-git}.desktop"
+
+ echo "Packaging : Desktop Shortcut | [Icon] | Build Files | Other Files | Done"
+ install -Dm644 "${srcdir}/${_pkgname}/resources/icons/icon.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname%-git}.png"
- # Desktop File
- install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ echo "Packaging : Desktop Shortcut | Icon | [Build Files] | Other Files | Done"
+ install -d "$pkgdir/opt/"
+ install -d "$pkgdir/usr/bin/"
+ cd ${srcdir}/${_pkgname}/dist/linux-unpacked
+ mkdir "${pkgdir}/opt/${pkgname%-git}"
+ cp -r --preserve=mode * "${pkgdir}/opt/${pkgname%-git}"
+ ln -sf "/opt/${pkgname%-git}/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
+ echo "Packaging : Desktop Shortcut | Icon | Build Files | [Other Files] | Done"
install -d "$pkgdir/usr/share/licenses" "$pkgdir/usr/share/doc"
- install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -Dm644 "${srcdir}/README" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
+ install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm644 "${srcdir}/${_pkgname}/README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
+
+ echo "Packaging : Desktop Shortcut | Icon | Build Files | Other Files | [Done]"
}