summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c729b13854fc03ea4148015f63e772e119153d81 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Maintainer: FFY00 <filipe.lains@gmail.com>

pkgname=limesuite-git
pkgver=18.06.0.r45.02cabfd
pkgrel=1
pkgdesc='Driver and GUI for LMS7002M-based SDR platforms (LimeSDR, Novena RF7, etc.)'
arch=('x86_64')
url='https://github.com/myriadrf/LimeSuite'
license=('Apache')
depends=('sqlite3' 'wxgtk2' 'freeglut' 'libusb>=1.0' 'soapysdr' 'wget' 'gnuplot' 'glew' 'fltk')
makedepends=('git' 'cmake' 'doxygen' 'octave')
optdepends=('octave: Octave plugin')
provides=('limesuite' 'soapylms7')
conflicts=('limesuite' 'soapylms7')
source=("git+$url.git")
sha512sums=('SKIP')

pkgver() {
  cd LimeSuite

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

prepare() {
  cd LimeSuite

  # Change mode to 666 and ommit plugdev group
  sed -i 's|MODE="660", GROUP="plugdev"|MODE="666"|g' udev-rules/64-limesuite.rules

#  # Octave plugin
#  sed -i 's|/usr/local|/usr|g' octave/Makefile # Fix install directory
#  cp src/lime/* octave/ # Fix headers
}

build() {
  mkdir -p LimeSuite/build
  cd LimeSuite/build

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_UTILITIES=True \
    -DENABLE_LIME_UTIL=True \
    -DENABLE_DESKTOP=True \
    -DENABLE_SOAPY_LMS7=True \
    -DENABLE_EVB7COM=True \
    -DENABLE_PCIE_XILLYBUS=True \
    -DENABLE_REMOTE=True \
    -DENABLE_QUICKTEST=True \
    -DENABLE_MCU_TESTBENCH=True \
    -DENABLE_FTDI=True \
    -DENABLE_FX3=True \
    -DENABLE_STREAM_UNITE=True \
    -DENABLE_EXAMPLES=True \
    -DENABLE_HEADERS=True \
    -DENABLE_GUI=True \
    -DENABLE_API_DOXYGEN=True \
    -DLIME_SUITE_EXTVER=$pkgver

#    -DENABLE_TESTS=True \
#    -DENABLE_NOVENARF7=True \

  make

#  # Octave plugin
#  cd ../octave
#
#  make
}

#check() {
#  # Octave plugin
#  cd LimeSuite/octave
#
#  make test
#}

package() {
  cd LimeSuite/build

  make DESTDIR="$pkgdir" install

  # Install udev rules, changing mode to 666 and ommitting plugdev group
  install -Dm 644 ../udev-rules/64-limesuite.rules "$pkgdir"/etc/udev/rules.d/64-limesuite.rules

  # Install icons and .desktop file
  install -Dm 644 ../Desktop/lime-suite-128.png "$pkgdir"/usr/share/pixmaps/lime-suite.png
  install -Dm 755 ../Desktop/lime-suite.desktop "$pkgdir"/usr/share/applications/lime-suite.desktop

  # Install documentation
  install -dm 755 "$pkgdir"/usr/share/doc/$pkgname
  cp -r --no-preserve=ownership ../docs/LMS_API_Documentation/* "$pkgdir"/usr/share/doc/$pkgname
}