From 217e0263f551f0b4abac04127df4f941702653b5 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 19 Jun 2018 07:28:42 +0000 Subject: New port: misc/py-SoapySDR: Vendor and platform neutral SDR support library (python binding) --- misc/Makefile | 1 + misc/py-SoapySDR/Makefile | 36 ++++++++++++++++++++++ misc/py-SoapySDR/distinfo | 3 ++ misc/py-SoapySDR/files/patch-CMakeLists.txt | 26 ++++++++++++++++ .../py-SoapySDR/files/patch-python3_CMakeLists.txt | 11 +++++++ .../files/patch-python3_FindPython3Interp.cmake | 20 ++++++++++++ .../files/patch-python3_FindPython3Libs.cmake | 11 +++++++ misc/py-SoapySDR/files/patch-python_CMakeLists.txt | 11 +++++++ misc/py-SoapySDR/pkg-descr | 4 +++ 9 files changed, 123 insertions(+) create mode 100644 misc/py-SoapySDR/Makefile create mode 100644 misc/py-SoapySDR/distinfo create mode 100644 misc/py-SoapySDR/files/patch-CMakeLists.txt create mode 100644 misc/py-SoapySDR/files/patch-python3_CMakeLists.txt create mode 100644 misc/py-SoapySDR/files/patch-python3_FindPython3Interp.cmake create mode 100644 misc/py-SoapySDR/files/patch-python3_FindPython3Libs.cmake create mode 100644 misc/py-SoapySDR/files/patch-python_CMakeLists.txt create mode 100644 misc/py-SoapySDR/pkg-descr diff --git a/misc/Makefile b/misc/Makefile index a7197c854e96..1ba5bc3a75b2 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -402,6 +402,7 @@ SUBDIR += pubs SUBDIR += py-PyUserInput SUBDIR += py-SimpleSoapy + SUBDIR += py-SoapySDR SUBDIR += py-YABT SUBDIR += py-cinder SUBDIR += py-colorbrewer diff --git a/misc/py-SoapySDR/Makefile b/misc/py-SoapySDR/Makefile new file mode 100644 index 000000000000..2854595c075d --- /dev/null +++ b/misc/py-SoapySDR/Makefile @@ -0,0 +1,36 @@ +# $FreeBSD$ + +PORTNAME= SoapySDR +DISTVERSIONPREFIX= soapy-sdr- +DISTVERSION= 0.6.1-71 +DISTVERSIONSUFFIX= -g69c16e9 +CATEGORIES= misc python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Vendor and platform neutral SDR support library (python binding) + +LICENSE= BSL +LICENSE_FILE= ${WRKSRC}/LICENSE_1_0.txt + +BROKEN_FreeBSD_10= error: redefinition of 'swig::traits' + +BUILD_DEPENDS= swig3.0:devel/swig30 +LIB_DEPENDS= libSoapySDR.so:misc/soapysdr + +USES= cmake:outsource python +USE_GITHUB= yes +GH_ACCOUNT= pothosware +USE_PYTHON= flavors + +CMAKE_ARGS= -DFREEBSD_PYTHON_VERSION:INTEGER=${PYTHON_VER:S/.//} \ + -DFREEBSD_PYTHON_VER2:STRING=${PYTHON_VER} +CMAKE_OFF= ENABLE_DOCS + +PLIST_FILES= ${PYTHON_SITELIBDIR}/SoapySDR.py \ + ${PYTHON_SITELIBDIR}/_SoapySDR.so + +post-install: # Until fixed, just delete libs: https://github.com/pothosware/SoapySDR/issues/169 + @cd ${STAGEDIR}${PREFIX} && ${RM} -r bin include lib/lib* libdata share + +.include diff --git a/misc/py-SoapySDR/distinfo b/misc/py-SoapySDR/distinfo new file mode 100644 index 000000000000..4b890de9045e --- /dev/null +++ b/misc/py-SoapySDR/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1529384177 +SHA256 (pothosware-SoapySDR-soapy-sdr-0.6.1-71-g69c16e9_GH0.tar.gz) = 308ea401054eb52bcce828012393fe143174f7b25d0e04ce189c00713645e1b5 +SIZE (pothosware-SoapySDR-soapy-sdr-0.6.1-71-g69c16e9_GH0.tar.gz) = 119259 diff --git a/misc/py-SoapySDR/files/patch-CMakeLists.txt b/misc/py-SoapySDR/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..305394f6268c --- /dev/null +++ b/misc/py-SoapySDR/files/patch-CMakeLists.txt @@ -0,0 +1,26 @@ +--- CMakeLists.txt.orig 2018-06-19 06:16:03 UTC ++++ CMakeLists.txt +@@ -121,19 +121,23 @@ add_subdirectory(docs) + ######################################################################## + # Python support (optional) + ######################################################################## ++if (${FREEBSD_PYTHON_VERSION} LESS 30) + message(STATUS "") + message(STATUS "#############################################") + message(STATUS "## Begin configuration for Python support...") + message(STATUS "#############################################") + message(STATUS "Enabling optional Python bindings if possible...") + add_subdirectory(python) ++endif() + ++if (${FREEBSD_PYTHON_VERSION} GREATER_EQUAL 30) + message(STATUS "") + message(STATUS "#############################################") + message(STATUS "## Begin configuration for Python3 support...") + message(STATUS "#############################################") + message(STATUS "Enabling optional Python3 bindings if possible...") + add_subdirectory(python3) ++endif() + + + ######################################################################## diff --git a/misc/py-SoapySDR/files/patch-python3_CMakeLists.txt b/misc/py-SoapySDR/files/patch-python3_CMakeLists.txt new file mode 100644 index 000000000000..dc588167b1b1 --- /dev/null +++ b/misc/py-SoapySDR/files/patch-python3_CMakeLists.txt @@ -0,0 +1,11 @@ +--- python3/CMakeLists.txt.orig 2018-05-13 06:02:48 UTC ++++ python3/CMakeLists.txt +@@ -55,7 +55,7 @@ endif() + ######################################################################## + include(FeatureSummary) + include(CMakeDependentOption) +-cmake_dependent_option(ENABLE_PYTHON3 "Enable python bindings" ON "ENABLE_LIBRARY;SWIG_FOUND;PYTHON3INTERP_FOUND;PYTHON3LIBS_FOUND;PYTHON3_DEBUG_OK;BUILD_PYTHON3" OFF) ++option(ENABLE_PYTHON3 "Enable python bindings" ON) + add_feature_info(Python3 ENABLE_PYTHON3 "python3 bindings") + if (NOT ENABLE_PYTHON3) + return() diff --git a/misc/py-SoapySDR/files/patch-python3_FindPython3Interp.cmake b/misc/py-SoapySDR/files/patch-python3_FindPython3Interp.cmake new file mode 100644 index 000000000000..6e65faa6b7f9 --- /dev/null +++ b/misc/py-SoapySDR/files/patch-python3_FindPython3Interp.cmake @@ -0,0 +1,20 @@ +--- python3/FindPython3Interp.cmake.orig 2018-06-19 06:38:27 UTC ++++ python3/FindPython3Interp.cmake +@@ -39,7 +39,7 @@ + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + FIND_PROGRAM(PYTHON3_EXECUTABLE +- NAMES python3.2mu python3.2m python3.2u python3.2 python3.1 python3.0 python3 ++ NAMES python${FREEBSD_PYTHON_VER2} + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath] +@@ -47,7 +47,7 @@ FIND_PROGRAM(PYTHON3_EXECUTABLE + ) + + FIND_PROGRAM(PYTHON3_DBG_EXECUTABLE +- NAMES python3.2dmu python3.2dm python3.2du python3.2d python3.1-dbg python3.0-dbg python3-dbg ++ NAMES python${FREEBSD_PYTHON_VER2}-dbg + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath] diff --git a/misc/py-SoapySDR/files/patch-python3_FindPython3Libs.cmake b/misc/py-SoapySDR/files/patch-python3_FindPython3Libs.cmake new file mode 100644 index 000000000000..ba851c87ee19 --- /dev/null +++ b/misc/py-SoapySDR/files/patch-python3_FindPython3Libs.cmake @@ -0,0 +1,11 @@ +--- python3/FindPython3Libs.cmake.orig 2018-06-19 06:36:21 UTC ++++ python3/FindPython3Libs.cmake +@@ -46,7 +46,7 @@ INCLUDE(CMakeFindFrameworks) + # Search for the python framework on Apple. + # CMAKE_FIND_FRAMEWORKS(Python) + +-FOREACH(_CURRENT_VERSION 3.5 3.4 3.3 3.2 3.1 3.0) ++FOREACH(_CURRENT_VERSION ${FREEBSD_PYTHON_VER2}) + IF(_CURRENT_VERSION GREATER 3.1) + SET(_32FLAGS "m" "u" "mu" "dm" "du" "dmu" "") + ELSE() diff --git a/misc/py-SoapySDR/files/patch-python_CMakeLists.txt b/misc/py-SoapySDR/files/patch-python_CMakeLists.txt new file mode 100644 index 000000000000..35a6c4b92fb4 --- /dev/null +++ b/misc/py-SoapySDR/files/patch-python_CMakeLists.txt @@ -0,0 +1,11 @@ +--- python/CMakeLists.txt.orig 2018-06-19 07:11:01 UTC ++++ python/CMakeLists.txt +@@ -121,7 +121,7 @@ set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} + ######################################################################## + include(FeatureSummary) + include(CMakeDependentOption) +-cmake_dependent_option(ENABLE_PYTHON "Enable python bindings" ON "ENABLE_LIBRARY;SWIG_FOUND;PYTHONINTERP_FOUND;PYTHONLIBS_FOUND;PYTHON_DEBUG_OK;PYTHON_VERSION_MATCH" OFF) ++option(ENABLE_PYTHON "Enable python bindings" ON) + add_feature_info(Python ENABLE_PYTHON "python bindings v${PYTHON_VERSION_STRING}") + if (NOT ENABLE_PYTHON) + return() diff --git a/misc/py-SoapySDR/pkg-descr b/misc/py-SoapySDR/pkg-descr new file mode 100644 index 000000000000..a9e0691c6ec8 --- /dev/null +++ b/misc/py-SoapySDR/pkg-descr @@ -0,0 +1,4 @@ +Python binding of SoapySDR, an open-source generalized C/C++ API and runtime +library for interfacing with SDR devices. + +WWW: https://github.com/pothosware/SoapySDR -- cgit