source: trunk/dports/devel/libgcrypt/Portfile @ 91558

Last change on this file since 91558 was 91558, checked in by jeremyhu@…, 5 years ago

libgcrypt: Build fix for Leopard/i386

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1# -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
2# $Id: Portfile 91558 2012-04-05 02:39:47Z jeremyhu@macports.org $
3
4PortSystem      1.0
5PortGroup       muniversal 1.0
6
7name            libgcrypt
8version         1.5.0
9categories      devel security
10# libs are LGPL, executables and docs are GPL
11license         {GPL-2+ LGPL-2.1+}
12maintainers     sfiera openmaintainer
13description     Crypto library
14homepage        http://www.gnupg.org/
15platforms       darwin
16
17long_description \
18    This is a general purpose cryptographic library based \
19    on the code from GnuPG. It provides functions for all \
20    cryptograhic building blocks: symmetric ciphers (AES, \
21    DES, Blowfish, CAST5, Twofish, Arcfour), hash algorithms \
22    (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for \
23    all hash algorithms), public key algorithms (RSA, ElGamal, \
24    DSA), large integer functions, random numbers and a lot of \
25    supporting functions.
26
27master_sites    gnupg
28use_bzip2       yes
29
30checksums       sha1    3e776d44375dc1a710560b98ae8437d5da6e32cf \
31                rmd160  f01e8198dcc379ff2fa5e8d3ac39e7b32fc41dad
32
33depends_lib     port:libgpg-error
34
35patchfiles      clang-asm.patch
36
37configure.args  --disable-asm
38
39# Build fix for compilers that default to c99 (clang)
40configure.cflags-append "-std=gnu89"
41
42if {[string match "*clang*" ${configure.compiler}]} {
43    # libgcrypt-1.5.0 does some ugly stuff with their udiv_qrnnd macro in mpih-div.c
44    # error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast
45    configure.cflags-append "-fheinous-gnu-extensions"
46} elseif {${configure.compiler} == "gcc-4.2"} {
47    # Some versions of gcc fail to build this for i386 including:
48    #     gcc-4.0 from XCode 3.1.6 (5493) -- Note that gcc-4.0 from XCode 2.5 (5370) works
49    #     gcc-4.2 from XCode 3.1.6 (5577)
50    #     gcc-4.2 from XCode 3.2.6 (5666.3)
51    # rijndael.c: In function 'do_aesni_ctr':
52    # rijndael.c:895: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
53    # rijndael.c:895: error: 'asm' operand has impossible constraints
54    configure.compiler llvm-gcc-4.2
55} elseif {${configure.compiler} == "gcc-4.0" && [vercmp ${xcodeversion} 3.0] >= 0} {
56    if {[variant_isset universal] || ${build_arch} == "i386"} {
57        depends_build port:clang-3.0
58        depends_skip_archcheck-append clang-3.0
59
60        if {[variant_isset universal]} {
61            set merger_configure_compiler(i386) macports-clang-3.0
62            lappend merger_configure_cflags(i386) -fheinous-gnu-extensions
63        } else {
64            configure.compiler macports-clang-3.0
65            configure.cflags-append "-fheinous-gnu-extensions"
66        }
67    }
68}
69
70use_parallel_build  yes
71
72post-patch {
73    if {[variant_isset universal]} {
74        reinplace "s/@LIBGCRYPT_CONFIG_HOST@/${os.arch}-apple-darwin${os.major}/" ${worksrcpath}/src/libgcrypt-config.in
75    }
76}
77
78post-destroot {
79    set docdir ${prefix}/share/doc/${name}
80    xinstall -d ${destroot}${docdir}
81    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING COPYING.LIB ChangeLog \
82        NEWS README THANKS TODO VERSION ${destroot}${docdir}
83}
84
85test.run        yes
86test.target     check
87
88livecheck.type  regex
89livecheck.url   ftp://ftp.gnupg.org/gcrypt/${name}/
90livecheck.regex ${name}-(\\d+\\.\\d+\\.\\d+)
Note: See TracBrowser for help on using the repository browser.