diff options
author | Tiago de Paula | 2024-04-21 15:54:23 -0300 |
---|---|---|
committer | Tiago de Paula | 2024-04-21 17:41:33 -0300 |
commit | a193bc716c1e81f62da958f6ad6f8042117fb191 (patch) | |
tree | 2bd356898c71dbbdacc390b00d8eefd85cd316ab | |
parent | cdb380f1114b02dc5e3903c55b6666035a62a2df (diff) | |
download | aur-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.
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 117 |
2 files changed, 28 insertions, 92 deletions
@@ -12,12 +12,13 @@ pkgbase = tela-circle-icon-theme-spl-git provides = tela-circle-icon-theme provides = tela-circle-icon-theme-git options = !strip - source = tela-circle-icon-theme-spl::git+https://github.com/vinceliuice/Tela-circle-icon-theme.git + source = tela-circle-icon-theme::git+https://github.com/vinceliuice/Tela-circle-icon-theme.git b2sums = SKIP pkgname = tela-circle-icon-theme-all-git pkgdesc = A flat colorful design icon theme (all variants) conflicts = tela-circle-icon-theme-all-git + conflicts = tela-circle-icon-theme-all pkgname = tela-circle-icon-theme-standard-git @@ -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 |