summaryrefslogtreecommitdiff
path: root/ham
diff options
context:
space:
mode:
authordbj <dbj@pkgsrc.org>2016-01-26 09:10:39 +0000
committerdbj <dbj@pkgsrc.org>2016-01-26 09:10:39 +0000
commitbd7cab6e005d98b82bdc764d5086b513d74bb18c (patch)
treef168900e985a65abcaa645cc680c17b69d221be8 /ham
parentcafa736d29d594b261820c73b7457664dcfa14f8 (diff)
downloadpkgsrc-bd7cab6e005d98b82bdc764d5086b513d74bb18c.tar.gz
install pkg-config support
remove accidental stdout printf fix issue with canceling with signals
Diffstat (limited to 'ham')
-rw-r--r--ham/rtl-sdr/Makefile28
-rw-r--r--ham/rtl-sdr/PLIST3
-rw-r--r--ham/rtl-sdr/buildlink3.mk3
-rw-r--r--ham/rtl-sdr/distinfo5
-rw-r--r--ham/rtl-sdr/patches/patch-cmake_Modules_FindLibUSB.cmake16
-rw-r--r--ham/rtl-sdr/patches/patch-src_librtlsdr.c57
-rw-r--r--ham/rtl-sdr/patches/patch-src_tuner__r82xx.c13
7 files changed, 100 insertions, 25 deletions
diff --git a/ham/rtl-sdr/Makefile b/ham/rtl-sdr/Makefile
index 32576a94366..b280ecaa65a 100644
--- a/ham/rtl-sdr/Makefile
+++ b/ham/rtl-sdr/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2015/09/02 20:56:23 mef Exp $
+# $NetBSD: Makefile,v 1.5 2016/01/26 09:10:39 dbj Exp $
DISTNAME= rtl-sdr-0.5.3
+PKGREVISION= 1
CATEGORIES= ham
MASTER_SITES= ${MASTER_SITE_GITHUB:=steve-m/}
GITHUB_PROJECT= librtlsdr
@@ -13,29 +14,14 @@ LICENSE= gnu-gpl-v2
USE_LANGUAGES+= c c++
USE_TOOLS+= gmake
-USE_CMAKE= yes
-AUTO_MKDIRS= yes
-
-## CMake Error at CMakeLists.txt:69 (message):
-## LibUSB 1.0 required to compile rtl-sdr
-CMAKE_ARGS+= -DLIBUSB_INCLUDE_DIR=${PREFIX}/include/libusb-1.0
-CMAKE_ARG_PATH= ../
-CONFIGURE_DIRS= build
-SUBST_CLASSES+= destdir
-SUBST_MESSAGE.destdir= Replace install destination to ${DESTDIR}
-SUBST_FILES.destdir= build/cmake_install.cmake
-SUBST_STAGE.destdir= pre-install
-SUBST_SED.destdir= -e 's|\$${CMAKE_INSTALL_PREFIX}|${DESTDIR}\$${CMAKE_INSTALL_PREFIX}|'
+USE_CMAKE= yes
+CONFIGURE_DIRS=build
+BUILD_DIRS=${CONFIGURE_DIRS}
+CMAKE_ARG_PATH=..
pre-configure:
- (cd ${WRKSRC}; ${MKDIR} build;)
-
-do-build:
- (cd ${WRKSRC}/build; ${GMAKE})
-
-do-install:
- (cd ${WRKSRC}/build; ${GMAKE} install)
+ ${MKDIR} ${WRKSRC}/build
.include "../../devel/libusb1/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/ham/rtl-sdr/PLIST b/ham/rtl-sdr/PLIST
index fff3e764ea3..5574f8d4d52 100644
--- a/ham/rtl-sdr/PLIST
+++ b/ham/rtl-sdr/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1 2014/10/13 13:05:36 mef Exp $
+@comment $NetBSD: PLIST,v 1.2 2016/01/26 09:10:39 dbj Exp $
bin/rtl_adsb
bin/rtl_eeprom
bin/rtl_fm
@@ -12,3 +12,4 @@ lib/librtlsdr.a
lib/librtlsdr.so
lib/librtlsdr.so.0
lib/librtlsdr.so.${PKGVERSION}
+lib/pkgconfig/librtlsdr.pc
diff --git a/ham/rtl-sdr/buildlink3.mk b/ham/rtl-sdr/buildlink3.mk
index d99a9dc303d..4bc3d19b952 100644
--- a/ham/rtl-sdr/buildlink3.mk
+++ b/ham/rtl-sdr/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.1 2014/10/13 13:05:36 mef Exp $
+# $NetBSD: buildlink3.mk,v 1.2 2016/01/26 09:10:39 dbj Exp $
BUILDLINK_TREE+= rtl-sdr
@@ -6,7 +6,6 @@ BUILDLINK_TREE+= rtl-sdr
RTL_SDR_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.rtl-sdr+= rtl-sdr>=0.5.3
-BUILDLINK_ABI_DEPENDS.rtl-sdr+= rtl-sdr>=0.5.3
BUILDLINK_PKGSRCDIR.rtl-sdr?= ../../ham/rtl-sdr
.endif # RTL_SDR_BUILDLINK3_MK
diff --git a/ham/rtl-sdr/distinfo b/ham/rtl-sdr/distinfo
index 37d1b84d15b..a5ff5692ada 100644
--- a/ham/rtl-sdr/distinfo
+++ b/ham/rtl-sdr/distinfo
@@ -1,7 +1,10 @@
-$NetBSD: distinfo,v 1.4 2015/11/02 23:57:24 agc Exp $
+$NetBSD: distinfo,v 1.5 2016/01/26 09:10:39 dbj Exp $
SHA1 (rtl-sdr-0.5.3.tar.gz) = f6f20f7b0562a6d3f7b9ff7bff38a15bff175982
RMD160 (rtl-sdr-0.5.3.tar.gz) = 3b30938053870ed2d4b261ac9e27ad0863762ca4
SHA512 (rtl-sdr-0.5.3.tar.gz) = b2887b5df2728f8481b07fb4d8b9bee18b98c5c0ccd0c8e65c2e784a32826cc2301631e95e54071324e5dfbdaa11f0a5aa483cc619b864d4788c3700980b38b6
Size (rtl-sdr-0.5.3.tar.gz) = 117414 bytes
+SHA1 (patch-cmake_Modules_FindLibUSB.cmake) = 95df1dd9ff3b9d5cf7afc55cc5f80cabe1d90491
+SHA1 (patch-src_librtlsdr.c) = 881418afaff87e98511e955cb0ed4d40fba19237
SHA1 (patch-src_rtl__fm_c) = 04ec7142f38f26d2ed431765017f53e8e79a3a36
+SHA1 (patch-src_tuner__r82xx.c) = 54763a749eaa64e2c7f816cfe04df8b76eff93c9
diff --git a/ham/rtl-sdr/patches/patch-cmake_Modules_FindLibUSB.cmake b/ham/rtl-sdr/patches/patch-cmake_Modules_FindLibUSB.cmake
new file mode 100644
index 00000000000..bec516340b0
--- /dev/null
+++ b/ham/rtl-sdr/patches/patch-cmake_Modules_FindLibUSB.cmake
@@ -0,0 +1,16 @@
+$NetBSD: patch-cmake_Modules_FindLibUSB.cmake,v 1.1 2016/01/26 09:10:39 dbj Exp $
+
+--- cmake/Modules/FindLibUSB.cmake.orig 2014-02-07 01:04:24.000000000 +0000
++++ cmake/Modules/FindLibUSB.cmake
+@@ -32,11 +32,6 @@ if(LIBUSB_LIBRARIES)
+ set(CMAKE_REQUIRED_LIBRARIES ${LIBUSB_LIBRARIES})
+ endif()
+
+-CHECK_FUNCTION_EXISTS("libusb_handle_events_timeout_completed" HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED)
+-if(HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED)
+- add_definitions(-DHAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED=1)
+-endif(HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED)
+-
+ CHECK_FUNCTION_EXISTS("libusb_error_name" HAVE_LIBUSB_ERROR_NAME)
+ if(HAVE_LIBUSB_ERROR_NAME)
+ add_definitions(-DHAVE_LIBUSB_ERROR_NAME=1)
diff --git a/ham/rtl-sdr/patches/patch-src_librtlsdr.c b/ham/rtl-sdr/patches/patch-src_librtlsdr.c
new file mode 100644
index 00000000000..5e12a24c2d3
--- /dev/null
+++ b/ham/rtl-sdr/patches/patch-src_librtlsdr.c
@@ -0,0 +1,57 @@
+$NetBSD: patch-src_librtlsdr.c,v 1.1 2016/01/26 09:10:39 dbj Exp $
+
+--- src/librtlsdr.c.orig 2014-02-07 01:04:24.000000000 +0000
++++ src/librtlsdr.c
+@@ -39,6 +39,12 @@
+ #define LIBUSB_CALL
+ #endif
+
++/* libusb < 1.0.9 doesn't have libusb_handle_events_timeout_completed */
++#ifndef HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED
++#define libusb_handle_events_timeout_completed(ctx, tv, c) \
++ libusb_handle_events_timeout(ctx, tv)
++#endif
++
+ /* two raised to the power of n */
+ #define TWO_POW(n) ((double)(1ULL<<(n)))
+
+@@ -1776,11 +1782,8 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev,
+ }
+
+ while (RTLSDR_INACTIVE != dev->async_status) {
+-#ifdef HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED
+- r = libusb_handle_events_timeout_completed(dev->ctx, &tv, &dev->async_cancel);
+-#else
+- r = libusb_handle_events_timeout(dev->ctx, &tv);
+-#endif
++ r = libusb_handle_events_timeout_completed(dev->ctx, &tv,
++ &dev->async_cancel);
+ if (r < 0) {
+ /*fprintf(stderr, "handle_events returned: %d\n", r);*/
+ if (r == LIBUSB_ERROR_INTERRUPTED) /* stray signal */
+@@ -1801,6 +1804,11 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev,
+ if (LIBUSB_TRANSFER_CANCELLED !=
+ dev->xfer[i]->status) {
+ r = libusb_cancel_transfer(dev->xfer[i]);
++ /* handle events after canceling
++ * to allow transfer status to
++ * propagate */
++ libusb_handle_events_timeout_completed(dev->ctx,
++ &zerotv, NULL);
+ if (r < 0)
+ continue;
+
+@@ -1812,11 +1820,8 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev,
+ /* handle any events that still need to
+ * be handled before exiting after we
+ * just cancelled all transfers */
+-#ifdef HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED
+- libusb_handle_events_timeout_completed(dev->ctx, &zerotv, NULL);
+-#else
+- libusb_handle_events_timeout(dev->ctx, &zerotv);
+-#endif
++ libusb_handle_events_timeout_completed(dev->ctx,
++ &zerotv, NULL);
+ break;
+ }
+ }
diff --git a/ham/rtl-sdr/patches/patch-src_tuner__r82xx.c b/ham/rtl-sdr/patches/patch-src_tuner__r82xx.c
new file mode 100644
index 00000000000..8e28fa36342
--- /dev/null
+++ b/ham/rtl-sdr/patches/patch-src_tuner__r82xx.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tuner__r82xx.c,v 1.1 2016/01/26 09:10:39 dbj Exp $
+
+--- src/tuner_r82xx.c.orig 2014-02-07 01:04:24.000000000 +0000
++++ src/tuner_r82xx.c
+@@ -547,7 +547,7 @@ static int r82xx_set_pll(struct r82xx_pr
+ }
+
+ if (!(data[2] & 0x40)) {
+- printf("[R82XX] PLL not locked!\n");
++ fprintf(stderr, "[R82XX] PLL not locked!\n");
+ priv->has_lock = 0;
+ return 0;
+ }