upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / zsh-theme-powerlevel10k / trunk / PKGBUILD
blobea3563682d016d1367552696ef98c9e48b8fd5fe
1 # Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
2 # Contributor: Jeff Henson <jeff@henson.io>
3 # Contributor: Ron Asimi <ron dot asimi at gmail dot com>
4 # Contributor: Roman Perepelitsa <roman.perepelitsa@gmail.com>
6 pkgname=zsh-theme-powerlevel10k
7 # Whenever pkgver is updated, _libgit2ver below must also be updated.
8 pkgver=1.16.1
9 _libgit2ver="tag-d6c37a38587c9af2a9e63449fc8bf951dca0e854"
10 pkgrel=1
11 pkgdesc="Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience."
12 arch=('x86_64')
13 url='https://github.com/romkatv/powerlevel10k'
14 license=('MIT')
15 makedepends=('git' 'cmake')
16 depends=('glibc' 'zsh')
17 optdepends=(
18   'powerline-fonts: patched fonts for powerline'
19   'awesome-terminal-fonts: icon package'
21 # _libgit2ver depends on pkgver. They must be updated together. See libgit2_version in:
22 # https://raw.githubusercontent.com/romkatv/powerlevel10k/v${pkgver}/gitstatus/build.info
23 source=(
24   "${pkgname}-${pkgver}.tar.gz::https://github.com/romkatv/powerlevel10k/archive/v${pkgver}.tar.gz"
25   "libgit2-${_libgit2ver}.tar.gz::https://github.com/romkatv/libgit2/archive/${_libgit2ver}.tar.gz")
26 sha512sums=('18c7201ac1c0d31beb166c29a5592316a439891fe26dcb3d0d4bea6fc3f02bdfe4430be59b5888a53075ea152f21d5a7bce6dcf343110596f90127f2268af36e'
27             '11fd09ce20191392947d171e9212a33a998c1f2c4bcb8ab7440a0dc88653ff1324a1529984a607d545ab8863738f4eb946134c46f44bd1c200c6d98c02657292')
28 replaces=('zsh-theme-powerlevel9k')
30 build() {
31   cd "${srcdir}/libgit2-${_libgit2ver}"
32   cmake \
33    -DZERO_NSEC=ON \
34    -DTHREADSAFE=ON \
35    -DUSE_BUNDLED_ZLIB=ON \
36    -DREGEX_BACKEND=builtin \
37    -DUSE_HTTP_PARSER=builtin \
38    -DUSE_SSH=OFF \
39    -DUSE_HTTPS=OFF \
40    -DBUILD_CLAR=OFF \
41    -DUSE_GSSAPI=OFF \
42    -DUSE_NTLMCLIENT=OFF \
43    -DBUILD_SHARED_LIBS=OFF \
44    -DENABLE_REPRODUCIBLE_BUILDS=ON \
45    .
46   make
48   # build gitstatus
49   cd "$srcdir/powerlevel10k-${pkgver}/gitstatus"
50   export CXXFLAGS+=" -I${srcdir}/libgit2-${_libgit2ver}/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE"
51   export LDFLAGS+=" -L${srcdir}/libgit2-${_libgit2ver}"
52   make
55 package() {
56   cd "$srcdir/powerlevel10k-${pkgver}"
57   find . -type f -exec install -D '{}' "$pkgdir/usr/share/zsh-theme-powerlevel10k/{}" ';'
58   # delete unnecessary files. See also: https://bugs.archlinux.org/task/66737
59   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/obj"
60   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/.gitignore"
61   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/.gitattributes"
62   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/src"
63   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/build"
64   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/deps"
65   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/Makefile"
66   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/mbuild"
67   rm "${pkgdir}/usr/share/zsh-theme-powerlevel10k/.gitattributes"
68   rm "${pkgdir}/usr/share/zsh-theme-powerlevel10k/.gitignore"
69   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/usrbin/.gitkeep"
70   rm "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/.clang-format"
71   rm -rf "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/.vscode/"
72   cd "${pkgdir}/usr/share/zsh-theme-powerlevel10k/"
73   for file in *.zsh-theme internal/*.zsh gitstatus/*.zsh gitstatus/install; do
74     zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file"
75   done