diff --git a/projects/mysql.com/v5_7/package.yml b/projects/mysql.com/v5_7/package.yml new file mode 100644 index 0000000000..a2e6715967 --- /dev/null +++ b/projects/mysql.com/v5_7/package.yml @@ -0,0 +1,115 @@ +# MySQL 5.7 — legacy line. +# +# 5.7 reached EOL in October 2023 — homebrew dropped its `mysql@5.7` +# formula in 2024. Some legacy applications (Rails 5.x apps, +# WordPress legacy sites, custom replication setups) still pin to +# 5.7 because the 8.0 migration broke their schema or auth modes. +# +# Build is best-effort — 5.7 needs older C++ idioms, boost 1.59, +# OpenSSL 1.0.x patterns. Expect to iterate. +# +# Closes part of pkgxdev/pantry#99 (Top 300 holdout #735). + +distributable: + url: https://cdn.mysql.com/Downloads/MySQL-{{version.marketing}}/mysql-boost-{{version}}.tar.gz + strip-components: 1 + +# Pin to the 5.7.x stream. mysql-server tags use "mysql-5.7.X" format. +versions: + github: mysql/mysql-server/tags + # `github:` mode silently ignores `match:`. Negative lookahead in + # `ignore:` also doesn't work (RE2-like regex, no lookahead). + # Use `transform:` instead — return the stripped 5.7.X version for + # matching tags, undefined for everything else. + transform: | + v => { + const m = v.match(/^mysql-(5\.7\.\d+)$/); + return m ? m[1] : undefined; + } + +# Linux only. MySQL 5.7's bundled boost 1.59 / InnoDB need gcc 8 to +# compile (modern clang rejects boost mpl's integral_wrapper.hpp +# non-type template usage — confirmed on both linux-with-clang and the +# macOS clang builders). The gcc/v8 bottle is itself linux-only (darwin's +# old-SDK situation makes gcc 8 hard to bring up), so there's no viable +# darwin compiler for this legacy line. Ship linux; darwin users needing +# 5.7 are on their own toolchain. +platforms: + - linux/x86-64 + - linux/aarch64 + +dependencies: + unicode.org: '*' + libevent.org: ^2 + openssl.org: ^1.1 + zlib.net: ^1 + curl.se: '*' + thrysoee.dk/editline: '*' + linux: + # Runtime libstdc++. gcc 8 produced older GLIBCXX_3.4.25-ish + # symver references which libstdcxx ^14 (forward-compatible) can + # resolve. Same lockstep rationale as the main mysql recipe + # (PR #13104) — pantry doesn't auto-propagate stdenv.cc.cc.lib + # the way nixpkgs does, so the runtime libstdc++ must be + # explicit. + gnu.org/gcc/libstdcxx: ^14 + +build: + dependencies: + cmake.org: ^3 + gnu.org/bison: '*' + linux: + # MySQL 5.7's vendored boost 1.59 + InnoDB use pre-C++17 idioms + # that modern gcc/clang reject. Build with the dedicated gcc 8 + # bottle (which is itself linux-only — see the platforms note). + gnu.org/gcc/v8: '*' + working-directory: build + script: + # Force the gcc 8 bottle as the compiler. brewkit's toolchain wrappers + # symlink cc/c++/gcc/g++ ALL to clang, so cmake would otherwise detect + # Clang (not gcc 8) — and MySQL 5.7's bundled boost 1.59 / InnoDB then + # fail (clang rejects boost mpl's `integral_wrapper.hpp` non-type + # template usage). Point CMAKE_C/CXX_COMPILER straight at the gcc 8 + # bottle's real binaries (absolute path, past the wrappers) so the + # pre-C++17 sources build. (5.7's bundled boost also has an old + # `cmake_minimum_required` that CMake 4.x rejects without the policy + # floor override.) + - run: | + export CMAKE_POLICY_VERSION_MINIMUM=3.5 + CC="{{deps.gnu.org/gcc/v8.prefix}}/bin/gcc" + CXX="{{deps.gnu.org/gcc/v8.prefix}}/bin/g++" + cmake .. $ARGS -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" + make --jobs {{ hw.concurrency }} install + env: + ARGS: + - -DCMAKE_INSTALL_PREFIX={{prefix}} + - -DCMAKE_BUILD_TYPE=Release + - -DDOWNLOAD_BOOST=0 + - -DWITH_BOOST=../boost # bundled + - -DWITH_SSL=system + - -DWITH_ZLIB=system + - -DWITH_LIBEVENT=system + - -DWITH_EDITLINE=system + - -DENABLED_LOCAL_INFILE=1 + - -DWITHOUT_TOKUDB=1 + - -DWITHOUT_ROCKSDB=1 + - -DWITHOUT_MROONGA=1 + - -DWITHOUT_SPIDER=1 + # Don't force CXX_STANDARD=17 — the whole point of pinning gcc 8 + # is that 5.7's vendored sources are pre-C++17. Let the gcc 8 + # default (gnu++14) apply, matching homebrew's mysql@5.7 build. + +provides: + - bin/mysql + - bin/mysqld + - bin/mysqldump + - bin/mysqladmin + - bin/mysqlimport + - bin/mysqlcheck + - bin/mysqlshow + - bin/mysqlbinlog + - bin/mysql_secure_installation + - bin/mysql_config + +test: + - mysql --version | grep "5\\.7\\."