source: trunk/dports/devel/libcryptopp/Portfile @ 152842

Last change on this file since 152842 was 152842, checked in by raphael@…, 2 years ago

libcryptopp: fix CVE-2016-7420

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 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 152842 2016-09-19 16:35:32Z raphael@macports.org $
3
4PortSystem 1.0
5
6name                libcryptopp
7version             5.6.4
8revision            1
9categories          devel security
10platforms           darwin
11maintainers         raphael openmaintainer
12description         C++ class library of cryptographic schemes
13long_description    Crypto++ Library is a free C++ class library of \
14                    cryptographic schemes.
15
16homepage            http://www.cryptopp.com/
17license             Boost-1
18
19master_sites        sourceforge:cryptopp \
20                    ${homepage}
21distname            cryptopp[strsed ${version} {g/\.//}]
22
23checksums           rmd160  09c9ef991f3931e22ab5633c33d890fb0ba9429e \
24                    sha256  be430377b05c15971d5ccb6e44b4d95470f561024ed6d701fe3da3a188c84ad7
25
26use_zip             yes
27extract.mkdir       yes
28
29patchfiles          patch-config.h.diff \
30                    patch-GNUmakefile.diff
31post-patch {
32    # render the asserts inert; fixes CVE-2016-7420 (see <https://groups.google.com/forum/#!topic/cryptopp-users/NhWvEAMKcsU>)
33    reinplace "s|assert\[\[:space:\]\]*(|CRYPTOPP_UNUSED(|g" {*}[glob ${worksrcpath}/*.h ${worksrcpath}/*.cpp]
34}
35
36use_configure       no
37
38variant universal {}
39
40proc _get_cryptopp_init_priority_flag {compiler} {
41    if {[string match "macports-gcc*" $compiler]} {
42        return " -DMACPORTS_GCC_COMPILER"
43    }
44    return ""
45}
46
47build.type          gnu
48build.target        dynamic static cryptest.exe
49build.env-append    CXXFLAGS="[get_canonical_archflags cxx] -DNDEBUG [_get_cryptopp_init_priority_flag ${configure.compiler}]"
50build.args-append   CXX=${configure.cxx} PREFIX=${prefix}
51
52test.run            yes
53test.cmd            ./cryptest.exe
54test.target         v
55
56destroot {
57    xinstall -m 755 -d ${destroot}${prefix}/include/cryptopp \
58        ${destroot}${prefix}/share/doc/${name}
59    xinstall -m 644 ${worksrcpath}/libcryptopp.a \
60        ${worksrcpath}/libcryptopp.dylib \
61        ${destroot}${prefix}/lib
62    xinstall -m 644 {*}[glob ${worksrcpath}/*.h] \
63        ${destroot}${prefix}/include/cryptopp/
64    xinstall -m 644 -W ${worksrcpath} Readme.txt License.txt \
65        ${destroot}${prefix}/share/doc/${name}/
66}
67
68livecheck.type      regex
69livecheck.regex     "Crypto\\+\\+ (\\d+(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.