From 7d44ceeb2c3a00ac020d76e54d0ff9f9800048d1 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Tue, 25 Jun 2019 17:02:02 -0400 Subject: [PATCH 1/2] mysql55: remove package --- .../libraries/unixODBCDrivers/default.nix | 4 +- pkgs/servers/sql/mysql/5.5.17-cygwin.patch | 44 --------- .../sql/mysql/5.5.17-export-symbols.patch | 22 ----- pkgs/servers/sql/mysql/5.5.x.nix | 93 ------------------- pkgs/top-level/all-packages.nix | 5 - 5 files changed, 2 insertions(+), 166 deletions(-) delete mode 100644 pkgs/servers/sql/mysql/5.5.17-cygwin.patch delete mode 100644 pkgs/servers/sql/mysql/5.5.17-export-symbols.patch delete mode 100644 pkgs/servers/sql/mysql/5.5.x.nix diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index 7d4c6c7a2994..7b72e12a66b2 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, unixODBC, cmake, postgresql, mysql55, mariadb, sqlite, zlib, libxml2, dpkg, lib, openssl, kerberos, curl, libuuid, autoPatchelfHook }: +{ fetchurl, stdenv, unixODBC, cmake, postgresql, mysql, mariadb, sqlite, zlib, libxml2, dpkg, lib, openssl, kerberos, curl, libuuid, autoPatchelfHook }: # I haven't done any parameter tweaking.. So the defaults provided here might be bad @@ -67,7 +67,7 @@ }; nativeBuildInputs = [ cmake ]; - buildInputs = [ unixODBC mysql55 ]; + buildInputs = [ unixODBC mysql ]; cmakeFlags = [ "-DWITH_UNIXODBC=1" ]; diff --git a/pkgs/servers/sql/mysql/5.5.17-cygwin.patch b/pkgs/servers/sql/mysql/5.5.17-cygwin.patch deleted file mode 100644 index f5178cd3f390..000000000000 --- a/pkgs/servers/sql/mysql/5.5.17-cygwin.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- mysql-5.5.17/cmake/install_macros.cmake 2011-10-12 07:10:24.000000000 -0500 -+++ mysql-5.5.17/cmake/install_macros.cmake 2011-11-07 23:19:35.772837800 -0600 -@@ -230,7 +230,13 @@ FUNCTION(MYSQL_INSTALL_TARGETS) - IF(ARG_COMPONENT) - SET(COMP COMPONENT ${ARG_COMPONENT}) - ENDIF() -- INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) -+ IF(${ARG_DESTINATION} STREQUAL "${INSTALL_LIBDIR}") -+ INSTALL(TARGETS ${TARGETS} LIBRARY DESTINATION ${ARG_DESTINATION} -+ RUNTIME DESTINATION bin -+ ARCHIVE DESTINATION ${ARG_DESTINATION} ${COMP}) -+ ELSE() -+ INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) -+ ENDIF() - SET(INSTALL_LOCATION ${ARG_DESTINATION} ) - INSTALL_DEBUG_SYMBOLS("${TARGETS}") - SET(INSTALL_LOCATION) ---- mysql-5.5.17/libmysql/CMakeLists.txt 2011-10-12 07:10:24.000000000 -0500 -+++ mysql-5.5.17/libmysql/CMakeLists.txt 2011-11-08 03:19:31.379219300 -0600 -@@ -214,6 +214,7 @@ IF(NOT DISABLE_SHARED) - SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1) - SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1) - -+ IF(NOT CYGWIN) - # Install links to libmysqlclient.so (client_r) - GET_VERSIONED_LIBNAME( - "${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r" -@@ -231,5 +232,6 @@ IF(NOT DISABLE_SHARED) - linkname) - INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) - ENDFOREACH() -+ ENDIF(NOT CYGWIN) - ENDIF() - ENDIF() ---- mysql-5.5.17/strings/dtoa.c 2011-10-12 07:10:25.000000000 -0500 -+++ mysql-5.5.17/strings/dtoa.c 2011-11-07 20:38:05.064690100 -0600 -@@ -36,6 +36,7 @@ - - ***************************************************************/ - -+#define __STRICT_ANSI__ - #include /* for EOVERFLOW on Windows */ - #include - #include /* for memcpy and NOT_FIXED_DEC */ diff --git a/pkgs/servers/sql/mysql/5.5.17-export-symbols.patch b/pkgs/servers/sql/mysql/5.5.17-export-symbols.patch deleted file mode 100644 index edc93c44dfe3..000000000000 --- a/pkgs/servers/sql/mysql/5.5.17-export-symbols.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- mysql-5.5.17/libmysql/CMakeLists.txt 2011-10-12 07:10:24.000000000 -0500 -+++ mysql-5.5.17/libmysql/CMakeLists.txt 2011-11-08 03:19:31.379219300 -0600 -@@ -25,6 +25,11 @@ INCLUDE_DIRECTORIES( - ADD_DEFINITIONS(${SSL_DEFINES}) - - SET(CLIENT_API_FUNCTIONS -+dynstr_free -+dynstr_append_mem -+dynstr_append_os_quoted -+dynstr_realloc -+init_dynamic_string - get_tty_password - handle_options - load_defaults -@@ -131,6 +136,7 @@ mysql_server_end - mysql_set_character_set - mysql_get_character_set_info - mysql_stmt_next_result -+strfill - - CACHE INTERNAL "Functions exported by client API" - diff --git a/pkgs/servers/sql/mysql/5.5.x.nix b/pkgs/servers/sql/mysql/5.5.x.nix deleted file mode 100644 index e089640a5b6f..000000000000 --- a/pkgs/servers/sql/mysql/5.5.x.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ stdenv, fetchpatch, fetchurl, cmake, bison, ncurses, openssl -, readline, zlib, perl, cctools, CoreServices }: - -# Note: zlib is not required; MySQL can use an internal zlib. - -let -self = stdenv.mkDerivation rec { - name = "mysql-${version}"; - version = "5.5.62"; - - src = fetchurl { - url = "mirror://mysql/MySQL-5.5/${name}.tar.gz"; - sha256 = "1mwrzwk9ap09s430fpdkyhvx5j2syd3xj2hyfzvanjphq4xqbrxi"; - }; - - patches = - # Minor type error that is a build failure as of clang 6. - stdenv.lib.optional stdenv.cc.isClang (fetchpatch { - url = "https://svn.freebsd.org/ports/head/databases/mysql55-server/files/patch-sql_sql_partition.cc?rev=469888"; - extraPrefix = ""; - sha256 = "09sya27z3ir3xy5mrv3x68hm274594y381n0i6r5s627x71jyszf"; - }) ++ - stdenv.lib.optionals stdenv.isCygwin [ - ./5.5.17-cygwin.patch - ./5.5.17-export-symbols.patch - ]; - - preConfigure = stdenv.lib.optional stdenv.isDarwin '' - ln -s /bin/ps $TMPDIR/ps - export PATH=$PATH:$TMPDIR - ''; - - buildInputs = [ cmake bison ncurses openssl readline zlib ] - ++ stdenv.lib.optionals stdenv.isDarwin [ perl cctools CoreServices ]; - - enableParallelBuilding = true; - - cmakeFlags = [ - "-DWITH_SSL=yes" - "-DWITH_READLINE=yes" - "-DWITH_EMBEDDED_SERVER=yes" - "-DWITH_ZLIB=yes" - "-DHAVE_IPV6=yes" - "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" - "-DMYSQL_DATADIR=/var/lib/mysql" - "-DINSTALL_SYSCONFDIR=etc/mysql" - "-DINSTALL_INFODIR=share/mysql/docs" - "-DINSTALL_MANDIR=share/man" - "-DINSTALL_PLUGINDIR=lib/mysql/plugin" - "-DINSTALL_SCRIPTDIR=bin" - "-DINSTALL_INCLUDEDIR=include/mysql" - "-DINSTALL_DOCREADMEDIR=share/mysql" - "-DINSTALL_SUPPORTFILESDIR=share/mysql" - "-DINSTALL_MYSQLSHAREDIR=share/mysql" - "-DINSTALL_DOCDIR=share/mysql/docs" - "-DINSTALL_SHAREDIR=share/mysql" - "-DINSTALL_MYSQLTESTDIR=" - "-DINSTALL_SQLBENCHDIR=" - ]; - - NIX_CFLAGS_COMPILE = - stdenv.lib.optionals stdenv.cc.isGNU [ "-fpermissive" ] # since gcc-7 - ++ stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-c++11-narrowing" ]; # since clang 6 - - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; - - prePatch = '' - sed -i -e "s|/usr/bin/libtool|libtool|" cmake/libutils.cmake - ''; - postInstall = '' - sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db - rm -r $out/data "$out"/lib/*.a - ''; - - passthru = { - client = self; - connector-c = self; - server = self; - mysqlVersion = "5.5"; - }; - - meta = with stdenv.lib; { - homepage = https://www.mysql.com/; - description = "The world's most popular open source database"; - platforms = platforms.unix; - # See https://downloads.mysql.com/docs/licenses/mysqld-5.5-gpl-en.pdf - license = with licenses; [ - artistic1 bsd0 bsd2 bsd3 bsdOriginal - gpl2 lgpl2 lgpl21 mit publicDomain licenses.zlib - ]; - broken = stdenv.isAarch64; - }; -}; in self diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b5bac38d3de..ee5857019cf3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14568,11 +14568,6 @@ in influxdb = callPackage ../servers/nosql/influxdb { }; - mysql55 = callPackage ../servers/sql/mysql/5.5.x.nix { - inherit (darwin) cctools; - inherit (darwin.apple_sdk.frameworks) CoreServices; - }; - mysql57 = callPackage ../servers/sql/mysql/5.7.x.nix { inherit (darwin) cctools developer_cmds; inherit (darwin.apple_sdk.frameworks) CoreServices; From fb918a9254b5085d9bdb7eec36907da52a6cef70 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Tue, 25 Jun 2019 17:05:55 -0400 Subject: [PATCH 2/2] nixos/mysql: drop rootPassword option --- nixos/modules/rename.nix | 1 + nixos/modules/services/databases/mysql.nix | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index a424e86038e7..7fa76dc0c688 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -213,6 +213,7 @@ with lib; (mkRemovedOptionModule [ "boot" "zfs" "enableLegacyCrypto" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "winstone" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "mysql" "pidDir" ] "Don't wait for pidfiles, describe dependencies through systemd") + (mkRemovedOptionModule [ "services" "mysql" "rootPassword" ] "Use socket authentication or set the password outside of the nix store.") # ZSH (mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ]) diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 66d55b650a45..02f406833131 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -204,12 +204,6 @@ in ''; }; - # FIXME: remove this option; it's a really bad idea. - rootPassword = mkOption { - default = null; - description = "Path to a file containing the root password, modified on the first startup. Not specifying a root password will leave the root password empty."; - }; - replication = { role = mkOption { type = types.enum [ "master" "slave" "none" ]; @@ -400,16 +394,6 @@ in cat ${toString cfg.initialScript} | ${mysql}/bin/mysql -u root -N ''} - ${optionalString (cfg.rootPassword != null) - '' - # Change root password - - ( echo "use mysql;" - echo "update user set Password=password('$(cat ${cfg.rootPassword})') where User='root';" - echo "flush privileges;" - ) | ${mysql}/bin/mysql -u root -N - ''} - rm /tmp/mysql_init fi