diff --git a/comms/gnuradio/Makefile b/comms/gnuradio/Makefile index 95c946d062b5..314148e6f64a 100644 --- a/comms/gnuradio/Makefile +++ b/comms/gnuradio/Makefile @@ -1,115 +1,115 @@ PORTNAME= gnuradio DISTVERSIONPREFIX= v DISTVERSION= 3.8.4.0 -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= comms astro hamradio MAINTAINER= hamradio@FreeBSD.org COMMENT= Amateur Radio Software defined radio WWW= https://www.gnuradio.org/ LICENSE= GPLv3 BUILD_DEPENDS= volk>0:devel/volk \ doxygen>0:devel/doxygen \ ${PYTHON_PKGNAMEPREFIX}sphinx>=1.2.2,1:textproc/py-sphinx@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml@${PY_FLAVOR} \ ${PYNUMPY} \ ${PYTHON_SITELIBDIR}/mako/__init__.py:textproc/py-mako@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/yaml/__init__.py:devel/py-yaml@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/gi/__init__.py:devel/py-gobject3@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/cairo/__init__.py:graphics/py-cairo@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/six.py:devel/py-six@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/click/__init__.py:devel/py-click@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/click_plugins/__init__.py:devel/py-click-plugins@${PY_FLAVOR} \ aconnect:audio/alsa-utils \ cheetah:devel/py-cheetah3@${PY_FLAVOR} \ cppzmq>0:net/cppzmq \ minixmlto:textproc/minixmlto \ sdl-config:devel/sdl12 \ swig:devel/swig \ mpir>0:math/mpir \ xdg-open:devel/xdg-utils LIB_DEPENDS= libcodec2.so:audio/codec2 \ libfftw3.so:math/fftw3 \ libfftw3f.so:math/fftw3-float \ libgmpxx.so:math/gmp \ libqwt6.so:x11-toolkits/qwt6 \ ${PY_BOOST} \ liblog4cpp.so:devel/log4cpp \ libportaudio.so:audio/portaudio \ libjack.so:audio/jack \ libasound.so:audio/alsa-lib \ libgsl.so:math/gsl \ libgsm.so:audio/gsm \ libboost_date_time.so:devel/boost-libs \ liborc-0.4.so:devel/orc \ libzmq.so:net/libzmq4 RUN_DEPENDS:= ${BUILD_DEPENDS} USES= cmake compiler:c++11-lang desktop-file-utils fortran gnome \ iconv perl5 pkgconfig pyqt:5 python qt:5 shared-mime-info \ shebangfix SHEBANG_FILES= grc/scripts/freedesktop/grc_setup_freedesktop.in \ gnuradio-runtime/python/gnuradio/ctrlport/gr-ctrlport-monitor \ gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx CMAKE_ARGS+= -DCMAKE_INSTALL_RPATH:STRING="${LOCALBASE}/lib/gcc${_GCC_VER}" \ -DENABLE_GR_CTRLPORT="YES" \ -DICONV_LIB:STRING="X${ICONV_LIB}" \ -DICONV_PREFIX:STRING="${ICONV_PREFIX}" \ -DLOCALBASE:STRING="${LOCALBASE}" \ -DGR_PKG_DOC_DIR:STRING="${DOCSDIR}" \ -DPYTHON_EXECUTABLE:STRING="${PYTHON_CMD}" \ -DSWIG_EXECUTABLE:STRING="${LOCALBASE}/bin/swig"\ -DXMLTO_EXECUTABLE:STRING=minixmlto \ -DENABLE_INTERNAL_VOLK:STRING="OFF" # for detailed debugging uncomment the next line #CMAKE_ARGS+= --debug-output --trace USE_CXXSTD= c++11 USE_GITHUB= yes USE_PYQT= pyqt5 USE_WX= 3.2 USE_QT= buildtools core gui xml qmake widgets WX_COMPS= wx python:run USE_LDCONFIG= yes LIBSTRIP_FILES= analog audio blocks channels digital dtv fec fft\ filter pmt qtgui runtime trellis video-sdl\ vocoder wavelet OPTIONS_DEFINE= DOCS UHD TESTING DOXYGEN OPTIONS_EXCLUDE= DOXYGEN OPTIONS_SUB= yes UHD_DESC= Include UHD support from Ettus TESTING_DESC= Include testing support PLIST_SUB+= PORTVERSION=${PORTVERSION} PORTMAINVER=${PORTVERSION:C|^([1-9]+)\.([0-9]+)\.([0-9]+).*|\1.\2.\3|} DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen \ ${PYTHON_PKGNAMEPREFIX}sphinx>=1.2.2,1:textproc/py-sphinx@${PY_FLAVOR} \ dot:graphics/graphviz \ xmlto:textproc/xmlto \ freefont-ttf>0:x11-fonts/freefont-ttf DOXYGEN_CMAKE_ON= -DENABLE_DOXYGEN:STRING="ON" \ -DENABLE_DOCS:STRING="ON" DOXYGEN_CMAKE_OFF= -DENABLE_DOXYGEN:STRING="OFF" \ -DENABLE_DOCS:STRING="OFF" UHD_CMAKE_ON= -DENABLE_GR_UHD:STRING="ON" UHD_CMAKE_OFF= -DENABLE_GR_UHD:STRING="OFF" TESTING_CMAKE_ON= -DENABLE_TESTING:STRING="ON" TESTING_CMAKE_OFF= -DENABLE_TESTING:STRING="OFF" .include .if ${PORT_OPTIONS:MUHD} LIBSTRIP_FILES+= uhd LIB_DEPENDS+= libuhd.so:comms/uhd PLIST_SUB+= UHD="" .else PLIST_SUB+= UHD="@comment " .endif .include diff --git a/comms/gnuradio/files/patch-gnuradio-runtime-lib-vmcircbuf_mmap_shm_open.cc b/comms/gnuradio/files/patch-gnuradio-runtime-lib-vmcircbuf_mmap_shm_open.cc new file mode 100644 index 000000000000..efec2bb34ad1 --- /dev/null +++ b/comms/gnuradio/files/patch-gnuradio-runtime-lib-vmcircbuf_mmap_shm_open.cc @@ -0,0 +1,28 @@ +Use MAP_FIXED flag to ensure buffer halves are contiguous + +(backport of ca44241) + +--- gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc.orig 2021-09-30 14:10:55 UTC ++++ gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc +@@ -122,19 +122,11 @@ vmcircbuf_mmap_shm_open::vmcircbuf_mmap_shm_open(int s + throw std::runtime_error("gr::vmcircbuf_mmap_shm_open"); + } + +- // unmap the 2nd half +- if (munmap((char*)first_copy + size, size) == -1) { +- close(shm_fd); // cleanup +- perror("gr::vmcircbuf_mmap_shm_open: munmap (1)"); +- throw std::runtime_error("gr::vmcircbuf_mmap_shm_open"); +- } +- +- // map the first half into the now available hole where the +- // second half used to be. ++ // map the first half into the second half of the address space. + void* second_copy = mmap((char*)first_copy + size, + size, + PROT_READ | PROT_WRITE, +- MAP_SHARED, ++ MAP_SHARED | MAP_FIXED, + shm_fd, + (off_t)0); + diff --git a/comms/gnuradio/files/patch-gnuradio-runtime-lib-vmcircbuf_mmap_tmpfile.cc b/comms/gnuradio/files/patch-gnuradio-runtime-lib-vmcircbuf_mmap_tmpfile.cc new file mode 100644 index 000000000000..a3bb6811815c --- /dev/null +++ b/comms/gnuradio/files/patch-gnuradio-runtime-lib-vmcircbuf_mmap_tmpfile.cc @@ -0,0 +1,44 @@ +Use MAP_FIXED flag to ensure buffer halves are contiguous + +(backport of ca44241) + +--- gnuradio-runtime/lib/vmcircbuf_mmap_tmpfile.cc.orig 2021-09-30 14:10:55 UTC ++++ gnuradio-runtime/lib/vmcircbuf_mmap_tmpfile.cc +@@ -107,19 +107,11 @@ vmcircbuf_mmap_tmpfile::vmcircbuf_mmap_tmpfile(int siz + throw std::runtime_error("gr::vmcircbuf_mmap_tmpfile"); + } + +- // unmap the 2nd half +- if (munmap((char*)first_copy + size, size) == -1) { +- close(seg_fd); // cleanup +- perror("gr::vmcircbuf_mmap_tmpfile: munmap (1)"); +- throw std::runtime_error("gr::vmcircbuf_mmap_tmpfile"); +- } +- +- // map the first half into the now available hole where the +- // second half used to be. ++ // map the first half into the second half of the address space. + void* second_copy = mmap((char*)first_copy + size, + size, + PROT_READ | PROT_WRITE, +- MAP_SHARED, ++ MAP_SHARED | MAP_FIXED, + seg_fd, + (off_t)0); + +@@ -127,15 +119,6 @@ vmcircbuf_mmap_tmpfile::vmcircbuf_mmap_tmpfile(int siz + munmap(first_copy, size); // cleanup + close(seg_fd); + perror("gr::vmcircbuf_mmap_tmpfile: mmap(2)"); +- throw std::runtime_error("gr::vmcircbuf_mmap_tmpfile"); +- } +- +- // check for contiguity +- if ((char*)second_copy != (char*)first_copy + size) { +- munmap(first_copy, size); // cleanup +- munmap(second_copy, size); +- close(seg_fd); +- perror("gr::vmcircbuf_mmap_tmpfile: non-contiguous second copy"); + throw std::runtime_error("gr::vmcircbuf_mmap_tmpfile"); + } +