summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3092ffe0758cff6621adfe4b577859acbbf73588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Me is just a random anon from the internet. I'm not related to prism in any way
# Contact about package issues tho. <bjoel2@i2pmail.org>

pkgname="prismlauncher-themes-git"
pkgver=2024.04.01_1711994750.r0.g0a1fcdb
pkgrel=1
pkgdesc="PrismLauncher themes from their official github"
arch=('any')
url="https://github.com/PrismLauncher/Themes"
license=('custom')
makedepends=('git')
optdepends=('prismlauncher')
source=("${pkgname}::git+https://github.com/PrismLauncher/Themes.git")
sha256sums=('SKIP')
install='themes.install'

pkgver() {
  cd "${pkgname}"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

build() {
  rm -f _prism-theme-installer
  _genInstallScript
  cd "${pkgname}/themes"
}

# dirty hack creating install script
_genInstallScript()
{
cat << 'EOF' >> _prism-theme-installer
#!/bin/bash
defaultPath="${HOME}/.local/share/PrismLauncher/themes"
read -p "Specify the directory where you want to install themes (default: ${defaultPath})"$'\n> ' installPath
installPath=${installPath:-$defaultPath}
cd /usr/share/prismlauncher-themes
for themeDir in *
do
  cp -rf "$themeDir" "${installPath}/"
done
echo done
EOF
}

package() {
  install --mode=755 -D "_prism-theme-installer" "${pkgdir}/usr/bin/_prism-theme-installer"
  cd "${pkgname}"
  install --mode=644 -Dt "$pkgdir/usr/share/licenses/$pkgname" LICENSES/*
  mkdir "${pkgdir}/usr/share/prismlauncher-themes"
  cd themes
  for themeDir in *
  do
    cp -r "$themeDir" "${pkgdir}/usr/share/prismlauncher-themes/${themeDir}"
  done
}