summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 905d3a6ef3f4080f21434bd6c62903e5f0d87d68 (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
# Maintainer: Randy Ramos <rramos1295 \at\ gmail \dot\ com>
# Contributor: Peter Vasil <mail@petervasil.net>
# Contributor: Lucas De Marchi <lucas.de.marchi@gmail.com>
# Contributor: Matthias Meulien <orontee@gmail.com>

pkgname=global
pkgver=6.6
pkgrel=1
pkgdesc="A source code tag system"
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/global/"
license=('GPL')
depends=('libltdl' 'bash' 'perl' 'sqlite')
optdepends=('idutils' 'ctags' 'python-pygments' 'emacs' 'vim')
makedepends=('python')
options=(!emptydirs !libtool)
source=("https://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('87a86ea972429e2c983f8359e91ce64facccdc76215ef5225c0baf3f6f087527')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -i 's/\.la/.so/g' gtags.conf.in

  # Package idutils from AUR installs lid as lid-idutils
  # See: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=idutils
  msg "Change idutils lid executable name to lid-idutils"
  sed -i 's/usable("lid")/usable("lid-idutils")/g' global/global.c
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  autoreconf -fi
  ./configure --prefix=/usr --with-exuberant-ctags=/usr/bin/ctags --with-sqlite3
  make -j4
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make -k check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -d "${pkgdir}/usr/share/emacs/site-lisp"
  mv "${pkgdir}/usr/share/gtags/gtags.el" "${pkgdir}/usr/share/emacs/site-lisp/gtags.el"
  install -d "${pkgdir}/usr/share/vim/vimfiles/plugin"
  mv "${pkgdir}/usr/share/gtags/gtags.vim" "${pkgdir}/usr/share/vim/vimfiles/plugin/gtags.vim"
  mv "${pkgdir}/usr/share/gtags/gtags-cscope.vim" "${pkgdir}/usr/share/vim/vimfiles/plugin/gtags-cscope.vim"
}