Ticket #48967: Portfile

File Portfile, 4.2 KB (added by RJVB (René Bertin), 8 years ago)

Portfile for port:qt5-mysql-plugins

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
4
5PortGroup           qt5 1.0
6
7name                qt5-mysql-plugins
8if {[file exists ${qt_qmake_cmd}]} {
9    version         [exec ${qt_qmake_cmd} -query QT_VERSION]
10} else {
11    # minimum version for which this port exists:
12    version         5.3.2
13}
14set branch          [qt_branch]
15categories          aqua databases
16platforms           macosx
17maintainers         gmail.com:rjvbertin openmaintainer
18license             {LGPL-2.1 GPL-3}
19
20description         Metaport providing the Qt MySQL database plugins
21long_description    ${description}
22
23homepage            http://qt-project.org
24distname            qt-everywhere-opensource-src-${version}
25
26master_sites        http://download.qt-project.org/official_releases/qt/${branch}/${version}/single/
27
28use_xz              yes
29switch ${version} {
30    "5.3.2" {
31        checksums       rmd160  e4664d55eb4cfb04e982d680602e4cdcd4f2ac05 \
32                        sha256  7f5bf93344cb57bac374ea4a32c8eda87f1357f998f14278e717cf84d0289bf0
33    }
34    "5.4.2" {
35        checksums       rmd160  6b7ce0ce0d6807637b47b4335624d1decc9119a8 \
36                        sha256  8c6d070613b721452f8cffdea6bddc82ce4f32f96703e3af02abb91a59f1ea25
37    }
38    "5.5.0" {
39        checksums       rmd160  47eede15296f2275aadb1f4e4806cea4b8205e45 \
40                        sha256  7ea2a16ecb8088e67db86b0835b887d5316121aeef9565d5d19be3d539a2c2af
41    }
42    "5.5.1" {
43        checksums       rmd160  42bf7768dafb868f2cdef857fd3e444520f2a706 \
44                        sha256  6f028e63d4992be2b4a5526f2ef3bfa2fe28c5c757554b11d9e8d86189652518
45    }
46}
47
48dist_subdir         qt5-mac
49# was this one ever necessary?
50#depends_lib-append  path:${qt_dir_rel}/bin/qmake:qt5-mac
51
52if {${subport} eq ${name}} {
53    pre-extract {
54        ui_error "\nThis is a metaport. It provides:\n${mp.names};\nyou can install exactly one of those.\n"
55        return -code error "metaport is not installable"
56    }
57}
58
59set DB              mysql
60set DRIVER          qtbase/src/sql/drivers/${DB}
61set PLUGIN          qtbase/src/plugins/sqldrivers/${DB}
62
63# Qt5 is huge. Enable HFS compression.
64#depends_extract-append      port:libarchive
65#extract.post_args   | bsdtar -x --hfsCompression -f - ${distname}/qtbase
66# extract only the qtbase component
67extract.post_args-append    ${distname}/qtbase
68
69post-extract {
70    # ensure that we'll be using the installed mkspecs which (may) have been patched
71    file delete -force ${worksrcpath}/qtbase/mkspecs
72}
73
74configure.dir       ${worksrcpath}/${PLUGIN}
75build.dir           ${configure.dir}
76destroot.dir        ${configure.dir}
77configure.cmd       ${qt_qmake_cmd}
78configure.pre_args  PREFIX=${prefix}
79
80if {[variant_isset universal]} {
81    configure.universal_args-delete --disable-dependency-tracking
82}
83
84set mp.ports     {mysql5 mysql51 mysql55 mysql56 mysql mariadb mariadb-10.0 mariadb-10.1 percona}
85foreach mp.port ${mp.ports} {
86    lappend mp.names "qt5-${mp.port}-plugin"
87}
88
89if {${subport} eq "qt5-mysql56-plugin"} {
90    replaced_by     qt5-mysql-plugin
91}
92
93foreach mp.name ${mp.names} {
94    set idx [lsearch ${mp.names} ${mp.name}]
95    set mp.port [lindex ${mp.ports} $idx]
96    set mp.conflicts [lreplace ${mp.names} $idx $idx]
97
98    subport ${mp.name} {
99        if {${mp.port} ne "mysql56"} {
100            description         Qt MySQL database plugin for ${mp.port}
101            long_description    ${description}
102            eval conflicts-append    ${mp.conflicts}
103            depends_lib-append  port:${mp.port}
104            configure.args      INCLUDEPATH+="${prefix}/include ${prefix}/include/${mp.port}/mysql" \
105                                LIBS+="-L${prefix}/lib -L${prefix}/lib/${mp.port} -L${prefix}/lib/${mp.port}/mysql -lmysqlclient_r"
106            configure.post_args mysql.pro
107
108            variant debug description \
109                {Build both release and debug plugin} {}
110
111            post-destroot {
112                xinstall -d -m 755 ${destroot}${qt_cmake_module_dir}
113                move ${destroot}${qt_frameworks_dir}/cmake/Qt5Sql ${destroot}${qt_cmake_module_dir}
114            }
115        }
116    }
117}
118
119build.target        {}
120
121livecheck.type      regex
122livecheck.url       http://download.qt.io/archive/qt/5.4/
123livecheck.regex     (\\d+(\\.\\d+)+)