Receipt for: gnuradio

source stuff/patches/float_array_to_int.patch stuff/patches/test_tag_variable_rate_ff_impl.patch
# SliTaz package receipt.

PACKAGE="gnuradio"
VERSION="3.7.13.4"
CATEGORY="development"
MAINTAINER="pascal.bellard@slitaz.org"
SHORT_DESC="Signal processing blocks to implement software radios."
LICENSE="GPL3"
WEB_SITE="https://gnuradio.org/"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="$WEB_SITE/releases/$PACKAGE/$TARBALL"

DEPENDS="alsa-lib fftw gsl jack-audio-connection-kit \
	libboost-date-time libboost-filesystem libboost-program-options \
	libboost-system libboost-thread orc portaudio python"
BUILD_DEPENDS="alsa-lib-dev cppunit-dev fftw-dev gsl-dev \
	jack-audio-connection-kit-dev libboost-dev libboost-filesystem-dev \
	libboost-program-options-dev libboost-regex-dev libboost-system-dev \
	libboost-test-dev libboost-thread-dev libboost-tr1-dev \
	libsdl-dev libusb-dev log4c-dev orc-dev pkg-config portaudio-dev \
	pygtk-dev python-cheetah python-lxml python-mako python-numpy \
	python-six python-sphinx swig cmake3"

# What is the latest version available today?
current_version()
{
	wget -O - $(dirname $WGET_URL) 2>/dev/null | \
	sed "/$PACKAGE-[0-9]/!d;/tar/!d;/rc[0-9]/d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lpthread"
	patch --input=$stuff/patches/float_array_to_int.patch \
		$src/gr-blocks/lib/float_array_to_int.cc
	patch --input=$stuff/patches/test_tag_variable_rate_ff_impl.patch \
		$src/gr-blocks/lib/test_tag_variable_rate_ff_impl.cc

	mkdir	build
	cd	build
	cmake ..				\
		-Wno-dev			\
		-DCMAKE_INSTALL_PREFIX=/usr &&
	make -j 1 &&
	sed -i 's,bin/ctest.*,& || true,' Makefile &&
	make -j 1 test &&
	make DESTDIR=$DESTDIR install
}
	
# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share
	mkdir -p  $fs/usr/lib

	cp -a $install/etc			$fs
	cp -a $install/usr/bin			$fs/usr
	cp -a $install/usr/share/gnuradio	$fs/usr/share
	cp -a $install/usr/lib/*.so*		$fs/usr/lib
	cp -a $install/usr/lib/python*		$fs/usr/lib
}