source: trunk/dports/devel/qca/Portfile

Last change on this file was 154192, checked in by michaelld@…, 13 months ago

qca*: drop maintainership.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.6 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 154192 2016-10-24 00:00:00Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           active_variants 1.1
7
8name                qca
9version             2.1.0
10revision            3
11set branch          [join [lrange [split ${version} .] 0 1] .]
12categories          devel crypto security
13maintainers         nomaintainer
14license             LGPL-2.1
15
16description "Qt Cryptographic Architecture"
17long_description \
18    "Qt Cryptographic Architecture provides an easy API for the following \
19     features: SSL/TLS, X509, SASL, RSA, Hashing (SHA1, MD5), Ciphers \
20     (BlowFish, 3DES, AES).  Functionality is supplied via plugins."
21
22platforms           darwin
23
24homepage            http://delta.affinix.com/qca/
25master_sites        http://delta.affinix.com/download/qca/2.0/
26
27checksums           rmd160 30358bbd182cfeb9eaa696b5b39fa9e6d1f99b4c \
28                    sha256 226dcd76138c3738cdc15863607a96b3758a4c3efd3c47295939bcea4e7a9284
29
30# do VPATH (out of source tree) build
31
32cmake.out_of_source yes
33
34if {${name} eq ${subport}} {
35
36    # temporary patch to add including QIODevice to qca_basic.h
37
38    patchfiles-append patch-include_QtCrypto_qca_basic.h.diff
39
40    # fix install directories for certs and cmake files
41
42    patchfiles-append patch-CMakeLists.txt.diff
43
44    # remove unnecessary Carbon #include, which fails on 10.8
45
46    patchfiles-append patch-src_qac_systemstore_mac.cpp.diff
47
48} else {
49    # fix top-level CMakeLists.txt to build just plugins
50    patchfiles-append patch-CMakeLists.txt_plugins.diff
51}
52
53# Qt variants
54
55variant qt4 conflicts qt5 description "Build with qt4" {}
56
57variant qt5 conflicts qt4 description "Build with qt5" {}
58
59if {![variant_isset qt4] && ![variant_isset qt5]} {
60    default_variants +qt4
61}
62
63# make sure -qt4 wasn't specified alone
64
65if {![variant_isset qt4] && ![variant_isset qt5]} {
66    ui_error "\n\nYou must select either the +qt4 or +qt5 variant to build ${subport}\n"
67    return -code error "Invalid variant selection"
68}
69
70if {${name} eq ${subport}} {
71    if {[variant_isset qt4]} {
72        PortGroup qt4 1.0
73        configure.args-append -DQT4_BUILD=ON
74    } else {
75        PortGroup qt5 1.0
76    }
77} else {
78    # require qca to also have the selected Qt variant
79    if {[variant_isset qt4]} {
80        PortGroup qt4 1.0
81        require_active_variants port:qca qt4
82        configure.args-append -DQT4_BUILD=ON
83    } else {
84        PortGroup qt5 1.0
85        require_active_variants port:qca qt5
86    }
87}
88
89variant examples description {Include examples in install} {}
90
91# set install directory for mkspec files
92
93configure.args-append \
94    -DQCA_FEATURE_INSTALL_DIR=${qt_mkspecs_dir}
95
96# specify various configure options
97
98configure.args-append \
99    -DQCA_INSTALL_IN_QT_PREFIX=NO \
100    -DQCA_PLUGINS_INSTALL_DIR=${prefix}/share/${name}/plugins
101
102if {${name} eq ${subport}} {
103
104    # build as a framework
105
106    configure.args-append \
107        -DOSX_FRAMEWORK=YES
108
109    # specify various configure options
110
111    configure.args-append \
112        -DBUILD_PLUGINS=NO \
113        -DQCA_MAN_INSTALL_DIR=${prefix}/share/man \
114        -DQCA_LIBRARY_INSTALL_DIR=${frameworks_dir} \
115        -DCMAKE_MODULES_DIR=${prefix}/share/cmake \
116        -DPKGCONFIG_INSTALL_PREFIX=${prefix}/lib/pkgconfig \
117        -DQCA_DOC_INSTALL_DIR=${prefix}/share/${name}/doc
118
119}
120
121# allow ccache, if specified by the user
122
123pre-build {
124    if {[tbool configure.ccache]} {
125        build.post_args "CCACHE=ccache"
126    }
127}
128
129post-destroot {
130
131    if {${name} eq ${subport}} {
132
133        # install docs
134
135        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
136        xinstall -m 644 -W ${worksrcpath} COPYING README TODO \
137            ${destroot}${prefix}/share/doc/${name}
138
139        # get qca's version numbers
140
141        set qca_vers [split ${version} "."]
142        set qca_major [lindex ${qca_vers} 0]
143        set qca_minor [lindex ${qca_vers} 1]
144        set qca_patch [lindex ${qca_vers} 2]
145
146        # link includes and libraries for each actual installed framework
147
148        set tf_full ${frameworks_dir}/qca.framework/Versions/${version}
149
150        # link headers into ${prefix}/include, removing
151        # directories if they are already there first
152
153        set dr_inc_file ${destroot}${prefix}/include
154        ln -s ${tf_full}/Headers ${dr_inc_file}/qca
155        ln -s ${tf_full}/Headers ${dr_inc_file}/QtCrypto
156
157        # link libraries into ${dr_libs_dir}, all 4 number variants
158
159        set dr_libs_dir ${destroot}${prefix}/lib
160        ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.dylib
161        ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.dylib
162        ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.${qca_minor}.dylib
163        ln -s ${tf_full}/qca ${dr_libs_dir}/libqca.${qca_major}.${qca_minor}.${qca_patch}.dylib
164
165        if {[variant_isset examples]} {
166            xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name}
167            eval file copy [glob ${worksrcpath}/examples/*] \
168                ${destroot}${prefix}/share/examples/${name}
169        }
170    }
171}
172
173array set bindings {
174    botan       {port:botan       botan}
175    cyrus-sasl  {port:cyrus-sasl2 cyrus-sasl}
176    gcrypt      {port:libgcrypt   gcrypt}
177    gnupg       {port:gnupg       gnupg}
178    logger      {""               logger}
179    nss         {port:nss         nss}
180    ossl        {path:lib/libssl.dylib:openssl ossl}
181    softstore   {""               softstore}
182}
183#    pkcs11      {port:pkcs11      pkcs11}
184array set prettynames {
185    botan Botan cyrus-sasl Cyrus-SASL gcrypt GCrypt
186    gnupg GnuPG logger Logger nss NSS
187    ossl OpenSSL pkcs11 pkcs11 softstore SoftStore
188}
189
190options qca.plugin
191default qca.plugin ""
192
193foreach plugin [lsort [array names bindings]] {
194    set arg      [lindex $bindings($plugin) 1]
195    set arg_name [lindex [split ${arg} =] 0]
196    subport qca-${plugin} {
197        if {[lindex $bindings($plugin) 0] ne ""} {
198            depends_lib-append [lindex $bindings($plugin) 0]
199        }
200        configure.args-append  -DWITH_${arg}_PLUGIN=ON
201        qca.plugin             ${arg_name}
202    }
203    if {${qca.plugin} != ${arg_name}} {
204        configure.args-append -DWITH_${arg_name}_PLUGIN=OFF
205    }
206}
207if {${qca.plugin} ne ""} {
208    description $prettynames(${qca.plugin}) plugin for ${name}
209    long_description \
210        Qt Cryptographic Architecture. This is the \
211        $prettynames(${qca.plugin}) plugin.
212    depends_lib-append port:qca
213    livecheck.type none
214} else {
215    livecheck.type  regex
216    livecheck.url   ${homepage}
217    livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
218}
219
220subport qca-tls {
221    PortGroup obsolete 1.0
222    long_description "This port is obsolete."
223}
Note: See TracBrowser for help on using the repository browser.