summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b3267fa746a93134af81d87dd90331d73cec1d9e (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Contributor: Christian Hesse <mail@eworm.de>
# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgbase=zsh-git
pkgname=('zsh-git' 'zsh-doc-git')
pkgver=5.9.r450.g09c5b10dc
pkgrel=1
arch=('x86_64')
url='https://www.zsh.org/'
license=('custom')
makedepends=('gdbm' 'git' 'libcap' 'pcre2' 'texlive-plaingeneric' 'yodl')
source=('zsh::git://git.code.sf.net/p/zsh/code'
        'zprofile')
sha256sums=('SKIP'
            '230832038c3b8f67fdb1b284ac5f68d709cdb7f1bc752b0e60657b9b9d091045')

pkgver() {
  cd zsh
  git describe --tags | sed 's/zsh-//;s/-/.r/;s/-/./g'
}

prepare() {
  cd zsh

  # Set correct keymap path
  sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys

  # Remove unneeded and conflicting completion scripts
  for _fpath in AIX BSD Cygwin Darwin Debian Mandriva openSUSE Redhat Solaris; do
    rm -rf Completion/$_fpath
    sed 's#\s*Completion/'$_fpath'/\*/\*##g' -i Src/Zle/complete.mdd
  done

  rm Completion/Linux/Command/_pkgtool

  # regenerate configure script
  ./Util/preconfig
}

build() {
  cd zsh

  ./configure --prefix=/usr \
    --docdir=/usr/share/doc/zsh \
    --htmldir=/usr/share/doc/zsh/html \
    --enable-etcdir=/etc/zsh \
    --enable-zshenv=/etc/zsh/zshenv \
    --enable-zlogin=/etc/zsh/zlogin \
    --enable-zlogout=/etc/zsh/zlogout \
    --enable-zprofile=/etc/zsh/zprofile \
    --enable-zshrc=/etc/zsh/zshrc \
    --enable-maildir-support \
    --with-term-lib='ncursesw' \
    --enable-multibyte \
    --enable-function-subdirs \
    --enable-fndir=/usr/share/zsh/functions \
    --enable-scriptdir=/usr/share/zsh/scripts \
    --with-tcsetpgrp \
    --enable-pcre \
    --enable-gdbm \
    --enable-cap \
    --enable-zsh-secure-free
  make

  make -C Doc zsh.pdf
}

check() {
  cd zsh
  HOME="${srcdir}" make check
}

package_zsh-git() {
  pkgdesc='A very advanced and programmable command interpreter (shell) for UNIX'
  depends=('pcre2' 'libcap' 'gdbm')
  conflicts=('zsh')
  provides=('zsh')
  optdepends=(
    "grml-zsh-config: grml's zsh setup"
    'zsh-autosuggestions: Fish-like autosuggestions for zsh'
    'zsh-completions: Additional completion definitions for Zsh'
    'zsh-doc: Info, HTML and PDF format of the ZSH documentation'
    'zsh-history-substring-search: ZSH port of Fish history search (up arrow)'
    'zsh-lovers: A collection of tips, tricks and examples for the Z shell.'
    'zsh-syntax-highlighting: Fish shell like syntax highlighting for Zsh'
    'zshdb: A debugger for zsh scripts')
  backup=('etc/zsh/zprofile')
  install=zsh.install

  cd zsh
  make DESTDIR="${pkgdir}/" install
  install -D -m644 "${srcdir}/zprofile" "${pkgdir}/etc/zsh/zprofile"
  install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_zsh-doc-git() {
  pkgdesc='Info, HTML and PDF format of the ZSH documentation'
  conflicts=('zsh-doc')
  provides=('zsh-doc')

  cd zsh
  make DESTDIR="${pkgdir}/" install.info install.html
  install -D -m644 Doc/zsh.pdf "${pkgdir}/usr/share/doc/zsh/zsh.pdf"
  install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}