[103082] trunk/dports/science
michaelld at macports.org
michaelld at macports.org
Wed Feb 13 07:43:48 PST 2013
Revision: 103082
https://trac.macports.org/changeset/103082
Author: michaelld at macports.org
Date: 2013-02-13 07:43:47 -0800 (Wed, 13 Feb 2013)
Log Message:
-----------
gr-osmosdr : initial checkin; addresses ticket #38031.
Added Paths:
-----------
trunk/dports/science/gr-osmosdr/
trunk/dports/science/gr-osmosdr/Portfile
trunk/dports/science/gr-osmosdr/files/
trunk/dports/science/gr-osmosdr/files/patch-cmake_Modules_GrPython.cmake.diff
Added: trunk/dports/science/gr-osmosdr/Portfile
===================================================================
--- trunk/dports/science/gr-osmosdr/Portfile (rev 0)
+++ trunk/dports/science/gr-osmosdr/Portfile 2013-02-13 15:43:47 UTC (rev 103082)
@@ -0,0 +1,179 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# $Id: Portfile 103081 2013-02-13 14:01:16Z michaelld at macports.org $
+
+PortSystem 1.0
+PortGroup cmake 1.0
+PortGroup active_variants 1.1
+
+name gr-osmosdr
+maintainers michaelld openmaintainer
+
+description gr-osmosdr provides support for OsmoSDR hardware within GNU Radio
+
+categories science
+homepage http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
+license GPL-3
+platforms darwin macosx
+
+long_description ${description}: \
+ Support includes GNU Radio source and sink blocks in C++, Python, and GNU Radio Companion (grc). This port also offers a wrapper functionality for the FunCube Dongle, Ettus UHD, andrtl-sdr radios. By using gr-osmosdr source you can take advantage of a common software api in your applications independent of the underlying radio hardware.
+
+version 20130210
+
+fetch.type git
+git.url git://git.osmocom.org/gr-osmosdr
+git.branch d11b7a2614d8292168746050b9d197fba8981515
+
+livecheck.type none
+
+depends_lib-append port:gnuradio \
+ port:rtl-sdr
+
+# allow us to specify the Python install directory using GR_PYTHON_DIR
+
+patchfiles patch-cmake_Modules_GrPython.cmake.diff
+
+# do VPATH build
+
+pre-configure { file mkdir ${workpath}/build }
+configure.dir ${workpath}/build
+build.dir ${workpath}/build
+
+# set last configure argument to the reletive path
+# to the top-level cmake source
+
+configure.post_args ../${worksrcdir}
+
+# be verbose when building, for debugging purposes
+
+build.post_args VERBOSE=1
+
+# set Python variants
+
+set pythons_suffixes {26 27}
+global chosen_python_suffix
+set chosen_python_suffix ""
+
+set pythons_ports {}
+foreach s ${pythons_suffixes} {
+ lappend pythons_ports python${s}
+}
+
+foreach s ${pythons_suffixes} {
+ set p python${s}
+ set v [join [split ${s} ""] "."]
+ set i [lsearch -exact ${pythons_ports} ${p}]
+ set c [lreplace ${pythons_ports} ${i} ${i}]
+ eval [subst {
+ variant ${p} description "Build GNU Radio using Python ${v}" \
+ conflicts ${c} {
+
+ set chosen_python_suffix ${s}
+
+ # require gnuradio to also have this variant
+
+ require_active_variants gnuradio ${p}
+
+ # specify the Python dependencies
+
+ depends_lib-append \
+ port:${p}
+
+ # specify the Python version to use
+
+ configure.args-append \
+ -DPYTHON_EXECUTABLE=${prefix}/bin/python${v} \
+ -DPYTHON_INCLUDE_DIR=${prefix}/Library/Frameworks/Python.framework/Versions/${v}/Headers \
+ -DPYTHON_LIBRARY=${prefix}/Library/Frameworks/Python.framework/Versions/${v}/Python \
+ -DGR_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v}/site-packages
+
+ }
+ }]
+}
+
+# Python is required; default to 2.7
+
+if {![variant_isset python26] && ![variant_isset python27]} {
+ default_variants +python27
+}
+
+# Make sure -python27 was not specified alone
+
+if {![variant_isset python26] && ![variant_isset python27]} {
+ ui_error "${name} requires a Python to be selected; you cannot use -python27 as a variant alone."
+ return -code error "Invalid variant selection"
+}
+
+# shortcut to installing all variants except Python
+
+variant full requires docs uhd swig \
+ description {Enable all variants except python} {}
+
+variant docs description "Install ${name} documentation" {
+
+ depends_lib-append \
+ port:doxygen
+
+ configure.args-append \
+ -DDOXYGEN_DOT_EXECUTABLE=/opt/local/bin/dot \
+ -DDOXYGEN_EXECUTABLE=/opt/local/bin/doxygen
+
+}
+
+if {![variant_isset docs]} {
+
+ configure.args-append \
+ -DDOXYGEN_DOT_EXECUTABLE= \
+ -DDOXYGEN_EXECUTABLE=
+
+}
+
+variant uhd description "Install ${name} with support for UHD" {
+
+ depends_lib-append \
+ path:lib/libuhd.dylib:uhd
+
+ # require gnuradio to also have this variant
+
+ require_active_variants gnuradio uhd
+
+ configure.args-append \
+ -DENABLE_UHD=ON \
+ -DGNURADIO_UHD_INCLUDE_DIRS=${prefix}/include \
+ -DGNURADIO_UHD_LIBRARIES=${prefix}/lib/libgnuradio-uhd.dylib \
+ -DUHD_INCLUDE_DIRS=${prefix}/include/uhd \
+ -DUHD_LIBRARIES=${prefix}/lib/libuhd.dylib
+
+}
+
+if {![variant_isset uhd]} {
+
+ configure.args-append \
+ -DENABLE_UHD=OFF \
+ -DGNURADIO_UHD_INCLUDE_DIRS= \
+ -DGNURADIO_UHD_LIBRARIES= \
+ -DUHD_INCLUDE_DIRS= \
+ -DUHD_LIBRARIES=
+
+}
+
+variant swig description "Install ${name} with support for SWIG-base Python bindings" {
+
+ depends_lib-append \
+ port:swig-python
+
+ # require gnuradio to also have this variant
+
+ require_active_variants gnuradio swig
+
+ configure.args-append \
+ -DSWIG_EXECUTABLE=${prefix}/bin/swig
+
+}
+
+if {![variant_isset swig]} {
+
+ configure.args-append \
+ -DSWIG_EXECUTABLE=
+
+}
Added: trunk/dports/science/gr-osmosdr/files/patch-cmake_Modules_GrPython.cmake.diff
===================================================================
--- trunk/dports/science/gr-osmosdr/files/patch-cmake_Modules_GrPython.cmake.diff (rev 0)
+++ trunk/dports/science/gr-osmosdr/files/patch-cmake_Modules_GrPython.cmake.diff 2013-02-13 15:43:47 UTC (rev 103082)
@@ -0,0 +1,16 @@
+--- cmake/Modules/GrPython.cmake.orig 2013-02-13 10:11:12.000000000 -0500
++++ cmake/Modules/GrPython.cmake 2013-02-13 10:12:32.000000000 -0500
+@@ -95,11 +95,13 @@
+ ########################################################################
+ # Sets the python installation directory GR_PYTHON_DIR
+ ########################################################################
++if(NOT DEFINED GR_PYTHON_DIR)
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
+ from distutils import sysconfig
+ print sysconfig.get_python_lib(plat_specific=True, prefix='')
+ " OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
++endif()
+ file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
+
+ ########################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130213/bf8911ba/attachment.html>
More information about the macports-changes
mailing list