source: trunk/dports/devel/poco/Portfile

Last change on this file was 139229, checked in by jeremyhu@…, 2 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.9 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 139229 2015-08-08 03:10:35Z ryandesign@macports.org $
3
4PortSystem      1.0
5
6name            poco
7version         1.6.0
8categories      devel
9maintainers     nomaintainer
10platforms       darwin
11license         Boost-1
12supported_archs i386 x86_64
13
14description     POCO C++ Libraries
15
16long_description \
17    POCO aims to be for network-centric, cross-platform C++ software development \
18    what Apple's Cocoa is for Mac development, or Ruby on Rails is for Web \
19    development -- a powerful, yet easy to use platform to build your applications upon.
20
21homepage        http://pocoproject.org/
22master_sites    ${homepage}releases/poco-[strsed ${version} {s/[^0-9.].*$//}]/
23distname        ${name}-${version}-all
24
25checksums       rmd160  ff6069681246bafc546a842d92ec627b683b62fb \
26                sha256  17506e0f7abc2a6e933ef0f46a6c5ca6f7cb599370b11979f4e61b604ada240f
27
28set docdir      ${prefix}/share/doc/${name}
29
30if {${subport} eq ${name}} {
31use_bzip2       yes
32
33set omit        {NetSSL_OpenSSL Data/ODBC Data/MySQL Crypto}
34
35if {[string match *clang* ${configure.compiler}]} {
36    set config      Darwin-clang
37} else {
38    set config      Darwin
39}
40
41universal_variant   no
42
43# Something in the dependency checking matches the macports.org in the path
44# as a *.o file. It's all downhill from there. This patch removes the
45# dependency (.dep) file creation & use from the Makefiles.
46#
47# Note future maintainers / contributors: you will find you won't need
48# this patch when building outside the *macports.org* path. Don't remove it
49# without testing within the *macports.org* build path. See ticket #19486.
50patchfiles          patch-rules-deps.diff
51
52configure.args      --no-samples --config=${config}
53
54# Make sure poco build uses the right compiler.
55build.args-append   CC=${configure.cc} \
56                    CXX=${configure.cxx} \
57                    CPP=${configure.cpp} \
58                    POCO_HOST_OSARCH=${configure.build_arch}
59
60pre-configure {
61    configure.args-append   --omit=[join ${omit} ,]
62}
63
64post-patch {
65    reinplace -E "/^C(XX)?FLAGS +=/s|\$| ${configure.cppflags} ${configure.cflags}|" \
66        ${worksrcpath}/build/config/${config}
67    reinplace -E "/^((SH|DY)LIB|LINKFLAGS) +=/s|\$| -L\$(LIBPATH) ${configure.ldflags}|" \
68        ${worksrcpath}/build/config/${config}
69    reinplace -E "/^SHLIB +=/s|\$| -Wl,-install_name,${prefix}/lib/\$(notdir \$@)|" \
70        ${worksrcpath}/build/config/${config}
71}
72
73use_parallel_build  yes
74
75build.target    poco
76
77test.run        yes
78
79test {
80    proc luniq {list} {
81        set x() {}; unset x
82        foreach {item} ${list} {
83            set x(${item}) ""
84        }
85        return [array names x]
86    }
87
88    set file [open ${worksrcpath}/components]
89
90    set components {}
91    while {[gets ${file} component] != -1} {
92        lappend components ${component}
93    }
94
95    close ${file}
96
97    foreach {component} [luniq ${components}] {
98        foreach {testrunner} [glob -nocomplain ${worksrcpath}/${component}/testsuite/bin/*/*/testrunner{,d}] {
99            catch {system "${testrunner} -all -print"}
100        }
101    }
102}
103
104post-destroot {
105    xinstall -d ${destroot}${docdir}/html
106    xinstall -m 0644 -W ${worksrcpath} CHANGELOG CONTRIBUTORS LICENSE NEWS README VERSION \
107        ${destroot}${docdir}
108
109    xinstall -m 0644 -W ${worksrcpath}/doc Acknowledgements.html ${destroot}${docdir}/html
110    copy ${worksrcpath}/CppUnit/doc ${destroot}${docdir}/html/CppUnit
111}
112
113variant ssl description {Build NetSSL and Crypto library} {
114    depends_lib-append      path:lib/libssl.dylib:openssl
115    set omit [ldelete [ldelete ${omit} NetSSL_OpenSSL] Crypto]
116}
117
118variant odbc description {Build ODBC backend for Data library} {
119    depends_lib-append      lib:libiodbc:unixODBC
120    set omit [ldelete ${omit} Data/ODBC]
121}
122
123variant mysql description {Build MySQL backend for Data library} {
124    depends_lib-append      path:bin/mysql_config5:mysql5
125
126    configure.cppflags-append   -I${prefix}/include/mysql5/mysql
127    configure.ldflags-append    -L${prefix}/lib/mysql5/mysql
128
129    set omit [ldelete ${omit} Data/MySQL]
130}
131}
132
133subport ${name}-docs {
134    license             unknown
135    supported_archs     noarch
136
137    description         documentation for POCO
138
139    long_description    This port contains an offline copy of the POCO documentation.
140
141    homepage            ${homepage}documentation/
142    distname            ${distname}-doc
143
144    checksums           rmd160  9ff1b461532cb7391ea631e33c6d288692c07dac \
145                        sha256  6fe1a541353580cf1d91b211e710d1d579b1ddc82a0a5fbcd9c8907063c77c81
146
147    use_configure       no
148
149    build {}
150
151    destroot {
152        xinstall -d ${destroot}${docdir}
153        copy ${worksrcpath} ${destroot}${docdir}/html
154    }
155}
156
157if {${subport} eq ${name}} {
158    livecheck.type  regex
159    livecheck.url   ${homepage}download/
160    livecheck.regex /${name}-(\[0-9.p\]+)\\.tar
161} else {
162    livecheck.type  none
163}
Note: See TracBrowser for help on using the repository browser.