Created attachment 150434 [details] bsd.database.mk patch against r374417 When building ports via poudriere, it's possible to specify default versions of MySQL (or PostgreSQL), however when including default values, we see runtime dependencies still linking against the system default. For example, if we specify 5.6, we have a runtime dependency on MySQL 5.5. DEFAULT_VERSIONS= pgsql=9.4 mysql=56p This happens because _MYSQL_VER is overridden unconditionally based on the version information found in `${LOCALBASE}/bin/mysql --version`. Because we run with an internally modified version of MySQL, we have two options: 1) Patch the MySQL version string 2) Teach ports to honor the default version when specified We think option #2 is the more correct approach. The attached patch fixes our package environment so that runtime dependencies are correct. ``` Index: Mk/bsd.database.mk =================================================================== --- Mk/bsd.database.mk (revision 374417) +++ Mk/bsd.database.mk (working copy) @@ -116,6 +116,7 @@ MYSQL100m_LIBVER= 18 # Setting/finding MySQL version we want. +.if !defined(DEFAULT_MYSQL_VER) .if exists(${LOCALBASE}/bin/mysql) _MYSQL!= ${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib \([0-9]\{1,2\}\)\.\([0-9]*\).*/\1\2/' _PERCONA!= ${LOCALBASE}/bin/mysql --version | ${GREP} Percona | wc -l @@ -129,6 +130,7 @@ _MYSQL_VER= ${_MYSQL} .endif .endif +.endif .if defined(WANT_MYSQL_VER) .if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${WANT_MYSQL_VER} ```
The patch doesn't work: MYSQL_DEFAULT is always defined so DEFAULT_MYSQL_VER too. Also this behavior is intended to prevent installation of conflicting versions of mysql when one version is already installed. Since you use a patched version of MySQL, you should patch the version string too.