vinceliuice / Tela-icon-theme

A flat colorful Design icon theme

Home Page:https://www.pling.com/p/1279924/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Explained] Technical question: manipulate BRIGHT_VARIANTS variable

angrysquirell opened this issue · comments

I have been creating package for Arch Linux by my own, installing it by local disk pacman repository, etc.

I only want to "produce" / install tela-grey variant, without tela-grey-light and tela-grey-dark variants.

Thist is pkbbuild section responsible for building and installing icons:

package() {
  cd $_srcname
  install -dm755 $pkgdir/usr/share/icons
  ./install.sh -n tela -d $pkgdir/usr/share/icons grey
}

My question is: it is safe to set BRIGHT_VARIANTS variable to "" to install only tela-grey variant, but not to produce and install tela-grey-light tela-grey-dark variants?

In other words - will effect be the same as later delete and not include to package tela-grey-{light,dark} directories?

Setting variable can be performed in earlier pkgbuild section by sed "hack":

prepare() {
  cd $_srcname
  sed -i '/gtk-update-icon-cache/d' install.sh
  sed -i 's/BRIGHT_VARIANTS=("" "light" "dark")/BRIGHT_VARIANTS=""/g' install.sh
}

Or maybe there is another way to set variable in other civilized way?

Change this line: (install.sh line 299)
https://github.com/vinceliuice/Tela-icon-theme/blob/e6ffd43025dd9de13b70678a6d846b07e44e5dac/install.sh#L299C13-L299C13

Change for bright in "${BRIGHT_VARIANTS[@]}"; do to for bright in "${BRIGHT_VARIANTS[0]}"; do

Then it will only install default version without light or dark

Thank you very much for review and tip. All works as expected.

Here is my modified pkgbuild:
pkgname=tela-icon-theme-git
_srcname=Tela-icon-theme
pkgdesc="A flat colorful Design icon theme"
pkgver=r456.e6ffd430
pkgrel=1
arch=(any)
url="https://github.com/vinceliuice/$_srcname"
license=(GPL3)
depends=(gtk-update-icon-cache)
makedepends=(git)
options=(!strip)
source=("git+$url")
sha256sums=('SKIP')

pkgver() {
  cd $_srcname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd $_srcname
  sed -i '/gtk-update-icon-cache/d;s/BRIGHT_VARIANTS\[@\]/BRIGHT_VARIANTS\[0\]/g' install.sh
}

package() {
  cd $_srcname
  install -dm755 $pkgdir/usr/share/icons
  ./install.sh -n tela -d $pkgdir/usr/share/icons grey
}