summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a39dfe398d639146ed0dd0747470f7466382ab1 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Maintainer:
# Contributor: Jan Neumann <neum dot ja at gmail dot com>
# Contributor: librewish <librewish at gmail dot com>

_pkgname="ksmoothdock"
pkgname="$_pkgname-git"
pkgver=6.3.r0.g30e51e8
pkgrel=1
pkgdesc='A cool desktop panel for KDE Plasma 5'
arch=('x86_64')
url='https://github.com/dangvd/ksmoothdock'
license=('GPL3')

depends=(
  'kactivities5'
  'kxmlgui5'
)
makedepends=(
  'cmake'
  'extra-cmake-modules'
  'python'
)


if [ x"$pkgname" == x"$_pkgname" ] ; then
  # normal package
  _pkgsrc="$_pkgname-${pkgver%%.r*}"
  _pkgext="tar.gz"
  source=(
   "$_pkgsrc.$_pkgext"::"$url/archive/v${pkgver%%.r*}.$_pkgext"
  )
  sha256sums=(
   '96eb9ce72ee4c44496c760c6bc9aa5e26b5cd3826729c112e7c81d2661effc02'
  )

  pkgver() {
    echo "${pkgver%%.r*}"
  }
else
  # git package
  makedepends+=('git')

  provides=("$_pkgname")
  conflicts=("$_pkgname")

  _pkgsrc="$_pkgname"
  source=(
   "$_pkgsrc"::"git+$url.git"
  )
  sha256sums=(
   'SKIP'
  )

  pkgver() {
    cd "$_pkgsrc"
    git describe --long --tags | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
  }
fi

prepare() {
  cd "$_pkgsrc"
  sed '/add_compile_options/d' -i "src/CMakeLists.txt"
}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc/src"
    -DCMAKE_INSTALL_PREFIX='/usr'
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="${pkgdir:?}" cmake --install build
}