summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a0bbbf2ab1516faeee60b0b81093474d32a58fec (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
# Maintainer: redtide <redtid3@gmail.com>

_pkgname=colorpick
pkgname=$_pkgname-git
pkgver=0.1.0.r0.g8d0efbf
pkgrel=1
pkgdesc="Color picker and contrast checker"
url=https://github.com/qtilities/$_pkgname
arch=(x86_64)
license=(BSD)
depends=(
  qt5-base
)
makedepends=(
  cmake
  git
  qt5-tools
  qtilitools
)
provides=($_pkgname)
conflicts=($_pkgname)
source=(
  $_pkgname::git+$url.git
  $_pkgname/resources::git+https://github.com/qtilities-i18n/$_pkgname.git
)
sha512sums=(
  'SKIP'
  'SKIP'
)
pkgver() {
  cd "$srcdir/$_pkgname"
  ( set -o pipefail
    git describe --long --tags 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() {
  # Configure in prepare() because downloading translations via git with CMake
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -S $_pkgname
    -W no-dev
  )
  cmake "${cmake_options[@]}"
}

build() {
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $_pkgname/COPYING -t "$pkgdir"/usr/share/licenses/$_pkgname/
}