# -*- 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 PortSystem 1.0 PortGroup legacysupport 1.0 # CLOCK_REALTIME legacysupport.newest_darwin_requires_legacy 15 name mariadb-10.10 set name_mysql ${name} version 10.10.2 set version_branch [join [lrange [split ${version} .] 0 1] .] # Please set revision_client and revision_server to 0 if you bump # version; these can be changed independently for the 2 subports, but # can be changed at the same time if that's what's required. set revision_client 0 set revision_server 0 categories databases platforms darwin license GPL-2 maintainers {michaelld @michaelld} openmaintainer if {$subport eq $name} { PortGroup cmake 1.0 PortGroup select 1.0 PortGroup github 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup boost 1.0 PortGroup openssl 1.0 boost.version 1.78 compiler.cxx_standard 2011 openssl.branch 3 # build configuration will incorrectly find and use the openssl shim port headers # which are in the primary prefix, in preference to the openssl11 ones, due to a bug # in the order that the compilation include paths are listed. i.e. # -I/opt/local/libexec/openssl11/include # must come before any instance of # -I/opt/local/include # Until the build configuration is fixed to avoid this (or the port is updated to be # compatible with openssl3) use the openssl PG compiler wrap option to enforce the # correct include order on the build openssl.configure-append compiler_wrap # https://trac.macports.org/ticket/60805 compiler.blacklist-append {clang < 900} github.setup MariaDB server ${version}-release mariadb- revision ${revision_client} license GPL-2 description Multithreaded SQL database server long_description Mariadb is a fork of the MySQL server, a multi-threaded SQL database. cmake.out_of_source yes use_parallel_build yes # mariadb-connector-c, wsrep-lib and wsrep-API are submodules, # but because we're not # cloning into a GIT module in the first place, we can't use the # git submodule feature. Have to download separately and install # into the correct location to get this port to work! Which means # we need a mariadb-connector-c branch and so forth ... basically # replicate what the github PG does but without using it since it # is not designed to be used for multiple downloads. set libmariadb_github_author MariaDB set libmariadb_github_project mariadb-connector-c set libmariadb_github_branch 72b40bfaa869f3fe84242471dda989d13983d84c set wsrep_github_author codership set wsrep_github_project wsrep-lib set wsrep_github_branch 8bfce04189671eb1f06e0fa83dff8c880f31088f set wsrep_api_github_author codership set wsrep_api_github_project wsrep-API set wsrep_api_github_branch 02ed17238cee97b5a3ea2495ca87b63570403f01 set columnstore_github_author mariadb-corporation set columnstore_github_project mariadb-columnstore-engine set columnstore_github_branch 5923beeab9397aa22563ff7b1f0f31ad8054bae6 set libmarias3_github_author mariadb-corporation set libmarias3_github_project libmarias3 set libmarias3_github_branch 3846890513df0653b8919bc45a7600f9b55cab31 set main_distname ${distname} set main_distfile ${distfiles} set libmariadb_distname ${libmariadb_github_project}-${libmariadb_github_branch} set libmariadb_distfile ${libmariadb_distname}${extract.suffix} set wsrep_distname ${wsrep_github_project}-${wsrep_github_branch} set wsrep_distfile ${wsrep_distname}${extract.suffix} set wsrep_api_distname ${wsrep_api_github_project}-${wsrep_api_github_branch} set wsrep_api_distfile ${wsrep_api_distname}${extract.suffix} set columnstore_distname ${columnstore_github_project}-${columnstore_github_branch} set columnstore_distfile ${columnstore_distname}${extract.suffix} set libmarias3_distname ${libmarias3_github_project}-${libmarias3_github_branch} set libmarias3_distfile ${libmarias3_distname}${extract.suffix} distfiles ${main_distfile}:tagone \ ${libmariadb_distfile}:tagtwo \ ${wsrep_distfile}:tagthree \ ${wsrep_api_distfile}:tagfour \ ${columnstore_distfile}:tagfive \ ${libmarias3_distfile}:tagsix master_sites ${github.homepage}/archive/${git.branch}:tagone \ https://github.com/${libmariadb_github_author}/${libmariadb_github_project}/archive/${libmariadb_github_branch}:tagtwo \ https://github.com/${wsrep_github_author}/${wsrep_github_project}/archive/${wsrep_github_branch}:tagthree \ https://github.com/${wsrep_api_github_author}/${wsrep_api_github_project}/archive/${wsrep_api_github_branch}:tagfour \ https://github.com/${columnstore_github_author}/${columnstore_github_project}/archive/${columnstore_github_branch}:tagfive \ https://github.com/${libmarias3_github_author}/${libmarias3_github_project}/archive/${libmarias3_github_branch}:tagsix checksums ${main_distfile} \ rmd160 70cc23b6108e8da9cb40cc727806a5f58a7ac9bb \ sha256 aaa7f57e145192a99e9d0f269d65ea39e6f5ec0047c8a205ebe3c3e5222bb8d2 \ size 50675298 \ ${libmariadb_distfile} \ rmd160 b3e5ce0c22b07cecd9b20ab2ab14903435d2ed45 \ sha256 a2ebea87faa562fef788c1e698e9173e4d5060d60f64ccfaae4eeb57611a6deb \ size 1400692 \ ${wsrep_distfile} \ rmd160 f5c1f52a07dcccd4babb0e4da5ddca52cd78c8e7 \ sha256 8a64fbb42a76c9839e2aaf43ebeb143f39c2842874084b7f1f7ba1f842b7d052 \ size 176413 \ ${wsrep_api_distfile} \ rmd160 996ddebec67793a0b15d9e2cff9aa70e7760550e \ sha256 99960eb0ccb4dff5eb354289b0a8ec2ecb0dcc246f54edf292f69f340a916ee4 \ size 91283 \ ${columnstore_distfile} \ rmd160 2233d80b32eb76c61f46d8f7341a5de1f746fb08 \ sha256 16b2c1081c3e4d913d8757756bef47631f694b7a3d59b55c888768672c2059e9 \ size 14489747 \ ${libmarias3_distfile} \ rmd160 bf90ab4856c1fec9272309134837f1f50fdb8de8 \ sha256 0c9ce4cc300bfefcb9dd188a46d736c0e119210c01cbfb04725b07f5330be679 \ size 364270 worksrcdir ${github.project}-${git.branch} post-extract { # put the libmariadb_github_project directory into position # remove the original directory ui_debug "delete ${worksrcpath}/libmariadb" delete ${worksrcpath}/libmariadb ui_debug "move ${workpath}/${libmariadb_distname} ${worksrcpath}/libmariadb" move ${workpath}/${libmariadb_distname} ${worksrcpath}/libmariadb # put the wsrep_github_project directory into position # remove the original directory ui_debug "delete ${worksrcpath}/wsrep-lib" delete ${worksrcpath}/wsrep-lib ui_debug "move ${workpath}/${wsrep_distname} ${worksrcpath}/wsrep-lib" move ${workpath}/${wsrep_distname} ${worksrcpath}/wsrep-lib # put the wsrep_api_github_project directory into position # remove the original directory ui_debug "delete ${worksrcpath}/wsrep-lib/wsrep-API/v26" delete ${worksrcpath}/wsrep-lib/wsrep-API/v26 ui_debug "move ${workpath}/${wsrep_api_distname} ${worksrcpath}/wsrep-lib/wsrep-API/v26" move ${workpath}/${wsrep_api_distname} ${worksrcpath}/wsrep-lib/wsrep-API/v26 # put the columnstore_github_project directory into position # remove the original directory ui_debug "delete ${worksrcpath}/storage/columnstore/columnstore" delete ${worksrcpath}/storage/columnstore/columnstore ui_debug "move ${workpath}/${columnstore_distname} ${worksrcpath}/storage/columnstore/columnstore" move ${workpath}/${columnstore_distname} ${worksrcpath}/storage/columnstore/columnstore # put the libmarias3_github_project directory into position # remove the original directory ui_debug "delete ${worksrcpath}/storage/maria/libmarias3" delete ${worksrcpath}/storage/maria/libmarias3 ui_debug "move ${workpath}/${libmarias3_distname} ${worksrcpath}/storage/maria/libmarias3" move ${workpath}/${libmarias3_distname} ${worksrcpath}/storage/maria/libmarias3 } depends_build-append port:bison depends_lib-append port:curl \ port:judy \ port:libxml2 \ port:ncurses \ port:pcre2 \ port:tcp_wrappers \ port:zlib depends_run-append port:mysql_select select.group mysql select.file ${filespath}/${name_mysql} post-extract { file mkdir ${cmake.build_dir}/macports copy ${filespath}/macports-default.cnf \ ${filespath}/my.cnf \ ${cmake.build_dir}/macports/ } patch.pre_args -p1 patchfiles patch-cmake-install_layout.cmake.diff \ patch-CMakeLists.txt.diff \ patch-libmariadb_cmake_install.cmake.diff \ patch-libmariadb_libmariadb_CMakeLists.txt.diff \ patch-server_storage_perfschema_my_thread.h.diff \ patch-cmake_mysql_version.cmake.diff \ patch-cmake_mysql_columnstore_version.cmake.diff # temporary fix for C/C++ flag discovery patchfiles-append patch-fix-flag-discovery.diff post-patch { reinplace "s|@NAME@|${name_mysql}|g" \ ${worksrcpath}/cmake/install_layout.cmake reinplace "s|@NAME@|${name_mysql}|g" \ ${worksrcpath}/libmariadb/cmake/install.cmake reinplace "s|@NAME@|${name_mysql}|g" \ ${cmake.build_dir}/macports/macports-default.cnf \ ${cmake.build_dir}/macports/my.cnf reinplace "s|@PREFIX@|${prefix}|g" \ ${cmake.build_dir}/macports/macports-default.cnf \ ${cmake.build_dir}/macports/my.cnf move ${worksrcpath}/VERSION ${worksrcpath}/VERSION.txt move ${worksrcpath}/storage/columnstore/columnstore/VERSION ${worksrcpath}/storage/columnstore/columnstore/VERSION.txt } configure.args-delete \ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib configure.args-append \ -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${name_mysql}/mysql \ -DINSTALL_LAYOUT:STRING=MACPORTS \ -DSYSCONFDIR:PATH=${prefix}/etc/${name_mysql} \ -DMYSQL_UNIX_ADDR:PATH=${prefix}/var/run/${name_mysql}/mysqld.sock \ -DMYSQL_DATADIR:PATH=${prefix}/var/db/${name_mysql} \ -DDEFAULT_CHARSET:STRING=utf8 \ -DDEFAULT_COLLATION:STRING=utf8_general_ci \ -DWITH_EMBEDDED_SERVER:BOOL=ON \ -DWITH_ZLIB:STRING=system \ -DWITH_UNIT_TESTS:BOOL=ON \ -DWITHOUT_CASSANDRA_STORAGE_ENGINE:BOOL=ON \ -DWITHOUT_MROONGA_STORAGE_ENGINE:BOOL=ON \ -DWITHOUT_ROCKSDB_STORAGE_ENGINE:BOOL=ON \ -DWITHOUT_TOKUDB_STORAGE_ENGINE:BOOL=ON \ -DENABLE_GCOV:BOOL=OFF \ -DENABLE_DTRACE:BOOL=OFF \ -DWITH_READLINE:BOOL=ON \ -DWITH_LIBWRAP:BOOL=ON \ -DWITH_SSL:STRING=yes \ -DWITH_SSL_PATH=${prefix} \ -DMYSQL_MAINTAINER_MODE:STRING=AUTO \ -DICONV_LIBRARIES=${prefix}/lib/libiconv.dylib \ -DICONV_INCLUDE_DIR:PATH=${prefix}/include \ -DCONNECT_WITH_JDBC=OFF \ -DCONNECT_WITH_LIBXML2=ON \ -DCONNECT_WITH_MONGO=OFF \ -DCONNECT_WITH_ODBC=OFF \ -DCONNECT_WITH_REST=OFF \ -DWITH_PCRE=system \ -DBISON_EXECUTABLE=${prefix}/bin/bison configure.checks.implicit_function_declaration.whitelist-append select getthrid post-destroot { # proc portdestroot::destroot_finish fails to find and compress our man pages # so borrow the compress command and run on our files now. set manpath "${destroot}${prefix}/share/man" set gzip [findBinary gzip ${portutil::autoconf::gzip_path}] foreach manpage [glob -type f ${destroot}${prefix}/share/man/${name_mysql}/man\[1-9\]/*] { # Fix paths in manpages reinplace -q "s|/etc/|${prefix}/etc/${name_mysql}/|g" ${manpage} # Compress all manpages with gzip system "$gzip -9vf ${manpage}" } #foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${name_mysql}/support-files/my-*.cnf] { # # Fix paths in sample configuration files # reinplace -q "s|/etc/my.cnf|${prefix}/etc/${name_mysql}/my.cnf|g" ${samp_conffile} #} xinstall -m 755 -o root -d \ ${destroot}${prefix}/etc/${name_mysql} copy ${cmake.build_dir}/macports/macports-default.cnf \ ${destroot}${prefix}/etc/${name_mysql}/ xinstall -m 755 -o root -d \ ${destroot}${prefix}/share/${name_mysql}/support-files/macports copy ${cmake.build_dir}/macports/my.cnf \ ${destroot}${prefix}/share/${name_mysql}/support-files/macports/ } post-install { if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${name_mysql}/org.macports.${name_mysql}-server.plist]} { ui_msg "The ${name_mysql} client has been installed." ui_msg "To install the ${name_mysql} server, install the ${name_mysql}-server port." } } post-activate { if {![file exists ${prefix}/etc/${name_mysql}/my.cnf]} { copy ${prefix}/share/${name_mysql}/support-files/macports/my.cnf \ ${prefix}/etc/${name_mysql}/ } } variant system_readline description {Use system readline instead of bundled readline} { # Add readline support. # "-DWITH_READLINE:BOOL=OFF" has the peculiar meaning "do not use the bundled copy # of readline but use the system's (i.e. MacPorts') copy of readline" depends_lib-append port:readline configure.args-delete -DWITH_READLINE:BOOL=ON configure.args-append -DWITH_READLINE:BOOL=OFF } notes " On activation if no ${prefix}/etc/${name_mysql}/my.cnf file exists one will be created which loads ${prefix}/etc/${name_mysql}/macports-default.cnf. If a ${prefix}/etc/${name_mysql}/my.cnf file exists MacPorts does not touch it and any changes you make to ${prefix}/etc/${name_mysql}/my.cnf will be preserved (e.g., during port upgrades, deactivations or activations). ${prefix}/etc/${name_mysql}/my.cnf is a good place to customize your ${name_mysql} installation. Any changes made to ${prefix}/etc/${name_mysql}/macports-default.cnf will be lost during port upgrades, deactivations or activations so you are advised to not make changes here. Currently ${prefix}/etc/${name_mysql}/macports-default.cnf contains only one directive; to disable networking. With disabled networking it is possible to install and have running all the MacPorts mysql ports simultaneously. " github.livecheck.regex (${version_branch}.\[0-9\]+) } subport ${name_mysql}-server { revision ${revision_server} license BSD description (Beta version) Run ${name_mysql} as server long_description {*}${description} supported_archs noarch distfiles depends_run port:${name_mysql} if {"darwin" eq ${os.platform} && ${os.major} > 8} { set mysqluser _mysql } else { set mysqluser mysql } add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server pre-extract { copy ${filespath}/org.macports.mysql-server.plist ${workpath}/org.macports.${subport}.plist } post-patch { reinplace "s|@NAMEMYSQL@|${name_mysql}|g" \ ${workpath}/org.macports.${subport}.plist reinplace "s|@PREFIX@|${prefix}|g" \ ${workpath}/org.macports.${subport}.plist reinplace "s|@SUBPORT@|${subport}|g" \ ${workpath}/org.macports.${subport}.plist reinplace "s|@USER@|${mysqluser}|g" \ ${workpath}/org.macports.${subport}.plist reinplace "s|@GROUP@|${mysqluser}|g" \ ${workpath}/org.macports.${subport}.plist } use_configure no build {} destroot { xinstall -d -m 755 ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${subport} xinstall -m 0644 -o root -W ${workpath} \ org.macports.${subport}.plist \ ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${subport} xinstall -d -m 755 ${destroot}/Library/LaunchDaemons ln -s ${prefix}/etc/LaunchDaemons/org.macports.${subport}/org.macports.${subport}.plist \ ${destroot}/Library/LaunchDaemons/org.macports.${subport}.plist xinstall -m 755 -o root -d \ ${destroot}${prefix}/var/run xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ ${destroot}${prefix}/etc/${name_mysql} \ ${destroot}${prefix}/var/db/${name_mysql} \ ${destroot}${prefix}/var/log/${name_mysql} \ ${destroot}${prefix}/var/run/${name_mysql} destroot.keepdirs-append \ ${destroot}${prefix}/var/db/${name_mysql} \ ${destroot}${prefix}/var/log/${name_mysql} \ ${destroot}${prefix}/var/run/${name_mysql} } notes " If this is a new install you might want to run: \$ sudo -u ${mysqluser} ${prefix}/lib/${name_mysql}/bin/mysql_install_db " livecheck.type none } homepage https://mariadb.org/