Merge pull request #1 from yochananmarqos/patch-1

Improve PKGBUILD
This commit is contained in:
Rudra Saraswat 2023-04-17 13:50:11 +05:30 committed by GitHub
commit 5052fc04bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

103
PKGBUILD
View file

@ -1,47 +1,75 @@
# Maintainer: Rudra Saraswat <rs2009@ubuntu.com> # Maintainer: Rudra Saraswat <rs2009@ubuntu.com>
pkgbase=blend pkgbase=blend-git
pkgname=(blend blend-settings) pkgname=('blend-git' 'blend-settings-git')
pkgver=2.0.0 pkgver=r27.0024d66
pkgrel=1 pkgrel=1
pkgdesc='A package manager for blendOS' _electronversion=22
url='https://github.com/blend-os/blend' pkgdesc="A package manager for blendOS"
source=("git+https://github.com/blend-os/blend.git" arch=('x86_64' 'i686')
"blend-settings.desktop" url="https://github.com/blend-os/blend"
"blend-settings") license=('GPL3')
makedepends=("electron${_electronversion}" 'git' 'npm')
source=('git+https://github.com/blend-os/blend.git'
'blend-settings.desktop'
'blend-settings')
sha256sums=('SKIP' sha256sums=('SKIP'
'a605d24d2fa7384b45a94105143db216db1ffc0bdfc7f6eec758ef2026e61e54' 'a605d24d2fa7384b45a94105143db216db1ffc0bdfc7f6eec758ef2026e61e54'
'73cb7c39190d36f233b8dfbc3e3e6737d56e61e90881ad95f09e5ae1f9b405a8') '73cb7c39190d36f233b8dfbc3e3e6737d56e61e90881ad95f09e5ae1f9b405a8')
arch=('x86_64')
makedepends=(electron) pkgver() {
license=('GPL-3.0-or-later') cd "${srcdir}/${pkgbase%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/${pkgbase%-git}/${pkgbase%-git}-settings"
npm config set cache "${srcdir}/npm-cache"
npm install
}
build() { build() {
cd "${srcdir}"/blend/blend-settings cd "${srcdir}/${pkgbase%-git}/${pkgbase%-git}-settings"
npm install npm config set cache "${srcdir}/npm-cache"
export NODE_ENV=production export NODE_ENV=production
electronDist="/usr/lib/electron${_electronversion}"
electronVer="$(sed s/^v// /usr/lib/electron${_electronversion}/version)"
npm run icons npm run icons
npm run pack -- -c.electronDist=/usr/lib/electron -c.electronVersion=22 --publish never npm run pack -- -c.electronDist=${electronDist} \
-c.electronVersion=${electronVer} --publish never
} }
package_blend() { package_blend-git() {
depends=('python3' 'podman' 'python-pexpect' 'blend-settings' 'bash') depends=('bash' 'blend-settings' 'podman' 'python' 'python-pexpect')
cd "${srcdir}"/blend provides=("${pkgname%-git}")
mkdir -p "${pkgdir}"/usr/bin "${pkgdir}"/usr/lib/systemd/system "${pkgdir}"/usr/lib/systemd/user "${pkgdir}"/usr/lib/initcpio/install "${pkgdir}"/usr/lib/initcpio/hooks conflicts=("${pkgname%-git}")
cp blend init-blend host-blend blend-system blend-files "${pkgdir}"/usr/bin
cp blend-system.service "${pkgdir}"/usr/lib/systemd/system cd "${srcdir}/${pkgbase%-git}"
cp blend-files.service "${pkgdir}"/usr/lib/systemd/user install -Dm755 \
cp blend.hook "${pkgdir}"/usr/lib/initcpio/hooks/blend "${pkgname%-git}" \
cp blend.install "${pkgdir}"/usr/lib/initcpio/install/blend "init-${pkgname%-git}" \
"host-${pkgname%-git}" \
"${pkgname%-git}-system" \
"${pkgname%-git}-files" \
-t "${pkgdir}"/usr/bin/
install -Dm644 "${pkgname%-git}-system.service" -t \
"${pkgdir}"/usr/lib/systemd/system/
install -Dm644 "${pkgname%-git}-files.service" -t \
"${pkgdir}"/usr/lib/systemd/user/
install -Dm644 "${pkgname%-git}.hook" \
"${pkgdir}/usr/lib/initcpio/hooks/${pkgname%-git}"
install -Dm644 "${pkgname%-git}.install" \
"${pkgdir}/usr/lib/initcpio/install/${pkgname%-git}"
} }
package_blend-settings() { package_blend-settings-git() {
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=kuro was really helpful pkgdesc="blendOS Settings"
depends=("electron${_electronversion}")
cd "${srcdir}/${pkgbase%-git}/${pkgbase%-git}-settings"
depends=('electron')
cd "${srcdir}"/blend/blend-settings
local _arch local _arch
case $CARCH in case ${CARCH} in
i686) i686)
_arch=linux-ia32-unpacked _arch=linux-ia32-unpacked
;; ;;
@ -49,16 +77,19 @@ package_blend-settings() {
_arch=linux-unpacked _arch=linux-unpacked
;; ;;
*) *)
_arch=linux-$CARCH-unpacked _arch=linux-${CARCH}-unpacked
;; ;;
esac esac
install -Dm644 "dist/${_arch}/resources/app.asar" "$pkgdir/usr/lib/blend-settings/blend-settings.asar"
install -Dm644 "dist/${_arch}/resources/app.asar" \
"$pkgdir/usr/lib/${pkgname%-git}/${pkgname%-git}.asar"
for icon_size in 16 24 32 48 64 128 256 512; do for icon_size in 16 24 32 48 64 128 256 512; do
install -Dm644 \ install -Dm644 "build/icons/png/${icon_size}x${icon_size}.png" \
"build/icons/png/${icon_size}x${icon_size}.png" \ "${pkgdir}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps/${pkgname%-git}.png"
"${pkgdir}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps/blend-settings.png"
done done
install -Dm644 -t "${pkgdir}/usr/share/applications" "../../blend-settings.desktop"
install -Dm755 -t "${pkgdir}/usr/bin" "../../blend-settings" install -Dm644 "${srcdir}/${pkgname%-git}.desktop" -t \
install -Dm644 "../LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" "${pkgdir}"/usr/share/applications/
install -Dm755 "${srcdir}/${pkgname%-git}" -t "${pkgdir}"/usr/bin/
} }