Ticket #49925: Portfile.3

File Portfile.3, 3.3 KB (added by RJVB (René Bertin), 8 years ago)

Portfile for the kf5-gpgmepp "wannabe" framework

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
5
6set kf5.project     gpgmepp
7set kf5.virtualPath applications
8PortGroup           kf5 1.1
9
10maintainers         gmail.com:rjvbertin mk openmaintainer
11
12use_xz              yes
13
14description         C++ bindings/wrapper for gpgme
15long_description    GpgME++ is a C++ wrapper (or C++ bindings) for the GnuPG project's \
16                    gpgme (GnuPG Made Easy) library, version 0.4.4 and later.
17
18checksums           rmd160  a593d752fea341109aee2cf0af297500f17a7f8d \
19                    sha256  dab585067dfba6ea76728b9e574618cf1c7aec2c1113b592026a699af40fd40e
20
21# this port contains what is really a KF5 framework, so it has to copy certain things from the KF5-Frameworks port:
22variant qspXDG description {Configure Qt5's QStandardPaths to return XDG/Linuxy paths for shared locations} {
23# The Qt5 QStandardPaths (QSP) patch allows QSP to return XDG/linuxy locations (paths) that are more suitable
24# for a shared use of Qt5 in the MacPorts universe than the default values QSP returns that follow Apple's
25# sandboxing dogmas. It must however be activated so that individual ports have the choice which "flavour" they
26# use. KF5 applications should (probably) by using the XDG/Linuxy flavour unless they are to be built into
27# individual, autonomous app bundles that each contain all required dependencies.
28# Activation of the QSP patch is done by linking an additional, dedicated Qt component: Qt5::QspXDG .
29# The approach philosophy used here is to link that component with all KF5 frameworks and helper applications
30# built as part of those frameworks, even if they do not use the QSP class themselves. This redundancy comes
31# with an overhead that should be negligible, and serves to lower the maintenance burden (monitoring the
32# appearance of QSP usage).
33}
34
35if {${os.platform} eq "darwin"} {
36    if {[file exists ${qt_cmake_module_dir}/Qt5QspXDG/Qt5QspXDGConfig.cmake]} {
37        default_variants \
38                    +qspXDG
39    } else {
40        ui_debug "We appear to be building against a Qt5 port that doesn't have the QSP patch from port:qt5-kde. Don't fight it, just warn."
41        notes-append "You will be running KF5 applications with the stock/native Qt5::QStandardPaths behaviour.\
42                     That is not the recommended configuration for this port."
43    }
44}
45
46pre-patch {
47    if {[variant_isset qspXDG] && ${subport} ne "kf5-tier1-frameworks" \
48        && ${subport} ne "kf5-tier2-frameworks" && ${subport} ne "kf5-tier3-frameworks"} {
49        # patch the find_package(Qt5) command to add the activator of the QSP patch (which selects XDG behaviour).
50        # careful with the backslashes: it's a regular expression that must be passed on to sed(1) correctly!
51        reinplace "s|\\(find_package(Qt5 \[\^\)\]\*\\))|\\1 QspXDG)|g" ${worksrcpath}/CMakeLists.txt
52        if {[file exists ${worksrcpath}/src/CMakeLists.txt]} {
53            reinplace "s|\\(find_package(Qt5 \[\^\)\]\*\\))|\\1 QspXDG)|g" ${worksrcpath}/src/CMakeLists.txt
54            reinplace "s|\\(target_link_libraries(KF5\[\^ \$\]\*\\)|\\1 PRIVATE Qt5::QspXDG|g" ${worksrcpath}/src/CMakeLists.txt
55        }
56    }
57}
58
59if {${os.platform} eq "darwin"} {
60    depends_lib-append \
61                    port:gpgme \
62                    port:boost
63}