From 9e1b7f9b78af7dc192425f48f099e5054d4793b6 Mon Sep 17 00:00:00 2001 From: Rick Farina Date: Tue, 4 Nov 2014 12:35:24 +0000 Subject: add patch to disable pre-amp on hackrf by default, remove old ebuilds to avoid accidental hardware damage (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key DD11F94A) --- net-wireless/gr-osmosdr/ChangeLog | 10 ++- net-wireless/gr-osmosdr/files/hackrf-safety.patch | 34 +++++++++++ net-wireless/gr-osmosdr/gr-osmosdr-0.0.2-r1.ebuild | 67 -------------------- net-wireless/gr-osmosdr/gr-osmosdr-0.1.3-r1.ebuild | 71 ++++++++++++++++++++++ net-wireless/gr-osmosdr/gr-osmosdr-0.1.3.ebuild | 70 --------------------- 5 files changed, 114 insertions(+), 138 deletions(-) create mode 100644 net-wireless/gr-osmosdr/files/hackrf-safety.patch delete mode 100644 net-wireless/gr-osmosdr/gr-osmosdr-0.0.2-r1.ebuild create mode 100644 net-wireless/gr-osmosdr/gr-osmosdr-0.1.3-r1.ebuild delete mode 100644 net-wireless/gr-osmosdr/gr-osmosdr-0.1.3.ebuild (limited to 'net-wireless') diff --git a/net-wireless/gr-osmosdr/ChangeLog b/net-wireless/gr-osmosdr/ChangeLog index 6166a8ec5f46..a9b154d78ff4 100644 --- a/net-wireless/gr-osmosdr/ChangeLog +++ b/net-wireless/gr-osmosdr/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-wireless/gr-osmosdr # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/gr-osmosdr/ChangeLog,v 1.26 2014/08/28 19:58:13 zerochaos Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/gr-osmosdr/ChangeLog,v 1.27 2014/11/04 12:35:24 zerochaos Exp $ + +*gr-osmosdr-0.1.3-r1 (04 Nov 2014) + + 04 Nov 2014; Rick Farina +files/hackrf-safety.patch, + +gr-osmosdr-0.1.3-r1.ebuild, -gr-osmosdr-0.0.2-r1.ebuild, + -gr-osmosdr-0.1.3.ebuild: + add patch to disable pre-amp on hackrf by default, remove old ebuilds to avoid + accidental hardware damage *gr-osmosdr-0.1.3 (28 Aug 2014) diff --git a/net-wireless/gr-osmosdr/files/hackrf-safety.patch b/net-wireless/gr-osmosdr/files/hackrf-safety.patch new file mode 100644 index 000000000000..fc04fc0c50ed --- /dev/null +++ b/net-wireless/gr-osmosdr/files/hackrf-safety.patch @@ -0,0 +1,34 @@ +commit 39230788d7f4b0a8d6d3ab32039073ed53e74af6 +Author: Dimitri Stolnikov +Date: Tue Oct 21 22:10:40 2014 +0200 + + hackrf: disable AMP gain stage by default to protect it from damage + + patch proivided by Paul Connolly + +diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc +index 120b271..3a1e7da 100644 +--- a/lib/hackrf/hackrf_sink_c.cc ++++ b/lib/hackrf/hackrf_sink_c.cc +@@ -213,7 +213,7 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args) + set_sample_rate( get_sample_rates().start() ); + set_bandwidth( 0 ); + +- set_gain( 14 ); /* enable AMP gain stage by default */ ++ set_gain( 0 ); /* disable AMP gain stage by default to protect full sprectrum pre-amp from physical damage */ + + set_if_gain( 16 ); /* preset to a reasonable default (non-GRC use case) */ + +diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc +index f647b80..e3b3ea4 100644 +--- a/lib/hackrf/hackrf_source_c.cc ++++ b/lib/hackrf/hackrf_source_c.cc +@@ -168,7 +168,7 @@ hackrf_source_c::hackrf_source_c (const std::string &args) + set_sample_rate( get_sample_rates().start() ); + set_bandwidth( 0 ); + +- set_gain( 14 ); /* enable AMP gain stage by default */ ++ set_gain( 0 ); /* disable AMP gain stage by default to protect full sprectrum pre-amp from physical damage */ + + set_if_gain( 16 ); /* preset to a reasonable default (non-GRC use case) */ + diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.0.2-r1.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.0.2-r1.ebuild deleted file mode 100644 index 71fdd5b075c7..000000000000 --- a/net-wireless/gr-osmosdr/gr-osmosdr-0.0.2-r1.ebuild +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/gr-osmosdr/gr-osmosdr-0.0.2-r1.ebuild,v 1.1 2013/09/16 16:03:12 zerochaos Exp $ - -EAPI=5 -PYTHON_DEPEND="python? 2" - -inherit cmake-utils python - -DESCRIPTION="GNU Radio source block for OsmoSDR and rtlsdr and hackrf" -HOMEPAGE="http://sdr.osmocom.org/trac/wiki/GrOsmoSDR" - -if [[ ${PV} == 9999* ]]; then - inherit git-2 - SRC_URI="" - EGIT_REPO_URI="git://git.osmocom.org/${PN}.git" - KEYWORDS="" -else - SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz" - KEYWORDS="~amd64 ~arm ~x86" -fi - -LICENSE="GPL-3" -SLOT="0/${PV}" -IUSE="fcd hackrf iqbalance python rtlsdr uhd" -#IUSE="fcd hackrf iqbalance osmosdr python rtlsdr uhd" - -# osmosdr? ( net-libs/libosmosdr:= ) -RDEPEND=" ../gr-osmosdr-${PV}.tar.xz + SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz" + KEYWORDS="~amd64 ~arm ~x86" +fi + +LICENSE="GPL-3" +SLOT="0/${PV}" +IUSE="bladerf fcd hackrf iqbalance mirisdr python rtlsdr uhd" + +RDEPEND="${PYTHON_DEPS} + dev-libs/boost:= + >=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_USEDEP}] + bladerf? ( net-wireless/bladerf:= ) + hackrf? ( net-libs/libhackrf:= ) + iqbalance? ( net-wireless/gr-iqbal:=[${PYTHON_USEDEP}] ) + mirisdr? ( net-libs/libmirisdr:= ) + rtlsdr? ( >=net-wireless/rtl-sdr-0.5.3:= ) + uhd? ( net-wireless/uhd:=[${PYTHON_USEDEP}] )" +DEPEND="${RDEPEND} + dev-python/cheetah" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +src_prepare() { + epatch "${FILESDIR}/hackrf-safety.patch" + epatch_user +} + +src_configure() { + local mycmakeargs=( + -DENABLE_DEFAULT=OFF + -DPYTHON_EXECUTABLE="${PYTHON}" + -DENABLE_FILE=ON + $(cmake-utils_use_enable bladerf) + $(cmake-utils_use_enable fcd) + $(cmake-utils_use_enable hackrf) + $(cmake-utils_use_enable iqbalance) + $(cmake-utils_use_enable mirisdr MIRI) + $(cmake-utils_use_enable python) + $(cmake-utils_use_enable rtlsdr RTL) + $(cmake-utils_use_enable rtlsdr RTL_TCP) + $(cmake-utils_use_enable uhd) + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + python_fix_shebang "${ED}"/usr/bin +} diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.3.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.1.3.ebuild deleted file mode 100644 index 5faa1c02453f..000000000000 --- a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.3.ebuild +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/gr-osmosdr/gr-osmosdr-0.1.3.ebuild,v 1.1 2014/08/28 19:58:13 zerochaos Exp $ - -EAPI=5 -PYTHON_COMPAT=( python2_7 ) - -inherit cmake-utils python-single-r1 - -DESCRIPTION="GNU Radio source block for OsmoSDR and rtlsdr and hackrf" -HOMEPAGE="http://sdr.osmocom.org/trac/wiki/GrOsmoSDR" - -if [[ ${PV} == 9999* ]]; then - inherit git-r3 - SRC_URI="" - EGIT_REPO_URI="git://git.osmocom.org/${PN}.git" - KEYWORDS="" -else - #git clone git://git.osmocom.org/gr-osmosdr.git - #cd gr-osmosdr - #git archive --format=tar --prefix=gr-osmosdr-${PV}/ v${PV} | xz > ../gr-osmosdr-${PV}.tar.xz - SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz" - KEYWORDS="~amd64 ~arm ~x86" -fi - -LICENSE="GPL-3" -SLOT="0/${PV}" -IUSE="bladerf fcd hackrf iqbalance mirisdr python rtlsdr uhd" - -RDEPEND="${PYTHON_DEPS} - dev-libs/boost:= - >=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_USEDEP}] - bladerf? ( net-wireless/bladerf:= ) - hackrf? ( net-libs/libhackrf:= ) - iqbalance? ( net-wireless/gr-iqbal:=[${PYTHON_USEDEP}] ) - mirisdr? ( net-libs/libmirisdr:= ) - rtlsdr? ( >=net-wireless/rtl-sdr-0.5.3:= ) - uhd? ( net-wireless/uhd:=[${PYTHON_USEDEP}] )" -DEPEND="${RDEPEND} - dev-python/cheetah" - -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -src_prepare() { - epatch_user -} - -src_configure() { - local mycmakeargs=( - -DENABLE_DEFAULT=OFF - -DPYTHON_EXECUTABLE="${PYTHON}" - -DENABLE_FILE=ON - $(cmake-utils_use_enable bladerf) - $(cmake-utils_use_enable fcd) - $(cmake-utils_use_enable hackrf) - $(cmake-utils_use_enable iqbalance) - $(cmake-utils_use_enable mirisdr MIRI) - $(cmake-utils_use_enable python) - $(cmake-utils_use_enable rtlsdr RTL) - $(cmake-utils_use_enable rtlsdr RTL_TCP) - $(cmake-utils_use_enable uhd) - ) - - cmake-utils_src_configure -} - -src_install() { - cmake-utils_src_install - python_fix_shebang "${ED}"/usr/bin -} -- cgit v1.2.3-65-gdbad