Ticket #51516: mp-libcurl.diff

File mp-libcurl.diff, 2.7 KB (added by RJVB (René Bertin), 4 weeks ago)

adds a MacPorts-libcurl subport to port:curl

  • net/curl/Portfile

    diff --git a/net/curl/Portfile b/net/curl/Portfile
    index 3fffa4eae19c80091d037b9c3511d42541d945ed..c881a330d6b67cfd768cc099387b1168d15ac377 100644
    a b set curl_distfile ${distfiles} 
    3232distfiles                       ${curl_distfile}:curl
    3333checksums-prepend               ${curl_distfile}
    3434
    35 if {${name} eq ${subport}} {
     35subport MacPorts-libcurl {
     36    description                 libcurl built for use by MacPorts itself
     37    long_description            {*}${description}
     38}
     39
     40if {${name} eq ${subport} || ${subport} eq "MacPorts-libcurl"} {
    3641    PortGroup                   muniversal 1.0
    3742    PortGroup                   LTO 1.0
    3843    PortGroup                   save_configure_cmd 1.0
    if {${name} eq ${subport}} { 
    118123    global merger_dont_diff
    119124    set merger_dont_diff "${prefix}/include/curl/curlbuild.h"
    120125
     126    ###
     127    ### NB no code that should not apply to port:MacPorts-libcurl above this line
     128    ###
     129    if {${subport} eq "MacPorts-libcurl"} {
     130        PortGroup               conflicts_build 1.0
     131        depends_lib-append      port:libressl-co \
     132                                path:share/curl/curl-ca-bundle.crt:curl-ca-bundle
     133        configure.args-delete   --without-ssl
     134        configure.args-replace  --without-openssl --with-openssl
     135        configure.args-append   --with-ca-bundle=${prefix}/share/curl/curl-ca-bundle.crt
     136
     137        configure.pkg_config_path-prepend \
     138                                ${prefix}/libexec/libressl/lib/pkgconfig
     139        depends_build-delete    port:pkgconfig
     140        depends_build-append    port:pkgconfig \
     141                                port:cctools
     142        conflicts_build         openssl-dev
     143        set thePrefix           ${prefix}/libexec/macports/lib/pextlib1.0
     144        configure.pre_args      --prefix=${thePrefix}
     145        destroot {
     146            xinstall -m 755 -d ${destroot}${thePrefix}
     147            if {${os.platform} eq "darwin"} {
     148                xinstall -m 755 ${worksrcpath}/lib/.libs/libcurl.4.dylib \
     149                                ${destroot}${thePrefix}/libcurl-mp.dylib
     150                system -W ${destroot} "install_name_tool -id ${thePrefix}/libcurl-mp.dylib ${thePrefix}/libcurl-mp.dylib"
     151            } else {
     152                xinstall -m 755 ${worksrcpath}/lib/.libs/libcurl.so.4.8.0 \
     153                                ${destroot}${thePrefix}/libcurl-mp.so
     154            }
     155        }
     156        return
     157    }
     158    ###
     159    ### NB no code that is also relevant to port:MacPorts-libcurl below this line
     160    ###
     161
    121162    post-destroot {
    122163        set docdir ${prefix}/share/doc/${name}
    123164        xinstall -d ${destroot}${docdir}/html/libcurl ${destroot}${docdir}/pdf/libcurl \