Ticket #48451: gr-osmosdr_sdrplay_1.95.1.diff

File gr-osmosdr_sdrplay_1.95.1.diff, 2.4 KB (added by k_a_i@…, 8 years ago)
  • Portfile

     
    220220    configure.args-append -DENABLE_AIRSPY=OFF
    221221
    222222}
     223
     224variant sdrplay description "Install ${name} with support for sdrplay (nonfree mode)" {
     225
     226    global sdrplay_lib
     227    set sdrplay_lib "libmirsdrapi-rsp.dylib"
     228    global SDRplay_Distfile
     229    set SDRplay_Distfile "SDRplay_RSP_API_Installer_1.95.1.pkg"
     230
     231    distfiles-append ${SDRplay_Distfile}
     232
     233    master_sites-append http://www.sdrplay.com/software/
     234
     235    checksums-append \
     236        ${SDRplay_Distfile} \
     237        rmd160 cb043edbabd05f056f835db8f0e2e57d7ce27719 \
     238        sha256 0762b913c637eb5d46afd0b44528069ee46b6716becba2aa108e7161453ffd7b
     239
     240    extract.only ${distname}.tar.gz
     241
     242    post-extract {
     243
     244        # extract the PKGs we need here
     245        global SDRplay_Distfile
     246        system -W ${worksrcpath} "pkgutil --expand ${distpath}/${SDRplay_Distfile} pkg"
     247        system -W ${worksrcpath} "mkdir sdrplay"
     248        system -W ${worksrcpath}/sdrplay "mv ../pkg/libmirsdrapi*.pkg/Payload tmp0.tar.gz && /usr/bin/gzip -dc tmp0.tar.gz | /usr/bin/tar -xf -"
     249        system -W ${worksrcpath}/sdrplay "mv ../pkg/mirsdrapirsp.pkg/Payload tmp2.tar.gz && /usr/bin/gzip -dc tmp2.tar.gz | /usr/bin/tar -xf -"
     250
     251    }
     252
     253    post-patch {
     254
     255        # fix SDRPlay library to work with MacPorts
     256        global sdrplay_lib
     257        system -W ${worksrcpath}/sdrplay "mv libmirsdrapi-rsp* ${sdrplay_lib}"
     258        system -W ${worksrcpath}/sdrplay "install_name_tool -id ${prefix}/lib/libmirsdrapi-rsp.dylib ${sdrplay_lib}"
     259        system -W ${worksrcpath}/sdrplay "install_name_tool -change /usr/local/lib/libusb-1.0.0.dylib ${prefix}/lib/libusb-1.0.0.dylib ${sdrplay_lib}"
     260
     261    }
     262
     263    # configure gr-osmosdr to look for the local sdrplay
     264    configure.args-append \
     265        -DENABLE_NONFREE=ON \
     266        -DLIBSDRPLAY_FOUND=TRUE \
     267        -DLIBSDRPLAY_INCLUDE_DIRS=${worksrcpath}/sdrplay \
     268        -DLIBSDRPLAY_LIBRARIES=${worksrcpath}/sdrplay/${sdrplay_lib}
     269
     270    post-destroot {
     271
     272        # install sdrplay
     273        global sdrplay_lib
     274        set sdrplay_dir "${worksrcpath}/sdrplay"
     275        copy ${sdrplay_dir}/${sdrplay_lib} ${destroot}${prefix}/lib
     276        copy ${sdrplay_dir}/mirsdrapi-rsp.h ${destroot}${prefix}/include
     277
     278    }
     279}
     280
     281if {![variant_isset airspy]} {
     282
     283    configure.args-append -DENABLE_NONFREE=OFF
     284
     285}