Ticket #50500: qca.diff

File qca.diff, 10.6 KB (added by RJVB (René Bertin), 8 years ago)
  • /opt/local/

    old new  
    22# $Id: Portfile 128101 2014-11-13 09:19:56Z ryandesign@macports.org $
    33
    44PortSystem          1.0
    5 PortGroup           qt4 1.0
    65
    76name                qca
    8 version             2.0.3
    9 revision            1
    10 set branch          [join [lrange [split ${version} .] 0 1] .]
     7
     8# Qt version handling logic
     9global Qt_Major
     10subport ${name}-qt5 {}
     11if {[string match "${name}-qt5*" ${subport}]} {
     12    version         2.1.0.3
     13    PortGroup       qt5 1.0
     14    set Qt_Major    5
     15    master_sites    http://download.kde.org/stable/qca-qt5/${version}/src
     16    checksums       rmd160  cc4040d013170ca5f21fbcefd0607daa8191d333 \
     17                    sha256  ab0170696a8ff87588d38a72d36d0b4b42db9080c991d1a40ceb3f8311d289f9
     18    use_xz          yes
     19    distname        "qca-qt5-${version}"
     20    livecheck.regex "qca-qt5-(\\d+(?:\\.\\d+)*)"
     21} else {
     22    version         2.1.0
     23    set branch      [join [lrange [split ${version} .] 0 0] .]
     24    PortGroup       qt4 1.0
     25    set Qt_Major    4
     26    master_sites    http://delta.affinix.com/download/qca/${branch}.0/
     27    checksums       md5     c2b00c732036244701bae4853a2101cf \
     28                    sha1    2b582b3ccc7e6098cd14d6f52a829ae1539e9cc8 \
     29                    rmd160  30358bbd182cfeb9eaa696b5b39fa9e6d1f99b4c
     30    livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)"
     31}
     32PortGroup           cmake 1.0
     33cmake.out_of_source yes
     34
    1135categories          devel crypto security
    12 maintainers         michaelld openmaintainer
     36maintainers         michaelld gmail.com:rjvbertin openmaintainer
    1337license             LGPL-2.1
    1438description         Qt Cryptographic Architecture
    1539long_description \
     
    1741    features: SSL/TLS, X509, SASL, RSA, Hashing (SHA1, MD5), Ciphers \
    1842    (BlowFish, 3DES, AES).  Functionality is supplied via plugins.
    1943
    20 platforms            darwin
     44platforms           darwin
    2145
    22 homepage             http://delta.affinix.com/qca/
    23 master_sites         http://delta.affinix.com/download/qca/${branch}/
    24 use_bzip2            yes
    25 
    26 checksums            md5     fc15bd4da22b8096c51fcfe52d2fa309 \
    27                      sha1    9c868b05b81dce172c41b813de4de68554154c60 \
    28                      rmd160  333cfdce91fedfaec09c205528de52d7b569c521
    29 
    30 # (1) correct pkgconfig file for framework install, if selected.
    31 # (2) allow for 'debug' and 'framework' options at the same time.
    32 #     This change is needed to allow for +debug [+framework] --
    33 #     disallow just debug framework via no variants for it.
    34 # (3) allow simple replacement for universal arch arguments, if that
    35 #     variant is requested.
    36 patchfiles           patch-configure.diff
     46homepage            http://delta.affinix.com/qca/
    3747
    38 # fix C++ inheritance for a specific class to make clang happy
    39 patchfiles-append    patch-src_botantools_botan_botan_secmem.h.diff
     48depends_lib-append  port:botan \
     49                    port:libgcrypt \
     50                    port:nss
    4051
    4152# remove unnecessary Carbon #include, which fails on 10.8
    42 patchfiles-append    patch-src_qac_systemstore_mac.cpp.diff
     53patchfiles-append   patch-src_qac_systemstore_mac.cpp.diff
    4354
    44 post-patch {
    45     # set arch type(s)
    46     reinplace "s|@ARCHES@|${qt_arch_types}|g" \
    47         ${worksrcpath}/configure
    48 
    49     # since Qt now uses the correct install_name for libraries,
    50     # remove that from QCA's library
    51     reinplace "/QMAKE_LFLAGS_SONAME/d" \
    52         ${worksrcpath}/src/src.pro
    53 }
    54 
    55 # set QCA to install into the QT4 directory
    56 configure.pre_args   --prefix=${qt_dir}
    57 
    58 # defaults: release only, no-framework, specific build_arch.
    59 # use variants to change everything except framework
    60 configure.args        --verbose         \
    61                       --qtdir=${qt_dir} \
    62                       --release         \
    63                       --no-framework
    64 
    65 # QCA's configure does not handle this flag,
    66 # but does not generate an error either.
    67 configure.universal_args-delete --disable-dependency-tracking
    68 configure.args-delete  --disable-dependency-tracking
     55patchfiles-append   patch-qca-ossl.diff
     56
     57# 1) it seems that configure.pre_args --prefix=${qt_dir} has the desired effect, but
     58# I don't know to what extent that uses an undocumented cmake feature, so use
     59# the exhaustive list of install variables.
     60# 2) the QCA plugins have been rolled into the main source tarball and are built by default
     61# when their dependencies are available. Allow this for all plugins that were not already
     62# available through an individual port; no reason to impose new dependencies on our dependents.
     63configure.args          -DCMAKE_INSTALL_PREFIX:PATH=${qt_dir} \
     64                        -DQCA_PLUGINS_INSTALL_DIR:PATH=${qt_plugins_dir} \
     65                        -DQCA_LIBRARY_INSTALL_DIR:PATH=${qt_libs_dir} \
     66                        -DQCA_BINARY_INSTALL_DIR:PATH=${qt_bins_dir} \
     67                        -DQCA_FEATURE_INSTALL_DIR:PATH=${qt_mkspecs_dir}/features \
     68                        -DQCA_INCLUDE_INSTALL_DIR:PATH=${qt_includes_dir} \
     69                        -DQCA_PRIVATE_INCLUDE_INSTALL_DIR:PATH=${qt_includes_dir} \
     70                        -DQCA_DOC_INSTALL_DIR:PATH=${qt_docs_dir} \
     71                        -DQCA_MAN_INSTALL_DIR:PATH=${prefix}/share/man \
     72                        -DPKGCONFIG_INSTALL_PREFIX:PATH=${qt_pkg_config_dir} \
     73                        -DOSX_FRAMEWORK:BOOL=OFF \
     74                        -DBUILD_PLUGINS:STRING="botan\;gcrypt\;logger\;nss\;softstore"
     75
     76if {${Qt_Major} eq "4"} {
     77    configure.args-append \
     78                        -DQT4_BUILD:BOOL=ON
     79} elseif {${Qt_Major} eq "5"} {
     80    patchfiles-append   patch-qca210-qt550.diff
     81    configure.args-append \
     82                        -DQCA_SUFFIX:STRING="qt5"
     83}
    6984
    7085# allow ccache, if specified by the user
    7186pre-build {
     
    7590}
    7691
    7792post-destroot {
    78     # alias to destroot QCA top-level directory
    79     set destroot_qt ${destroot}${qt_dir}
     93    if {${subport} eq ${name} || ${subport} eq "${subport}-qt5"} {
     94        # install docs
     95        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${subport}
     96        xinstall -m 644 -W ${worksrcpath} COPYING README TODO \
     97            ${destroot}${prefix}/share/doc/${subport}
     98    }
    8099
    81     # install docs
    82     xinstall -d -m 755 ${destroot_qt}/share/doc/${name}
    83     xinstall -m 644 -W ${worksrcpath} COPYING README TODO \
    84         ${destroot_qt}/share/doc/${name}
    85 
    86     # install cmake file (taken from port 'kdelibs4'). To use this
    87     # file, include '-DCMAKE_MODULE_PATH=...' in configure.args during
    88     # the initial 'configure' stage (which uses CMake), to the full
    89     # path of where the CMake files are installed.
    90     xinstall -d -m 755 ${destroot}${qt_cmake_module_dir}
    91     xinstall -m 644 -W ${filespath} FindQCA2.cmake \
    92         ${destroot}${qt_cmake_module_dir}
     100    if {${subport} eq "${name}"} {
     101        # install cmake file (taken from port 'kdelibs4'). To use this
     102        # file, include '-DCMAKE_MODULE_PATH=...' in configure.args during
     103        # the initial 'configure' stage (which uses CMake), to the full
     104        # path of where the CMake files are installed.
     105        # note that QCA 2.1+ also installs .cmake files in ${qt_libs_dir}/cmake/Qca; I don't
     106        # see a reason to move those so I'm leaving them there.
     107        xinstall -d -m 755 ${destroot}${qt_cmake_module_dir}
     108        xinstall -m 644 -W ${filespath} FindQCA2.cmake \
     109            ${destroot}${qt_cmake_module_dir}
     110
     111    }
    93112}
    94113
     114# NB: it doesn't seem possible to build this way with the new cmake-based approach
    95115variant debug description \
    96116{Build both release and debug library} {
    97     configure.args-delete --release
    98     configure.args-append --debug-and-release
     117    ui_msg "this variant is obsolete; use configure.optflags=\"-g\""
     118    PortGroup   obsolete 1.0
    99119}
    100120
     121# avoid installing the examples into Qt's binary tree
    101122variant examples description \
    102123{Include examples in install} {
    103124    post-destroot {
    104         xinstall -d -m 755 ${destroot}${qt_dir}/share/examples/${name}
     125        xinstall -d -m 755 ${destroot}${prefix}/share/${subport}/examples/
    105126        eval file copy [glob ${worksrcpath}/examples/*] \
    106             ${destroot}${qt_dir}/share/examples/${name}
     127            ${destroot}${prefix}/share/${subport}/examples/
    107128    }
    108129}
    109130
    110 platform darwin 8 {
    111     # might not be necessary
    112     if {[variant_exists universal] && [variant_isset universal]} {
    113         configure.args-append --mac-sdk=${developer_dir}/SDKs/MacOSX10.4u.sdk
     131# NB: I haven't yet tested universal variants; those may require the muniversal portgroup
     132# variant universal {
     133#     # Add the universal flag understood by qmake
     134#     configure.universal_args-append --universal
     135# }
     136
     137subport qca-tls {
     138    replaced_by qca-ossl
     139    PortGroup obsolete 1.0
     140    long_description "This port is obsolete."
     141}
     142
     143### The ossl, cyrus-sasl and gnupg plugins that used to be standalone ports.
     144### It makes more sense IMHO to implement them as subports. The other plugins
     145### are built together with the main port; I don't see a reason to introduce
     146### new subports for components that used to be built along with the main ports,
     147### only to impose new dependencies on the ports that require qca.
     148# Qt4 receives no suffix:
     149set qt.versions     {"" "-qt5"}
     150foreach qv ${qt.versions} {
     151    subport ${name}${qv}-ossl {
     152        license                 LGPL-2.1+
     153        depends_lib-append      port:${name}${qv} port:openssl
     154        configure.args-delete   -DBUILD_PLUGINS:STRING="botan\;gcrypt\;logger\;nss\;softstore"
     155        configure.args-append   -DBUILD_PLUGINS:STRING="ossl"
     156        build.dir               ${workpath}/build/plugins/qca-ossl
     157    }
     158    subport ${name}${qv}-cyrus-sasl {
     159        license                 LGPL-2.1+
     160        depends_lib-append      port:${name}${qv} port:cyrus-sasl2
     161        configure.args-delete   -DBUILD_PLUGINS:STRING="botan\;gcrypt\;logger\;nss\;softstore"
     162        configure.args-append   -DBUILD_PLUGINS:STRING="cyrus-sasl"
     163        build.dir               ${workpath}/build/plugins/qca-cyrus-sasl
     164    }
     165    subport ${name}${qv}-gnupg {
     166        license                 LGPL-2.1+
     167        depends_lib-append      port:${name}${qv}
     168        configure.args-delete   -DBUILD_PLUGINS:STRING="botan\;gcrypt\;logger\;nss\;softstore"
     169        configure.args-append   -DBUILD_PLUGINS:STRING="gnupg"
     170        build.dir               ${workpath}/build/plugins/qca-gnupg
    114171    }
    115 }
    116 
    117 variant universal {
    118     # Add the universal flag understood by qmake
    119     configure.universal_args-append --universal
    120172}
    121173
    122174livecheck.type  regex
    123 livecheck.url   ${homepage}
    124 livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
     175livecheck.url   ${master_sites}