Ticket #47047: Portfile

File Portfile, 3.5 KB (added by RJVB (René Bertin), 9 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
3PortSystem          1.0
4
5# use the qt5 group; set 'building_qt5' so that the portgroup
6# does not include certain parts
7set building_qt5    1
8PortGroup           qt5 1.0
9PortGroup           xcodeversion 1.0
10
11name                qt5-mac-mysql-plugins
12if {[file exists ${qt_qmake_cmd}]} {
13    version         [exec ${qt_qmake_cmd} -query QT_VERSION]
14} else {
15    # minimum version for which this port exists:
16    version         5.3.2
17}
18set branch          [join [lrange [split ${version} .] 0 1] .]
19categories          aqua databases
20platforms           macosx
21maintainers         michaelld pixilla gmail.com:rjvbertin openmaintainer
22license             {LGPL-2.1 GPL-3}
23
24description         Metaport providing the Qt MySQL database plugins
25long_description    ${description}
26
27homepage            http://qt-project.org
28distname            qt-everywhere-opensource-src-${version}
29
30master_sites        http://download.qt-project.org/official_releases/qt/${branch}/${version}/single/
31
32use_xz              yes
33if {${version} eq "5.3.2"} {
34    checksums       rmd160  e4664d55eb4cfb04e982d680602e4cdcd4f2ac05 \
35                    sha256  7f5bf93344cb57bac374ea4a32c8eda87f1357f998f14278e717cf84d0289bf0
36} else {
37    checksums       rmd160  31b90c19c8541f84487017b1410d96767374bbb9 \
38                    sha256  1b7eb91e153176ac917f72b6bf443f987abf47c4208cdd43e2307684a7fad860
39}
40
41dist_subdir         qt5-mac
42depends_lib-append  path:${qt_dir_rel}/bin/qmake:qt5-mac
43
44if {${subport} eq ${name}} {
45    pre-extract {
46        ui_error "\nThis is a metaport. It provides:\n${mp.names};\nyou can install exactly one of those.\n"
47        return -code error "metaport is not installable"
48    }
49}
50
51set DB              mysql
52set DRIVER          qtbase/src/sql/drivers/${DB}
53set PLUGIN          qtbase/src/plugins/sqldrivers/${DB}
54
55# Qt5 is huge. Enable HFS compression.
56depends_extract-append      port:libarchive
57extract.post_args   | bsdtar -x --hfsCompression -f - \
58                    ${distname}/qtbase ${distname}/configure
59
60configure.dir       ${worksrcpath}/${PLUGIN}
61build.dir           ${configure.dir}
62destroot.dir        ${configure.dir}
63configure.cmd       ${qt_qmake_cmd}
64configure.pre_args  PREFIX=${prefix}
65
66if {[variant_isset universal]} {
67    configure.universal_args-delete --disable-dependency-tracking
68}
69
70set mp.ports     {mysql5 mysql51 mysql55 mysql56 mariadb mariadb-10.0 mariadb-10.1 percona}
71foreach mp.port ${mp.ports} {
72    lappend mp.names "qt5-mac-${mp.port}-plugin"
73}
74
75foreach mp.name ${mp.names} {
76    set idx [lsearch ${mp.names} ${mp.name}]
77    set mp.port [lindex ${mp.ports} $idx]
78    set mp.conflicts [lreplace ${mp.names} $idx $idx]
79
80    subport ${mp.name} {
81        description         Qt MySQL database plugin for ${mp.port}
82        long_description    ${description}
83        eval conflicts-append    ${mp.conflicts}
84        depends_lib-append  port:${mp.port}
85        configure.args      INCLUDEPATH+="${prefix}/include ${prefix}/include/${mp.port}/mysql" \
86                            LIBS+="-L${prefix}/lib -L${prefix}/lib/${mp.port} -L${prefix}/lib/${mp.port}/mysql -lmysqlclient_r"
87        configure.post_args mysql.pro
88
89        variant debug description \
90            {Build both release and debug plugin} {}
91
92#        pre-configure {
93#            configure.args-append CONFIG+=\"${qt_arch_types}\"
94#        }
95    }
96}
97
98build.target        {}
99
100livecheck.type      regex
101livecheck.url       http://download.qt.io/archive/qt/5.4/
102livecheck.regex     (\\d+(\\.\\d+)+)