summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ce29f8e4454f76c5a9f417e13c0214e59cb1d946 (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
# Maintainer: Helder Bertoldo <helder.bertoldo@gmail.com>

gitname=cmake-modules-elementary
pkgname=("${gitname}-git")
pkgver=latest
pkgrel=1
pkgdesc='elementary CMake Modules'
arch=('i686' 'x86_64')
url='https://github.com/elementary/junk/tree/cmake-modules'
license=('GPL3')
depends=('cmake')
makedepends=('git')
provides=("${gitname}")
conflicts=("${gitname}")
source=('cmake-modules-elementary::git+https://github.com/elementary/junk.git#branch=cmake-modules')
sha256sums=('SKIP')

pkgver() {
    cd "${gitname}"
    ( set -o pipefail
        git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

prepare() {
  cd cmake-modules-elementary

  if [[ -d build ]]; then
    rm -rf build
  fi
  mkdir build
}

build() {
  cd "${gitname}/build"
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd "${gitname}/build"
  make DESTDIR="${pkgdir}" install
}