Ticket #54017: Portfile

File Portfile, 3.4 KB (added by RJVB (René Bertin), 7 years ago)
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$
3
4PortSystem          1.0
5PortGroup           cxx11 1.0
6# qgpgme is mostly used as a KDE dependency, so prefer qt5-kde
7set qt5.prefer_kde  1
8PortGroup           qt5 1.0
9
10name                qgpgme
11version             1.9.0
12categories          devel security crypto
13license             GPL-2+
14maintainers         gmail.com:rjvbertin mk openmaintainer
15description         Qt5 wrapper for the gpgme library for easy acces to GnuPG.
16long_description    QGpgME is the Qt5 wrapper for GnuPG Made Easy (GPGME).
17
18platforms           darwin linux
19
20homepage            http://www.gnupg.org/related_software/gpgme/
21master_sites        gnupg:gpgme
22use_bzip2           yes
23
24distname            gpgme-${version}
25# we use the same distfiles as port:gpgme:
26dist_subdir         gpgme
27checksums           rmd160  55719b4a7263ae8d0ef79205e26409ff5693ea27 \
28                    sha256  1b29fedb8bfad775e70eafac5b0590621683b2d9869db994568e6401f4034ceb
29
30# either gnupg2 (the default) or gnupg21 is needed for running the unit tests
31# and at runtime but nothing from gnupg2 links directly with qgpgme
32depends_build       port:pkgconfig \
33                    path:bin/gpg2:gnupg2
34
35depends_lib         port:gpgme
36
37depends_run         path:bin/gpg2:gnupg2
38
39use_parallel_build  yes
40
41# we have to build everything, but we can do the install (destroot) step from the lang/qt subdir
42destroot.dir        ${worksrcpath}/lang/qt
43
44patchfiles          patch-configure.ac.diff \
45                    patch-tests-gpg-Makefile.am.diff
46
47platform darwin {
48    pre-patch {
49        # use /bin/echo to avoid garbling the C++ headers
50        reinplace -W ${worksrcpath} "s|echo -n|/bin/echo -n|g" lang/qt/src/Makefile.am lang/qt/src/Makefile.in
51    }
52}
53post-patch {
54    reinplace "s|thread_modules=\"\"|thread_modules=\"pthread\"|" ${worksrcpath}/src/gpgme-config.in
55    reinplace "s|@GPG@|${prefix}/bin/gpg2|" ${worksrcpath}/src/gpgme-config.in
56    reinplace "s|@GPGSM@|${prefix}/bin/gpgsm|" ${worksrcpath}/src/gpgme-config.in
57}
58
59# cpp bindings require libc++ which we can rely on having thanks to the cxx11 portgroup
60lappend languages   cpp qt
61
62use_autoreconf      yes
63autoreconf.args     -fvi
64
65post-configure {
66    reinplace "s|CC -dynamiclib|CC -dynamiclib [get_canonical_archflags]|g" ${worksrcpath}/libtool
67}
68
69# rename libqgpgme to libq5gpgme to avoid conflicts with port:kdepimlibs4
70# The library is found through CMake files (also modified), so well behaved
71# software (presumably KF5) won't have issues with the non-standard name.
72patchfiles-append   patch-libqgpgme-name.diff
73
74
75# for building gpgme and gpgme++
76configure.cflags-append \
77                    -D_POSIX_C_SOURCE=200112L
78configure.cxxflags-append \
79                    -D_POSIX_C_SOURCE=200112L
80
81configure.args      --disable-dependency-tracking \
82                    --enable-languages="${languages}"
83
84test.run            yes
85test.target         check
86test.dir            ${destroot.dir}
87pre-test {
88    ui_warn "enter \"abc\" when a passphrase is requested"
89}
90
91post-destroot {
92    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
93    ln -s ../gpgme  ${destroot}${prefix}/share/doc/${name}
94    xinstall -m 644 -W ${worksrcpath} lang/qt/README \
95        ${destroot}${prefix}/share/doc/${name}
96}
97
98livecheck.type      regex
99livecheck.url       ftp://ftp.gnupg.org/gcrypt/gpgme/
100livecheck.regex     "gpgme-(\\d+(?:\\.\\d+)*)${extract.suffix}"