[90896] trunk/dports/databases

Jeremy Huddleston jeremyhu at macports.org
Sun Mar 25 13:37:40 PDT 2012


I notice that this port forces llvm-gcc as the compiler with no comment as to why.  Can this be done conditionally with an explanation in a comment in the Portfile?  mysql5 uses llvm-gcc as a fallback from clang due to a bug in mysql's build system.  I'm assuming that bug is still there in 5.5, so the comment (and check) should probably be copied from mysql5.

--Jeremy

On Mar 17, 2012, at 10:13, pixilla at macports.org wrote:

> Revision: 90896
>          https://trac.macports.org/changeset/90896
> Author:   pixilla at macports.org
> Date:     2012-03-17 10:13:21 -0700 (Sat, 17 Mar 2012)
> Log Message:
> -----------
> databases/mysql55:
> - New port for mysql 5.5.
> 
> Modified Paths:
> --------------
>    trunk/dports/databases/mysql55/Portfile
> 
> Added Paths:
> -----------
>    trunk/dports/databases/mysql55/
>    trunk/dports/databases/mysql55/files/
>    trunk/dports/databases/mysql55/files/mysql55
>    trunk/dports/databases/mysql55/files/patch-cmake-install_layout.cmake.diff
> 
> Modified: trunk/dports/databases/mysql55/Portfile
> ===================================================================
> --- trunk/dports/databases/percona/Portfile	2012-03-15 01:18:25 UTC (rev 90814)
> +++ trunk/dports/databases/mysql55/Portfile	2012-03-17 17:13:21 UTC (rev 90896)
> @@ -1,138 +1,182 @@
> # -*- 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
> # $Id$
> 
> -PortSystem              1.0
> -PortGroup               archcheck 1.0
> -PortGroup               cmake 1.0
> +PortSystem          1.0
> 
> -name                    percona
> -conflicts               mysql4 mysql5 mysql5-devel mariadb
> -set version_mysql       5.5.20
> -set major               [join [lrange [split ${version_mysql} .] 0 0] .]
> -set branch              [join [lrange [split ${version_mysql} .] 0 1] .]
> -set release             24.1
> -version                 ${version_mysql}-${release}
> -homepage                http://www.percona.com/
> -categories              databases
> -platforms               darwin
> -maintainers             mac.com:quest openmaintainer
> -license                 GPL-2
> -distname                Percona-Server-${version_mysql}-rel${release}
> -dist_subdir             mysql5
> -use_parallel_build      yes
> +name                mysql55
> +version             5.5.21
> +categories          databases
> +platforms           darwin
> +maintainers         pixilla openmaintainer
> 
> -description \
> -    Multithreaded SQL database server
> +subport mysql55 {
> 
> -long_description \
> -    Percona is an open-source, multi-threaded SQL database \
> -    with a command syntax very similar to mSQL.
> +    PortGroup           archcheck 1.0
> +    PortGroup           cmake 1.0
> +    PortGroup           select 1.0
> +    
> +    set branch          [join [lrange [split ${version} .] 0 1] .]
> 
> -master_sites \
> -    http://www.percona.com/redir/downloads/Percona-Server-${branch}/Percona-Server-${version}/source/
> -
> -checksums md5     0f61fde172ed1168a3ca9b7b003a6698 \
> -          sha1    19dde017b1c257c9f0aecd2247906f224d6fe147 \
> -          rmd160  5fd374a019b38a44b89514aa5c3c6931a863e972
> -
> -depends_lib-append      port:zlib \
> -                        port:openssl \
> +    license             GPL-2
> +    description         Multithreaded SQL database server
> +    long_description    MySQL is an open-source, multi-threaded SQL database with a command \
> +                        syntax very similar to mSQL.
> +    
> +    homepage            http://www.mysql.com/
> +    master_sites \
> +        http://mysql.mirrors.pair.com/Downloads/MySQL-${branch}/ \
> +        http://mysql.he.net/Downloads/MySQL-${branch}/ \
> +        http://mirrors.sunsite.dk/mysql/Downloads/MySQL-${branch}/ \
> +        http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \
> +        http://mirror.facebook.net/mysql/Downloads/MySQL-${branch}/ \
> +        http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
> +    
> +    
> +    distname            mysql-${version}
> +    dist_subdir         mysql5
> +    use_parallel_build  yes
> +    
> +    patch.pre_args      -p1
> +    patchfiles          patch-cmake-install_layout.cmake.diff
> +    
> +    checksums           rmd160  d31c1be22ac80f1c95e8f28c41ec1c82cba995cd \
> +                        sha256  2471fedc42bafb8210f7ff132172f6f57933f9727cc61d98197a91cfbfdf78cd
> +    
> +    depends_lib-append  port:zlib \
>                         port:readline \
>                         port:cmake
> -
> -archcheck.files         lib/libz.dylib \
> +    depends_run         port:mysql_select
> +    
> +    select.group        mysql
> +    select.file         ${filespath}/${name}
> +    
> +    archcheck.files     lib/libz.dylib \
>                         lib/libssl.dylib \
>                         lib/libreadline.dylib
> -
> -set major_version       [strsed ${version} {s/\..*$//}]
> -set mysql               mysql${major_version}
> -set libdir              ${prefix}/lib/${mysql}
> -set bindir              ${libdir}/bin
> -set dbdir               ${prefix}/var/db/${mysql}
> -set sysconfdir          ${prefix}/etc/${mysql}
> -set sockfile            ${prefix}/var/run/mysql5/mysqld.sock
> -
> -if {"darwin" == ${os.platform} && ${os.major} > 8} {
> -    set mysqluser       _mysql
> -} else {
> -    set mysqluser       mysql
> -}
> -
> -configure.args-append       -DINSTALL_MANDIR:STRING=share/man \
> -                            -DINSTALL_INFODIR:STRING=share/info \
> -                            -DMYSQL_DATADIR:PATH=${dbdir} \
> -                            -DFEATURE_SET:STRING=community \
> -                            -DINSTALL_BINDIR:STRING=lib/${mysql}/bin \
> -                            -DINSTALL_SCRIPTDIR:STRING=lib/${mysql}/bin \
> -                            -DINSTALL_SBINDIR:STRING=lib/${mysql}/libexec \
> -                            -DINSTALL_INCLUDEDIR:STRING=include/${mysql}/mysql \
> -                            -DINSTALL_LIBDIR:STRING=lib/${mysql}/mysql \
> -                            -DINSTALL_PLUGINDIR:STRING=lib/${mysql}/mysql/plugin \
> -                            -DINSTALL_DOCDIR:STRING=share/doc/${mysql} \
> -                            -DINSTALL_DOCREADMEDIR:STRING=share/doc/${mysql} \
> -                            -DINSTALL_MYSQLDATADIR:STRING=share/${mysql} \
> -                            -DINSTALL_MYSQLSHAREDIR:STRING=share/${mysql}/mysql \
> -                            -DINSTALL_SHAREDIR:STRING=share/${mysql} \
> -                            -DINSTALL_SUPPORTFILESDIR:STRING=share/${mysql}/mysql \
> -                            -DDEFAULT_CHARSET:STRING=utf8 \
> -                            -DDEFAULT_COLLATION:STRING=utf8_general_ci \
> -                            -DMYSQL_UNIX_ADDR:PATH=${sockfile} \
> -                            -DSYSCONFDIR:PATH=${sysconfdir} \
> -                            -DWITH_EMBEDDED_SERVER:BOOL=OFF \
> -                            -DWITH_READLINE:BOOL=ON \
> -                            -DWITH_SSL:STRING=yes \
> -                            -DWITH_ZLIB:STRING=system \
> -                            -DWITH_UNIT_TESTS:BOOL=OFF \
> -                            -DENABLE_GCOV:BOOL=OFF \
> -                            -DENABLE_DTRACE:BOOL=OFF
> -
> -# Set compiler
> -configure.compiler llvm-gcc-4.2
> -
> -post-build {
> -    set dirs ${worksrcpath}
> -    foreach dir ${dirs} {
> -        reinplace -E {s|-arch [a-z0-9_]+||g} \
> -            ${dir}/scripts/mysql_config \
> -            ${dir}/scripts/mysqlbug
> +    
> +    set mysql           ${name}
> +    set libdir          ${prefix}/lib/${mysql}
> +    set bindir          ${prefix}/bin
> +    set dbdir           ${prefix}/var/db/${mysql}
> +    set sysconfdir      ${prefix}/etc/${mysql}
> +    set sockfile        ${prefix}/var/run/${mysql}/mysqld.sock
> +    
> +    post-patch {
> +        reinplace "s|@NAME@|${name}|g" ${worksrcpath}/cmake/install_layout.cmake
> +        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/cmake/install_layout.cmake
>     }
> -}
> -
> -pre-destroot {
> -    xinstall -m 755 -d ${destroot}${sysconfdir}
> -    destroot.keepdirs-append ${destroot}${sysconfdir}
> -}
> -
> -post-destroot {
> -    # Delete directories we don't want
> -    delete ${destroot}${prefix}/data ${destroot}${prefix}/mysql-test ${destroot}${prefix}/sql-bench
> -    # Fix link lib paths
> -    foreach libname [glob -type f -tails -directory ${destroot}${libdir}/mysql *.dylib] {
> -        if {[file type ${destroot}${libdir}/mysql/${libname}] == "file"} {
> -            system "install_name_tool -id ${libdir}/mysql/${libname} ${destroot}${libdir}/mysql/${libname}"
> +    
> +    configure.args-delete \
> +                        -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib
> +    configure.args-append \
> +                        -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${name} \
> +                        -DINSTALL_LAYOUT=MACPORTS \
> +                        -DSYSCONFDIR:PATH=${prefix}/etc/${name} \
> +                        -DMYSQL_UNIX_ADDR:PATH=${prefix}/var/run/${name}/mysqld.sock \
> +                        -DMYSQL_DATADIR:PATH=${prefix}/var/db/${name} \
> +                        -DFEATURE_SET:STRING=community \
> +                        -DDEFAULT_CHARSET:STRING=utf8 \
> +                        -DDEFAULT_COLLATION:STRING=utf8_general_ci \
> +                        -DWITH_EMBEDDED_SERVER:BOOL=OFF \
> +                        -DWITH_READLINE:BOOL=ON \
> +                        -DWITH_ZLIB:STRING=system \
> +                        -DWITH_UNIT_TESTS:BOOL=OFF \
> +                        -DENABLE_GCOV:BOOL=OFF \
> +                        -DENABLE_DTRACE:BOOL=OFF
> +    
> +    # Set compiler
> +    configure.compiler  llvm-gcc-4.2
> +    
> +    post-build {
> +        set dirs ${worksrcpath}
> +        foreach dir ${dirs} {
> +            reinplace -E {s|-arch [a-z0-9_]+||g} \
> +                ${dir}/scripts/mysql_config \
> +                ${dir}/scripts/mysqlbug
>         }
>     }
> -    # Fix paths in manpages and sample configuration files
> -    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
> -        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
> +    
> +    pre-destroot {
> +        xinstall -m 755 -d ${destroot}${sysconfdir}
> +        destroot.keepdirs-append ${destroot}${sysconfdir}
>     }
> -    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
> -        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
> +    
> +    post-destroot {
> +        # Fix paths in manpages and sample configuration files
> +        foreach manpage [glob -type f ${destroot}${prefix}/share/man/${mysql}/man\[1-9\]/*] {
> +            reinplace "s|/etc/|${sysconfdir}/|g" ${manpage}
> +        }
> +        foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/support-files/my-*.cnf] {
> +            reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
> +        }
>     }
> -    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
> -    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
> -        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
> +    
> +    post-install {
> +        if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
> +            ui_msg "The MySQL client has been installed."
> +            ui_msg "If you also want a MySQL server, install the mysql5-server port."
> +        }
>     }
> +    
> +    variant openssl description {Enable OpenSSL support} {
> +    
> +        license-append          OpenSSL SSLeay
> +        depends_lib-append      port:openssl
> +        configure.args-append   -DWITH_SSL:STRING=ON
> +    }
> +    
> +    livecheck.type          regex
> +    livecheck.version       [lindex [split ${version} -] 0]
> +    livecheck.url           http://dev.mysql.com/
> +    livecheck.regex         "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>"
> }
> +subport mysql55-server {
> 
> -post-install {
> -    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
> -        ui_msg "The Percona client has been installed."
> -        ui_msg "If you also want a Percona server, install the percona-server port."
> +    license                 BSD
> +    description             Multithreaded SQL database server
> +    long_description        MySQL is an open-source, multi-threaded SQL database with a command \
> +                            syntax very similar to mSQL.
> +    
> +    homepage                http://www.mysql.com/
> +    supported_archs         noarch
> +    distfiles
> +    
> +    depends_run             port:${name}
> +    
> +    if {"darwin" == ${os.platform} && ${os.major} > 8} {
> +        set mysqluser       _mysql
> +    } else {
> +        set mysqluser       mysql
>     }
> -}
> -
> -livecheck.type          regex
> -livecheck.url           http://www.percona.com/downloads/Percona-Server-${branch}/
> -livecheck.version       ${version_mysql}-${release}
> -livecheck.regex         "/downloads/Percona-Server-${branch}/Percona-Server-(\[^/\]+)/"
> +    add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server
> +    
> +    startupitem.create      yes
> +    startupitem.name        ${name}
> +    startupitem.start       "${prefix}/share/${name}/support-files/mysql.server start"
> +    startupitem.stop        "${prefix}/share/${name}/support-files/mysql.server stop"
> +    
> +    use_configure           no
> +    
> +    build {}
> +    
> +    destroot {
> +        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
> +        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
> +            ${destroot}${prefix}/var/db/${name} \
> +            ${destroot}${prefix}/var/log/${name} \
> +            ${destroot}${prefix}/var/run/${name}
> +        destroot.keepdirs-append  \
> +            ${destroot}${prefix}/var/db/${name} \
> +            ${destroot}${prefix}/var/log/${name} \
> +            ${destroot}${prefix}/var/run/${name}
> +    }
> +    
> +    notes "
> +    
> +    If this is a new install you might want to run:
> +        \$ sudo -u ${mysqluser} mysql_install_db5
> +    
> +    "
> +    
> +    livecheck.type          none
> +}
> \ No newline at end of file
> 
> Added: trunk/dports/databases/mysql55/files/mysql55
> ===================================================================
> --- trunk/dports/databases/mysql55/files/mysql55	                        (rev 0)
> +++ trunk/dports/databases/mysql55/files/mysql55	2012-03-17 17:13:21 UTC (rev 90896)
> @@ -0,0 +1,48 @@
> +-
> +-
> +-
> +-
> +-
> +bin/innochecksum
> +bin/msql2mysql
> +bin/my_print_defaults
> +bin/myisam_ftdump
> +bin/myisamchk
> +bin/myisamlog
> +bin/myisampack
> +bin/mysql
> +bin/mysql_client_test
> +-
> +bin/mysql_config
> +bin/mysql_convert_table_format
> +bin/mysql_find_rows
> +bin/mysql_fix_extensions
> +-
> +bin/mysql_plugin
> +bin/mysql_secure_installation
> +bin/mysql_setpermission
> +bin/mysql_tzinfo_to_sql
> +bin/mysql_upgrade
> +bin/mysql_waitpid
> +bin/mysql_zap
> +bin/mysqlaccess
> +bin/mysqlaccess.conf
> +bin/mysqladmin
> +bin/mysqlbinlog
> +bin/mysqlbug
> +bin/mysqlcheck
> +bin/mysqld_multi
> +bin/mysqld_safe
> +bin/mysqldump
> +bin/mysqldumpslow
> +bin/mysqlhotcopy
> +bin/mysqlimport
> +bin/mysqlshow
> +bin/mysqlslap
> +bin/mysqltest
> +-
> +bin/perror
> +bin/replace
> +bin/resolve_stack_dump
> +bin/resolveip
> +-
> 
> Added: trunk/dports/databases/mysql55/files/patch-cmake-install_layout.cmake.diff
> ===================================================================
> --- trunk/dports/databases/mysql55/files/patch-cmake-install_layout.cmake.diff	                        (rev 0)
> +++ trunk/dports/databases/mysql55/files/patch-cmake-install_layout.cmake.diff	2012-03-17 17:13:21 UTC (rev 90896)
> @@ -0,0 +1,52 @@
> +--- a/cmake/install_layout.cmake	2012-03-15 07:14:58.000000000 -0700
> ++++ b/cmake/install_layout.cmake	2012-03-17 08:44:13.000000000 -0700
> +@@ -68,7 +68,7 @@
> + ENDIF()
> + 
> + SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
> +-CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")
> ++CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4, MACPORTS")
> + 
> + IF(UNIX)
> +   IF(INSTALL_LAYOUT MATCHES "RPM")
> +@@ -86,7 +86,7 @@
> +     SET(CMAKE_INSTALL_PREFIX ${default_prefix}
> +       CACHE PATH "install prefix" FORCE)
> +   ENDIF()
> +-  SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
> ++  SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4" "MACPORTS")
> +   LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
> +   IF(ind EQUAL -1)
> +     MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
> +@@ -214,6 +214,31 @@
> + SET(INSTALL_MYSQLDATADIR_SVR4           "/var/lib/mysql")
> + SET(INSTALL_PLUGINTESTDIR_SVR4          ${plugin_tests})
> + 
> ++#
> ++# MACPORTS layout
> ++#
> ++SET(INSTALL_BINDIR_MACPORTS             "lib/@NAME@/bin")
> ++SET(INSTALL_SBINDIR_MACPORTS            "lib/@NAME@/bin")
> ++SET(INSTALL_SCRIPTDIR_MACPORTS          "lib/@NAME@/scripts")
> ++#
> ++SET(INSTALL_LIBDIR_MACPORTS             "lib/@NAME@/mysql")
> ++SET(INSTALL_PLUGINDIR_MACPORTS          "lib/@NAME@/plugin")
> ++#
> ++SET(INSTALL_INCLUDEDIR_MACPORTS         "include/@NAME@")
> ++#
> ++SET(INSTALL_DOCDIR_MACPORTS             "share/docs/@NAME@")
> ++SET(INSTALL_DOCREADMEDIR_MACPORTS       "share/docs/@NAME@")
> ++SET(INSTALL_MANDIR_MACPORTS             "share/man/@NAME@")
> ++SET(INSTALL_INFODIR_MACPORTS            "share/docs/@NAME@")
> ++#
> ++SET(INSTALL_SHAREDIR_MACPORTS           "share/@NAME@")
> ++SET(INSTALL_MYSQLSHAREDIR_MACPORTS      "share/@NAME@")
> ++SET(INSTALL_MYSQLTESTDIR_MACPORTS       "share/@NAME@/mysql-test")
> ++SET(INSTALL_SQLBENCHDIR_MACPORTS        "share/@NAME@")
> ++SET(INSTALL_SUPPORTFILESDIR_MACPORTS    "share/@NAME@/support-files")
> ++#
> ++SET(INSTALL_MYSQLDATADIR_MACPORTS       "var/db/@NAME@")
> ++SET(INSTALL_PLUGINTESTDIR_MACPORTS      ${plugin_tests})
> + 
> + # Clear cached variables if install layout was changed
> + IF(OLD_INSTALL_LAYOUT)
> _______________________________________________
> macports-changes mailing list
> macports-changes at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-changes



More information about the macports-dev mailing list