PKGBUILDs/community/gnuradio/PKGBUILD

131 lines
4.6 KiB
Bash
Raw Normal View History

2015-03-06 06:38:58 +00:00
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Dominik Heidler <dheidler@gmail.com>
# Contributor: Jonatan Sastre <jsastreh [ at ] hotmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - set -Dhave_mfpu_neon=0 for v5/v6
pkgbase=gnuradio
pkgname=(gnuradio gnuradio-companion)
2018-08-15 12:24:30 +00:00
pkgver=3.7.13.4
2019-01-16 20:37:12 +00:00
pkgrel=5
2015-03-06 06:38:58 +00:00
pkgdesc="General purpose DSP and SDR toolkit. With drivers for usrp and fcd."
2018-01-06 20:50:53 +00:00
arch=('x86_64')
2015-03-06 06:38:58 +00:00
url="http://gnuradio.org"
license=('GPL')
2016-04-25 13:37:19 +00:00
depends=('fftw' 'python2-numpy' 'cppunit' 'gsl' 'blas' 'boost-libs>=1.53'
'libusbx' 'portaudio' 'libuhd' 'zeromq' 'libvolk')
2015-03-15 16:56:21 +00:00
makedepends=('boost' 'cmake' 'python2-lxml' 'python2-cheetah' 'glu' 'swig'
2018-08-24 12:29:18 +00:00
'pygtk' 'wxpython' 'qwtplot3d' 'qwt5')
2015-03-06 06:38:58 +00:00
# todo
# split the gui components?
# build doxygen docs?
2015-03-15 16:56:21 +00:00
# gr-video-sdl ?
2015-03-06 06:38:58 +00:00
# icons
# comedilib: gr-comedi
# zeroc-ice: gr-ctrlport
# doxygen: C++ autogenerated documentation
# python2-sphinx: Python autogenerated documentation
# secret release directory
2015-05-30 16:52:27 +00:00
#source=("http://s3-dist.gnuradio.org/gnuradio-$pkgver.tar.gz"
2017-09-21 12:33:52 +00:00
source=("https://gnuradio.org/releases/$pkgbase/$pkgbase-$pkgver.tar.gz"
"https://gnuradio.org/releases/$pkgbase/$pkgbase-$pkgver.tar.gz.asc"
2018-06-08 04:57:47 +00:00
"21-fcd.rules" "gnuradio-gcc7.patch"
"boost-1.67.patch" "boost-1.67-pthread.patch")
2018-08-15 12:24:30 +00:00
validpgpkeys=('B90DDFAC56989BF62262EB812987C77CBB8ED9B2' # GNU Radio Project
'D74F9F146E7F755783583158B343B2BA293E5174') # Marcus Müller
md5sums=('b38d9cfa7cb4dcb97f5d19ebcabe8dcb'
2016-10-30 20:42:46 +00:00
'SKIP'
2017-05-29 17:29:12 +00:00
'465e12c454c6a22ebec9849181af7bdc'
2018-06-08 04:57:47 +00:00
'c510104fa2ad9852a683c265c42ae1da'
'204b87f1663411c17e5b40e9073e9d48'
'7f177cb699393cb4141d8eaa927c0c4a')
2015-03-06 06:38:58 +00:00
2015-12-27 23:01:33 +00:00
prepare() {
cd "$srcdir/$pkgbase-$pkgver"
msg "Replacing filenames to use python2."
sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
$(find ./ -name '*.py') \
$(find ./ -name 'gnuradio-companion' -o -name 'flow_graph.tmpl')
sed -i -e "s|#![ ]*/usr/bin/env /usr/bin/python$|#!/usr/bin/env python2|" \
$(find ./ -name '*.py')
2017-05-29 17:29:12 +00:00
# fix build with GCC 7 (Fedora)
2018-08-15 12:24:30 +00:00
#patch -p1 -N -i ../gnuradio-gcc7.patch
2018-06-08 04:57:47 +00:00
# https://github.com/gnuradio/gnuradio/pull/1733
2018-08-15 12:24:30 +00:00
#patch -p1 -N -i ../boost-1.67.patch
#patch -p1 -N -i ../boost-1.67-pthread.patch
# GCC 7?
#sed -i 's|SET(CMAKE_CXX_STANDARD 98)|#&|' CMakeLists.txt
#sed -i 's|SET(CMAKE_C_FLAGS .* -std=gnu99"|#&|' CMakeLists.txt
sed -i '333i ${CMAKE_THREAD_LIBS_INIT}' gr-blocks/lib/CMakeLists.txt
2018-08-24 12:29:18 +00:00
sed -e '/PyQt4/d' -i gr-qtgui/CMakeLists.txt # Build PyQt4 UI even if PyQt4 is not installed
2015-12-27 23:01:33 +00:00
}
2015-03-06 06:38:58 +00:00
build() {
export PYTHON=python2
cd "$srcdir/$pkgbase-$pkgver"
2016-07-09 03:52:51 +00:00
sed -i -e "s|GR_PKG_LIBEXEC_DIR|GR_RUNTIME_DIR|" grc/scripts/freedesktop/CMakeLists.txt
2015-03-06 06:38:58 +00:00
sed -i -e "s|/qwt$|/qwt5|" -e "s| qwt | qwt5 |" cmake/Modules/FindQwt.cmake
sed -i -e "s| sphinx-build$| sphinx-build2|" cmake/Modules/FindSphinx.cmake
msg "Starting build."
[[ $CARCH == "arm" || $CARCH == "armv6h" ]] && NEON="-Dhave_mfpu_neon=0"
mkdir -p build
cd build
cmake \
-DPYTHON_EXECUTABLE=$(which python2) \
-DPYTHON_INCLUDE_DIR=$(echo /usr/include/python2*) \
2015-03-15 16:56:21 +00:00
-DENABLE_GR_QTGUI=ON \
2015-03-06 06:38:58 +00:00
-DPYTHON_LIBRARY=$(echo /usr/lib/libpython2.*.so) \
2018-08-24 12:29:18 +00:00
-DPYQT4_FOUND=ON \
2016-04-25 13:37:19 +00:00
-DENABLE_INTERNAL_VOLK=OFF \
2015-03-06 06:38:58 +00:00
-DENABLE_GRC=ON \
-DENABLE_GR_WXGUI=ON \
-DCMAKE_INSTALL_PREFIX=/usr -Wno-dev $NEON ../
make
}
check() {
cd "$srcdir/$pkgbase-$pkgver/build"
export PYTHON=python2
#make test
}
package_gnuradio() {
optdepends=('boost: gr_modtool'
'swig: gr_modtool'
'cmake: gr_modtool'
2018-10-19 03:58:16 +00:00
'python2-cheetah: gr_modtool'
2015-03-06 06:38:58 +00:00
'pkgconfig: libuhd')
cd "$srcdir"
install -Dm644 21-fcd.rules "$pkgdir/usr/lib/udev/rules.d/21-fcd.rules"
2016-07-09 03:52:51 +00:00
cd "$srcdir/$pkgbase-$pkgver/grc/scripts/freedesktop"
2015-12-27 23:01:33 +00:00
install -Dm644 gnuradio-grc.desktop "$pkgdir/usr/share/applications/gnuradio-grc.desktop"
2015-03-06 06:38:58 +00:00
cd "$srcdir/$pkgbase-$pkgver/build"
make DESTDIR="$pkgdir" install
}
package_gnuradio-companion() {
pkgdesc="GUI frontend for gnuradio and SDR."
2015-03-15 16:56:21 +00:00
depends=('gnuradio' 'python2-cheetah' 'python2-lxml'
2018-08-24 12:29:18 +00:00
'pygtk' 'wxpython' 'python2-opengl' 'qwt5' 'qwtplot3d'
2016-02-09 13:20:17 +00:00
'python2-numarray')
2015-03-06 06:38:58 +00:00
# Yup, nothing in the package except dependencies,
2015-03-15 16:56:21 +00:00
# because more than five optdeps is too many for most people.
2015-03-06 06:38:58 +00:00
}
# options for armv6:
# -Dhave_mfpu_neon=0 \
# -DCMAKE_CXX_FLAGS:STRING="-march=armv6 -mfpu=vfp -mfloat-abi=hard" \
# -DCMAKE_C_FLAGS:STRING="-march=armv6 -mfpu=vfp -mfloat-abi=hard" \
# options for armv7:
# -DCMAKE_CXX_FLAGS:STRING="-march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard"
# -DCMAKE_C_FLAGS:STRING="-march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard"
# line 341 add /usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabi