summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1890d0776bcd42c42da24769f9aa83c40273ae60 (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
# Maintainer: Forest Crossman <cyrozap at gmail dot com>
# Modified from gr-osmosdr-git PKGBUILD

_pkgname='gr-cc1111'
pkgname="${_pkgname}-git"
epoch=1
pkgver=r10.20141005.e6b5eb0
pkgrel=1
pkgdesc="CC1111 packet encoder/decoder for GNU Radio"
arch=('i686' 'x86_64')
url="https://github.com/funoverip/gr-cc1111"
license=('GPL3')
depends=(
  'gnuradio'
  'libvolk'
  'swig'
)
makedepends=(
  'cmake'
  'boost'
  'git'
)
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}")
source=("${_pkgname}::git+git://github.com/funoverip/gr-cc1111.git")
sha256sums=('SKIP')

prepare() {
  cd "${srcdir}/${_pkgname}"

  mkdir -p build
}

pkgver() {
  cd "${srcdir}/${_pkgname}"

  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_rev}" ]; then
    error "Git commit count could not be determined."
    return 1
  else
    printf '%s' "r${_rev}.${_date}.${_hash}"
  fi
}

build() {
  cd "${srcdir}/${_pkgname}/build"

  cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_GRC=ON \
    -DENABLE_PYTHON=ON \
    -DENABLE_TESTING=ON \
    -DPYTHON_EXECUTABLE="$(which python2)" \
    -DPYTHON_INCLUDE_DIR="$(echo /usr/include/python2*)" \
    -DPYTHON_LIBRARY="$(echo /usr/lib/libpython2.*.so)" \
    ../src/gr-cc1111
  make
}

package() {
  cd cd "${srcdir}/${_pkgname}/build"

  make DESTDIR="${pkgdir}" install
}