Ticket #48451: gr-osmosdr_sdrplay.diff

File gr-osmosdr_sdrplay.diff, 2.1 KB (added by michaelld (Michael Dickens), 9 years ago)
  • Portfile

     
    270270    configure.args-append -DENABLE_AIRSPY=OFF
    271271
    272272}
     273
     274variant 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.2.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.2.tar.gz \
     291        rmd160 de63d9c3fc231629196864e4b3264b18572f6072 \
     292        sha256 e6949c5b5640a2f3c0133e283b55651a5a09e911313aabd3c414c658062fcc5c
     293
     294    post-patch {
     295
     296        # fix SDRPlay library to work with MacPorts
     297
     298        set sdrplay_dir "2015_03_29_mac"
     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
     322if {![variant_isset airspy]} {
     323
     324    configure.args-append -DENABLE_NONFREE=OFF
     325
     326}