| 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 | |
|---|
| 3 | PortSystem 1.0 |
|---|
| 4 | |
|---|
| 5 | # use the qt5 group; set 'building_qt5' so that the portgroup |
|---|
| 6 | # does not include certain parts |
|---|
| 7 | set building_qt5 1 |
|---|
| 8 | PortGroup qt5 1.0 |
|---|
| 9 | PortGroup xcodeversion 1.0 |
|---|
| 10 | |
|---|
| 11 | name qt5-mac-mysql-plugins |
|---|
| 12 | if {[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 | } |
|---|
| 18 | set branch [join [lrange [split ${version} .] 0 1] .] |
|---|
| 19 | categories aqua databases |
|---|
| 20 | platforms macosx |
|---|
| 21 | maintainers michaelld pixilla gmail.com:rjvbertin openmaintainer |
|---|
| 22 | license {LGPL-2.1 GPL-3} |
|---|
| 23 | |
|---|
| 24 | description Metaport providing the Qt MySQL database plugins |
|---|
| 25 | long_description ${description} |
|---|
| 26 | |
|---|
| 27 | homepage http://qt-project.org |
|---|
| 28 | distname qt-everywhere-opensource-src-${version} |
|---|
| 29 | |
|---|
| 30 | master_sites http://download.qt-project.org/official_releases/qt/${branch}/${version}/single/ |
|---|
| 31 | |
|---|
| 32 | use_xz yes |
|---|
| 33 | if {${version} eq "5.3.2"} { |
|---|
| 34 | checksums rmd160 e4664d55eb4cfb04e982d680602e4cdcd4f2ac05 \ |
|---|
| 35 | sha256 7f5bf93344cb57bac374ea4a32c8eda87f1357f998f14278e717cf84d0289bf0 |
|---|
| 36 | } else { |
|---|
| 37 | checksums rmd160 31b90c19c8541f84487017b1410d96767374bbb9 \ |
|---|
| 38 | sha256 1b7eb91e153176ac917f72b6bf443f987abf47c4208cdd43e2307684a7fad860 |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | dist_subdir qt5-mac |
|---|
| 42 | depends_lib-append path:${qt_dir_rel}/bin/qmake:qt5-mac |
|---|
| 43 | |
|---|
| 44 | if {${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 | |
|---|
| 51 | set DB mysql |
|---|
| 52 | set DRIVER qtbase/src/sql/drivers/${DB} |
|---|
| 53 | set PLUGIN qtbase/src/plugins/sqldrivers/${DB} |
|---|
| 54 | |
|---|
| 55 | # Qt5 is huge. Enable HFS compression. |
|---|
| 56 | depends_extract-append port:libarchive |
|---|
| 57 | extract.post_args | bsdtar -x --hfsCompression -f - \ |
|---|
| 58 | ${distname}/qtbase ${distname}/configure |
|---|
| 59 | |
|---|
| 60 | configure.dir ${worksrcpath}/${PLUGIN} |
|---|
| 61 | build.dir ${configure.dir} |
|---|
| 62 | destroot.dir ${configure.dir} |
|---|
| 63 | configure.cmd ${qt_qmake_cmd} |
|---|
| 64 | configure.pre_args PREFIX=${prefix} |
|---|
| 65 | |
|---|
| 66 | if {[variant_isset universal]} { |
|---|
| 67 | configure.universal_args-delete --disable-dependency-tracking |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | set mp.ports {mysql5 mysql51 mysql55 mysql56 mariadb mariadb-10.0 mariadb-10.1 percona} |
|---|
| 71 | foreach mp.port ${mp.ports} { |
|---|
| 72 | lappend mp.names "qt5-mac-${mp.port}-plugin" |
|---|
| 73 | } |
|---|
| 74 | |
|---|
| 75 | foreach 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 | |
|---|
| 98 | build.target {} |
|---|
| 99 | |
|---|
| 100 | livecheck.type regex |
|---|
| 101 | livecheck.url http://download.qt.io/archive/qt/5.4/ |
|---|
| 102 | livecheck.regex (\\d+(\\.\\d+)+) |
|---|