summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorTiago de Paula2024-04-21 15:54:23 -0300
committerTiago de Paula2024-04-21 17:41:33 -0300
commita193bc716c1e81f62da958f6ad6f8042117fb191 (patch)
tree2bd356898c71dbbdacc390b00d8eefd85cd316ab /PKGBUILD
parentcdb380f1114b02dc5e3903c55b6666035a62a2df (diff)
downloadaur-a193bc716c1e81f62da958f6ad6f8042117fb191.tar.gz
refactor: simplify package definition
Uses a theme list to dynamically define packages, similar to how 'texlive-*' packages are defined. Also, reorder fields to match SRCINFO.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD117
1 files changed, 26 insertions, 91 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0b6447a23308..6b32bc2ea5b1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,113 +1,48 @@
# Maintainer: "Amhairghin" Oscar Garcia Amor (https://ogarcia.me)
+_themes=(standard black blue brown green grey orange pink purple red yellow manjaro ubuntu dracula nord)
-pkgbase='tela-circle-icon-theme-spl-git'
-pkgname=('tela-circle-icon-theme-all-git'
- 'tela-circle-icon-theme-standard-git'
- 'tela-circle-icon-theme-black-git'
- 'tela-circle-icon-theme-blue-git'
- 'tela-circle-icon-theme-brown-git'
- 'tela-circle-icon-theme-green-git'
- 'tela-circle-icon-theme-grey-git'
- 'tela-circle-icon-theme-orange-git'
- 'tela-circle-icon-theme-pink-git'
- 'tela-circle-icon-theme-purple-git'
- 'tela-circle-icon-theme-red-git'
- 'tela-circle-icon-theme-yellow-git'
- 'tela-circle-icon-theme-manjaro-git'
- 'tela-circle-icon-theme-ubuntu-git'
- 'tela-circle-icon-theme-dracula-git'
- 'tela-circle-icon-theme-nord-git')
+_pkgbase='tela-circle-icon-theme'
+pkgbase="${_pkgbase}-spl-git"
+_pkgname=("${_themes[@]/#/${_pkgbase}-}")
+pkgname=(${_pkgbase}-all-git ${_pkgname[@]/%/-git})
+pkgdesc='A flat colorful design icon theme'
pkgver=2022.11.06.r26.g1aac9cf5
pkgrel=1
-pkgdesc="A flat colorful design icon theme"
+url="https://github.com/vinceliuice/${_pkgbase^}"
arch=('any')
-url='https://github.com/vinceliuice/Tela-circle-icon-theme'
license=('GPL3')
-depends=('gtk-update-icon-cache' 'hicolor-icon-theme')
makedepends=('bash' 'git')
-provides=('tela-circle-icon-theme' 'tela-circle-icon-theme-git')
-options=('!strip')
-source=("${pkgbase%-git}::git+https://github.com/vinceliuice/Tela-circle-icon-theme.git")
+depends=('gtk-update-icon-cache' 'hicolor-icon-theme')
+provides=("${_pkgbase}" "${_pkgbase}-git")
+options=(!strip)
+source=("${_pkgbase}::git+${url}.git")
b2sums=('SKIP')
pkgver() {
- cd "${pkgbase%-git}"
+ cd "${_pkgbase}"
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
-_package() {
- pkgdesc="${pkgdesc} (${1} variant)"
- conflicts=("${pkgbase%-git}-all-git" "${pkgbase%-git}-all" "${pkgbase%-git}-${1}")
- cd "${pkgbase%-git}"
- install -dm755 "${pkgdir}/usr/share/icons"
- ./install.sh -d "${pkgdir}/usr/share/icons" ${1}
-}
-
package_tela-circle-icon-theme-all-git() {
pkgdesc="${pkgdesc} (all variants)"
- conflicts=(${pkgname[@]/${pkgbase%-git}-all-git})
- for _p in ${pkgname[@]}; do conflicts+=(${_p%-git}); done
- cd "${pkgbase%-git}"
+ conflicts=(${pkgname[@]/${pkgbase%-git}-all-git} "${pkgname[@]/%-git/}")
+
+ cd "${_pkgbase}"
install -dm755 "${pkgdir}/usr/share/icons"
./install.sh -a -d "${pkgdir}/usr/share/icons"
}
-package_tela-circle-icon-theme-standard-git() {
- _package standard
-}
-
-package_tela-circle-icon-theme-black-git() {
- _package black
-}
-
-package_tela-circle-icon-theme-blue-git() {
- _package blue
-}
-
-package_tela-circle-icon-theme-brown-git() {
- _package brown
-}
-
-package_tela-circle-icon-theme-green-git() {
- _package green
-}
-
-package_tela-circle-icon-theme-grey-git() {
- _package grey
-}
-
-package_tela-circle-icon-theme-orange-git() {
- _package orange
-}
-
-package_tela-circle-icon-theme-pink-git() {
- _package pink
-}
-
-package_tela-circle-icon-theme-purple-git() {
- _package purple
-}
-
-package_tela-circle-icon-theme-red-git() {
- _package red
-}
-
-package_tela-circle-icon-theme-yellow-git() {
- _package yellow
-}
-
-package_tela-circle-icon-theme-manjaro-git() {
- _package manjaro
-}
-
-package_tela-circle-icon-theme-ubuntu-git() {
- _package ubuntu
-}
+_package() {
+ pkgdesc="${pkgdesc} (${1} variant)"
+ conflicts=("${_pkgbase}-all-git" "${_pkgbase}-all" "${_pkgbase}-${1}")
-package_tela-circle-icon-theme-dracula-git() {
- _package dracula
+ cd "${_pkgbase}"
+ install -dm755 "${pkgdir}/usr/share/icons"
+ ./install.sh -d "${pkgdir}/usr/share/icons" "${1}"
}
-package_tela-circle-icon-theme-nord-git() {
- _package nord
-}
+for _theme in "${_themes[@]}"; do
+ eval "package_${_pkgbase}-${_theme}-git() {
+ _package ${_theme}
+ }"
+done