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
# Maintainer: Dominik Heidler <[email protected]>
# Contributor: Alain Kalker <[email protected]>
pkgname=gnuradio-git
pkgver=20130404
pkgrel=1
pkgdesc="free software development toolkit that provides the signal processing runtime and processing blocks to implement software radios using readily-available, low-cost external RF hardware and commodity processors"
arch=('i686' 'x86_64')
license=('GPL')
depends=('fftw' 'python2-numpy' 'cppunit' 'swig' 'gsl' 'blas' 'guile' 'boost-libs>=1.53' 'libuhd')
makedepends=('git' 'boost>=1.53' 'cmake')
optdepends=('wxpython: gr-wxgui' 'python2-cheetah: grc' 'python2-lxml: grc' 'qwtplot3d: gr-qtgui' 'doxygen: docs autogenerated documentation' 'pyxml: grc' 'pygtk: grc' 'pkgconfig' 'pyqwt: gr-qtgui')
provides=('gnuradio')
url="http://gnuradio.org"
source=()
md5sums=()
conflicts=(gnuradio)

_gitroot=git://gnuradio.org/gnuradio
_gitname=gnuradio

build() {
	export PYTHON=python2
	cd ${srcdir}
	if [ -d $_gitname ]; then
		cd $_gitname && git reset HEAD --hard && git clean -x -d -f && git pull origin
		msg "Updated the local files."
	else
		git clone $_gitroot
		msg "GIT checkout done or server timeout"
		cd $_gitname
	fi
	msg "Starting build."
	mkdir build
	cd build
	cmake \
		-DPYTHON_EXECUTABLE=$(which python2) \
		-DPYTHON_INCLUDE_DIR=$(echo /usr/include/python2*) \
		-DPYTHON_LIBRARY=$(echo /usr/lib/libpython2.*.so) \
		-DCMAKE_INSTALL_PREFIX=/usr ../ 
	make
}

check() {
	cd ${srcdir}/$_gitname/build
	export PYTHON=python2
	#make test
}

package() {
	msg "Replacing filenames to use python2."
	sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" $(find ${srcdir} -name '*.py') $(find ${srcdir} -name 'gnuradio-companion' -o -name 'flow_graph.tmpl')
	cd ${srcdir}/$_gitname/build
	make DESTDIR=${pkgdir} install
}