From 31500a595ec2eaf7c542003a49f52cd404ae3d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=2E=20Stani=C4=87?= Date: Wed, 29 Apr 2020 11:11:21 +0200 Subject: main/librtlsdr: move from testing it is needed to enable radio source in rng-tools 6.10 --- ...Fix-inline-functions-to-use-static-inline.patch | 65 ++++++++++++++++++++++ main/librtlsdr/APKBUILD | 40 +++++++++++++ ...Fix-inline-functions-to-use-static-inline.patch | 65 ---------------------- testing/librtlsdr/APKBUILD | 40 ------------- 4 files changed, 105 insertions(+), 105 deletions(-) create mode 100644 main/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch create mode 100644 main/librtlsdr/APKBUILD delete mode 100644 testing/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch delete mode 100644 testing/librtlsdr/APKBUILD diff --git a/main/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch b/main/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch new file mode 100644 index 0000000000..527d25a3cd --- /dev/null +++ b/main/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch @@ -0,0 +1,65 @@ +From 9047eef701f50d8bc4748233a31d65a0519ed86c Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Thu, 28 Jun 2018 16:43:24 +0100 +Subject: [PATCH] Fix inline functions to use 'static inline' + +With just 'inline', if the compiler decides not to inline them, it isn't +required to emit them at all. For some targets with -Os that is causing +build failures, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86360. + +Perhaps we might consider using '__attribute__((always_inline))' for +GCC builds, but 'static inline' is a good start. + +Signed-off-by: Steve Markgraf +--- + src/rtl_adsb.c | 8 ++++---- + src/rtl_power.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/rtl_adsb.c b/src/rtl_adsb.c +index 9087de4..7aea8dd 100644 +--- a/src/rtl_adsb.c ++++ b/src/rtl_adsb.c +@@ -183,7 +183,7 @@ int magnitute(uint8_t *buf, int len) + return len/2; + } + +-inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d) ++static inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d) + /* takes 4 consecutive real samples, return 0 or 1, BADSAMPLE on error */ + { + int bit, bit_p; +@@ -224,17 +224,17 @@ inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d + return BADSAMPLE; + } + +-inline uint16_t min16(uint16_t a, uint16_t b) ++static inline uint16_t min16(uint16_t a, uint16_t b) + { + return ab ? a : b; + } + +-inline int preamble(uint16_t *buf, int i) ++static inline int preamble(uint16_t *buf, int i) + /* returns 0/1 for preamble at index i */ + { + int i2; +diff --git a/src/rtl_power.c b/src/rtl_power.c +index 00f4d9f..625d818 100644 +--- a/src/rtl_power.c ++++ b/src/rtl_power.c +@@ -250,7 +250,7 @@ void sine_table(int size) + } + } + +-inline int16_t FIX_MPY(int16_t a, int16_t b) ++static inline int16_t FIX_MPY(int16_t a, int16_t b) + /* fixed point multiply and scale */ + { + int c = ((int)a * (int)b) >> 14; diff --git a/main/librtlsdr/APKBUILD b/main/librtlsdr/APKBUILD new file mode 100644 index 0000000000..7779b2ac62 --- /dev/null +++ b/main/librtlsdr/APKBUILD @@ -0,0 +1,40 @@ +# Contributor: Jared Szechy +# Maintainer: Jared Szechy +pkgname=librtlsdr +pkgver=0.5.4 +pkgrel=2 +pkgdesc="Software defined radio receiver for Realtek RTL2832U" +url="https://osmocom.org/projects/sdr/wiki/rtl-sdr" +arch="all" +license="GPL-2.0" +depends_dev="libusb-dev" +makedepends="$depends_dev cmake" +subpackages="$pkgname-dev rtl-sdr:tools" +source="$pkgname-$pkgver.tar.gz::https://github.com/steve-m/$pkgname/archive/v$pkgver.tar.gz + 0001-Fix-inline-functions-to-use-static-inline.patch" +builddir="$srcdir/$pkgname-$pkgver" + +build() { + cd "$builddir" + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr \ + -DDETACH_KERNEL_DRIVER=ON \ + -Wno-dev .. + make +} + +package() { + cd "$builddir"/build + make DESTDIR="$pkgdir" install +} + +tools() { + pkgdesc="Software defined radio receiver for Realtek RTL2832U (tools)" + mkdir -p "$subpkgdir"/usr + mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ +} + +sha512sums="81d01ccced763d728b4bb1aeff4bc04c394d4d6906f1df5c8b83671769bb4ca551017fea680981431a9e9436644a765b049259e42fcec1be8b709a81daf420ea librtlsdr-0.5.4.tar.gz +87bd0f0347f2d7ef480a73b6c2915d4da0879815c77e8e2a236edff95ddd571b956625f7adc7cde995ceca46bf4b93ed92e6dac94f90195f832066baf6c1f616 0001-Fix-inline-functions-to-use-static-inline.patch" diff --git a/testing/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch b/testing/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch deleted file mode 100644 index 527d25a3cd..0000000000 --- a/testing/librtlsdr/0001-Fix-inline-functions-to-use-static-inline.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 9047eef701f50d8bc4748233a31d65a0519ed86c Mon Sep 17 00:00:00 2001 -From: David Woodhouse -Date: Thu, 28 Jun 2018 16:43:24 +0100 -Subject: [PATCH] Fix inline functions to use 'static inline' - -With just 'inline', if the compiler decides not to inline them, it isn't -required to emit them at all. For some targets with -Os that is causing -build failures, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86360. - -Perhaps we might consider using '__attribute__((always_inline))' for -GCC builds, but 'static inline' is a good start. - -Signed-off-by: Steve Markgraf ---- - src/rtl_adsb.c | 8 ++++---- - src/rtl_power.c | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/rtl_adsb.c b/src/rtl_adsb.c -index 9087de4..7aea8dd 100644 ---- a/src/rtl_adsb.c -+++ b/src/rtl_adsb.c -@@ -183,7 +183,7 @@ int magnitute(uint8_t *buf, int len) - return len/2; - } - --inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d) -+static inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d) - /* takes 4 consecutive real samples, return 0 or 1, BADSAMPLE on error */ - { - int bit, bit_p; -@@ -224,17 +224,17 @@ inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d - return BADSAMPLE; - } - --inline uint16_t min16(uint16_t a, uint16_t b) -+static inline uint16_t min16(uint16_t a, uint16_t b) - { - return ab ? a : b; - } - --inline int preamble(uint16_t *buf, int i) -+static inline int preamble(uint16_t *buf, int i) - /* returns 0/1 for preamble at index i */ - { - int i2; -diff --git a/src/rtl_power.c b/src/rtl_power.c -index 00f4d9f..625d818 100644 ---- a/src/rtl_power.c -+++ b/src/rtl_power.c -@@ -250,7 +250,7 @@ void sine_table(int size) - } - } - --inline int16_t FIX_MPY(int16_t a, int16_t b) -+static inline int16_t FIX_MPY(int16_t a, int16_t b) - /* fixed point multiply and scale */ - { - int c = ((int)a * (int)b) >> 14; diff --git a/testing/librtlsdr/APKBUILD b/testing/librtlsdr/APKBUILD deleted file mode 100644 index 7779b2ac62..0000000000 --- a/testing/librtlsdr/APKBUILD +++ /dev/null @@ -1,40 +0,0 @@ -# Contributor: Jared Szechy -# Maintainer: Jared Szechy -pkgname=librtlsdr -pkgver=0.5.4 -pkgrel=2 -pkgdesc="Software defined radio receiver for Realtek RTL2832U" -url="https://osmocom.org/projects/sdr/wiki/rtl-sdr" -arch="all" -license="GPL-2.0" -depends_dev="libusb-dev" -makedepends="$depends_dev cmake" -subpackages="$pkgname-dev rtl-sdr:tools" -source="$pkgname-$pkgver.tar.gz::https://github.com/steve-m/$pkgname/archive/v$pkgver.tar.gz - 0001-Fix-inline-functions-to-use-static-inline.patch" -builddir="$srcdir/$pkgname-$pkgver" - -build() { - cd "$builddir" - mkdir -p build - cd build - cmake -DCMAKE_BUILD_TYPE=None \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DDETACH_KERNEL_DRIVER=ON \ - -Wno-dev .. - make -} - -package() { - cd "$builddir"/build - make DESTDIR="$pkgdir" install -} - -tools() { - pkgdesc="Software defined radio receiver for Realtek RTL2832U (tools)" - mkdir -p "$subpkgdir"/usr - mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ -} - -sha512sums="81d01ccced763d728b4bb1aeff4bc04c394d4d6906f1df5c8b83671769bb4ca551017fea680981431a9e9436644a765b049259e42fcec1be8b709a81daf420ea librtlsdr-0.5.4.tar.gz -87bd0f0347f2d7ef480a73b6c2915d4da0879815c77e8e2a236edff95ddd571b956625f7adc7cde995ceca46bf4b93ed92e6dac94f90195f832066baf6c1f616 0001-Fix-inline-functions-to-use-static-inline.patch" -- cgit v1.2.3