summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 419a169124b2ab208e30b476955c77a872eadbd2 (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
# Maintainer: Donald Carr<sirspudd@gmail.com>
# Upstream URL: http://qpm.io
#
# For improvements/fixes to this package, please send a pull request:
# https://github.com/Cutehacks/qpm

pkgname=qpm-git
pkgver=v0.11.0.r2.g7c41bcc
pkgrel=1
pkgdesc='Qt Package Manager'
arch=('x86_64' 'i686')
url='http://qpm.io'
license=('LGPL')
provides=('qpm-git')
makedepends=('go' 'git')
source=("qpm.io::git://github.com/Cutehacks/qpm")
sha256sums=('SKIP')

pkgver() {
  local _qpm_dir="${srcdir}/qpm.io"
  cd ${_qpm_dir}

  git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  local _qpm_dir="${srcdir}/qpm.io"
  cd ${_qpm_dir}

  git submodule init
  git submodule update
}

build() {
  local _qpm_dir="${srcdir}/qpm.io"
  cd $_qpm_dir
  local git_sha1=$(git rev-parse HEAD | cut -c1-8)

  cd $srcdir
  export GOPATH="$srcdir/.."
  go build -ldflags "-X qpm.io/qpm/core.Version=${pkgver} -X qpm.io/qpm/core.Build=${git_sha1}" qpm.io/qpm
}

package() {
  cd $srcdir
  install -Dm755 qpm "${pkgdir}/usr/bin/${pkgname}"
}