summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4537b54a091c0b61d8f92aaf8576c25d2314a9de (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
# Maintainer: Koichi Murase <myoga.murase@gmail.com> (akinomyoga at GitHub)
# Contributor: capezotte (carana2099 ob gmail at com)
#
# Other contributors (who had not been maintainers) include
#
# * Seto (huresche at GitHub)
# * willemw <willemw12@gmail.com>
#
# The AUR package has been first submitted by capezotte in 2021.  At that time,
# Seto and I (akinomyoga) hepled designing the integration for the automatic
# update of ble.sh installed by an AUR helper.  After capezotte became inactive
# after capezotte switched to another distribution, the package on AUR became
# stale and removed temporarily.  I (akinomyoga) contacted capezotte and took
# over the maintenance of the package in 2022.  The package was re-submitted at
# that time.  In Aug. 2023, willemw has provided us with useful comments about
# PKGBUILD.

pkgname=blesh-git
_pkgname=ble.sh
pkgdesc="Bash Line Editor (ble.sh) -- a replacement for Bash's line editor with enhanced features"
pkgver=0.4.0_devel4.r2113.70a325f9
pkgrel=1
license=(BSD-3-Clause)
provides=(blesh)
conflicts=(blesh)
url='https://github.com/akinomyoga/ble.sh'

# Note: The following list does not show basic dependencies that are included
# in the `base' and `base-devel' package groups of AUR, which is always
# available by default in Arch Linux.  The package maintainers who want to port
# the package to other distributions might need to add `bash', `gawk', and
# `make' as basic dependencies depending on the system.
depends=(git)

# If available, ble.sh chooses gawk/nawk/mawk depending on the operation with
# awk based on the speed.  Each awk implementation has specific cases where it
# performs better than any other implementation, so ble.sh tries to select the
# fastest implementation, if possible, for each operation with awk.
optdepends=(
  'gawk: for faster processing' 'nawk: for faster processing'
  'mawk: for faster processing')

arch=(any)
source=("git+$url" "git+${url/%.sh/sh-contrib}" 'blesh-update.sh')
md5sums=('SKIP'
         'SKIP'
         'cfe4b50a3b3c66a69af64059fb4a7683')
install=blesh.install

pkgver() {
  cd "$_pkgname"
  printf "%s.r%s.%s" \
    "$(sed -n 's/-/_/g;s/^FULLVER[[:space:]]*:=[[:space:]]*//p' GNUmakefile)" \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short HEAD)"
}

prepare() {
  # From git 2.38.1-1, "git submodule" in PKGBUILD does not work
  # unless we change the git config "protocol.file.allow" [1,2].
  # [1] https://bugs.archlinux.org/task/76255
  # [2] https://bbs.archlinux.org/viewtopic.php?pid=2063104#p2063104
  cd "$_pkgname"
  git -c protocol.file.allow=always submodule update --init --recursive
}

package() {
  # Makes ble-update call an AUR helper
  install -Dm644 blesh-update.sh "$pkgdir"/usr/share/blesh/lib/_package.sh
  cd "$_pkgname"
  make install DESTDIR="$pkgdir" PREFIX=/usr INSDIR_LICENSE="$pkgdir/usr/share/licenses/blesh"
}