Ticket #54017: Portfile.2

File Portfile.2, 4.0 KB (added by RJVB (René Bertin), 7 years ago)

upgraded to 1.10.0

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