summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9e37842ecff5686513b010ef5cdfd45d38802304 (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
# Maintainer: Matt Cuneo <m@cuneo.au>

_pkgname=gitlab-gitaly
pkgname="${_pkgname}-git"
pkgver=15.3.0
pkgrel=1
pkgdesc="Speed up Git access using caching"
arch=('x86_64')
conflicts=("$_pkgname")
provides=("$_pkgname")
url="https://gitlab.com/gitlab-org/gitaly"
license=('MIT')
depends=(glibc ruby2.7 libxml2 libxslt libssh2)
options=(!buildflags)
makedepends=(go cmake git)
backup=("etc/gitlab-gitaly/config.toml")
_tag=v${pkgver}
source=("git+https://gitlab.com/gitlab-org/gitaly.git#branch=15-3-stable"
        "configs.patch"
        "gitlab-gitaly.service"
	      "ruby27.patch")
sha512sums=('SKIP'
            'ee8e6c43f9da4107b49886ef3bbeacaaf8a85fbdc82c464625bbccd75f53253834ce81ac9462643f4097f7d5d049160763fcd9d8450af93580167b00f7e5c150'
            '7f5cd528c873a5e43e18aa6a88bd7298422c047e0e61cf3208be7d9fcfdfdc8a844b5c439ab6afc2098c5c4c60ed9c3d167c2f87517f1e93b34f39be3d3dad09'
            '6d298603495e074613746f7f9b389c82e73880c228902167f0bfb4ddf244ed6f4a2be5e40f4e9d0517fcc3a54fbed5aa26e6ceafdac3ecdd08e844885ef4c4b2')

pkgver() {
  cd gitaly
  cat VERSION | xargs
}

prepare() {
  cd gitaly

  patch -p1 < ../ruby27.patch

  patch -p1 < ../configs.patch
  # At this point the config file should not contain any references to '/home/git'

  # https://github.com/bundler/bundler/issues/6882
  sed -e '/BUNDLED WITH/,+1d' -i ruby/Gemfile.lock
}

build() {
  cd gitaly

  bundle-2.7 config force_ruby_platform true # build from sources as some prebuilt gems are not available for newer ruby
  make BUILD_TAGS="tracer_static tracer_static_jaeger"
}

package() {
  cd gitaly

  make PREFIX=/usr DESTDIR="${pkgdir}" install
  mkdir -p "${pkgdir}"/etc/gitlab-gitaly
  mkdir -p "${pkgdir}"/usr/share/webapps/gitlab-gitaly
  cp -r ruby "${pkgdir}"/usr/share/webapps/gitlab-gitaly/ruby

  install -Dm644 config.toml.example "${pkgdir}"/etc/${_pkgname}/config.toml
  install -Dm644 "LICENSE" "${pkgdir}"/usr/share/licenses/${_pkgname}/LICENSE
  install -Dm644 "${srcdir}"/gitlab-gitaly.service "${pkgdir}"/usr/lib/systemd/system/gitlab-gitaly.service
}