summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba9d36f25d112031a0efea0f1526d0ad6242932e (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
# Merged with official ABS bash PKGBUILD by João, 2021/07/19 (all respective contributors apply herein)
# Maintainer: João Figueiredo <islandc0der@chaotic.cx>

pkgname=bash-git
pkgver=5.2_r213.g142bbdd8
pkgrel=1
pkgdesc='The GNU Bourne Again shell'
arch=($CARCH)
license=(GPL-3.0-or-later)
url='https://www.gnu.org/software/bash/bash.html'
backup=(etc/bash.bash{rc,_logout} etc/skel/.bash{rc,_profile,_logout})
depends=(readline libreadline.so glibc ncurses)
makedepends=(git)
optdepends=('bash-completion: for tab completion')
conflicts=(${pkgname%-git})
provides=(sh ${pkgname%-git})
source=(git+https://git.savannah.gnu.org/git/bash.git
        dot.bashrc
        dot.bash_profile
        dot.bash_logout
        system.bashrc
        system.bash_logout)
sha256sums=('SKIP'
            '3e22bf86ae6708df7a6bceb88c67a00118275f9c0b5268f453dd388af7c43b53'
            'e149407c2bee17779caec70a7edd3d0000d172e7e4347429b80cb4d55bcec9c2'
            '4330edf340394d0dae50afb04ac2a621f106fe67fb634ec81c4bfb98be2a1eb5'
            '5fdc20c44bc9058f728d11111327f4dbb5598fec4d948dd5265211598667f9f0'
            '025bccfb374a3edce0ff8154d990689f30976b78f7a932dc9a6fcef81821811e')

pkgver() {
  cd ${pkgname%-git}
  _ver="$(grep -m1 '@set VERSION' doc/version.texi | cut -d ' ' -f3 | tr - .)"
  echo "${_ver}_r$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
}

# prepare() {
#   wget -q --show-progress --no-parent -nd -r https://ftp.gnu.org/gnu/bash/bash-$pkgver-patches/
#   rm *.sig
# 
#   cd ${pkgname%-git}
#   for patch in ../bash${pkgver//.}*; do
#     patch -p0 -i $patch
#   done
# }

build() {
  cd ${pkgname%-git}

  _bashconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/bin\"\'
               -DSTANDARD_UTILS_PATH=\'\"/usr/bin\"\'
               -DSYS_BASHRC=\'\"/etc/bash.bashrc\"\'
               -DSYS_BASH_LOGOUT=\'\"/etc/bash.bash_logout\"\'
               -DNON_INTERACTIVE_LOGIN_SHELLS)
  export CFLAGS="${CFLAGS} ${_bashconfig[@]}"

  ./configure \
    --prefix=/usr \
    --with-curses \
    --enable-readline \
    --without-bash-malloc \
    --with-installed-readline
  make
}

# check() {
#   make -C ${pkgname%-git} check
# }

package() {
  make -C ${pkgname%-git} DESTDIR="$pkgdir" install
  ln -s bash "$pkgdir/usr/bin/sh"

  # system-wide configuration files
  install -Dm644 system.bashrc "$pkgdir/etc/bash.bashrc"
  install -Dm644 system.bash_logout "$pkgdir/etc/bash.bash_logout"

  # user configuration file skeletons
  install -dm755 "$pkgdir/etc/skel/"
  install -m644 dot.bashrc "$pkgdir/etc/skel/.bashrc"
  install -m644 dot.bash_profile "$pkgdir/etc/skel/.bash_profile"
  install -m644 dot.bash_logout "$pkgdir/etc/skel/.bash_logout"
}