| 273 | |
| 274 | variant sdrplay description "Install ${name} with support for sdrplay (nonfree mode)" { |
| 275 | |
| 276 | configure.args-append \ |
| 277 | -DENABLE_NONFREE=ON \ |
| 278 | -DLIBSDRPLAY_FOUND=TRUE \ |
| 279 | -DLIBSDRPLAY_INCLUDE_DIRS=${worksrcpath}/sdrplay \ |
| 280 | -DLIBSDRPLAY_LIBRARIES=${worksrcpath}/sdrplay/libmir_sdr.dylib |
| 281 | |
| 282 | distfiles ${name}-${commit}.tar.gz \ |
| 283 | mir_sdr_api_MacOSX_1.7.tar.gz |
| 284 | master_sites http://cgit.osmocom.org/gr-osmosdr/snapshot/ \ |
| 285 | http://sdrplay.com/software/ |
| 286 | |
| 287 | checksums ${name}-${commit}.tar.gz \ |
| 288 | rmd160 091892afe750b4c831a0f298c55ab929da810735 \ |
| 289 | sha256 6218357466877d572590a5bb93e99095f21866a6c0790aa46e14f1092716e639 \ |
| 290 | mir_sdr_api_MacOSX_1.7.tar.gz \ |
| 291 | rmd160 ad587c3e6591dbf0c21d658289dc468800f91084 \ |
| 292 | sha256 2ba5bec8a1ae749224d180a0e3488325a85a3d2621407c016383346a8be0b8ef |
| 293 | |
| 294 | post-patch { |
| 295 | |
| 296 | # fix SDRPlay library to work with MacPorts |
| 297 | |
| 298 | set sdrplay_dir "mir_sdr_api_MacOSX_1.7" |
| 299 | set sdrplay_lib "${worksrcpath}/sdrplay/libmir_sdr.dylib" |
| 300 | |
| 301 | move ${worksrcpath}/../${sdrplay_dir} ${worksrcpath}/sdrplay |
| 302 | move ${worksrcpath}/sdrplay/libmir_sdr.so ${sdrplay_lib} |
| 303 | system "install_name_tool -id ${prefix}/lib/libmir_sdr.dylib ${sdrplay_lib}" |
| 304 | system "install_name_tool -change /usr/local/lib/libusb-1.0.0.dylib ${prefix}/lib/libusb-1.0.0.dylib ${sdrplay_lib}" |
| 305 | |
| 306 | # fix header name to be correct |
| 307 | |
| 308 | reinplace "s@mirsdrapi-rsp\.h@mir_sdr.h@" ${worksrcpath}/lib/sdrplay/sdrplay_source_c.cc |
| 309 | |
| 310 | } |
| 311 | |
| 312 | post-destroot { |
| 313 | |
| 314 | # install sdrplay |
| 315 | set sdrplay_dir "${worksrcpath}/sdrplay" |
| 316 | copy ${sdrplay_dir}/libmir_sdr.dylib ${destroot}${prefix}/lib |
| 317 | copy ${sdrplay_dir}/mir_sdr.h ${destroot}${prefix}/include |
| 318 | |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | if {![variant_isset airspy]} { |
| 323 | |
| 324 | configure.args-append -DENABLE_NONFREE=OFF |
| 325 | |
| 326 | } |