35 pythonDeps = with python3.pkgs; [
41 mysqlShellVersion = "8.4.3";
42 mysqlServerVersion = "8.4.3";
44 stdenv.mkDerivation (finalAttrs: {
45 pname = "mysql-shell";
46 version = mysqlShellVersion;
50 url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor mysqlServerVersion}/mysql-${mysqlServerVersion}.tar.gz";
51 hash = "sha256-eslWTEeAIvcwBf+Ju7QPZ7OB/AbVUYQWvf/sdeYluBg=";
54 url = "https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell-${finalAttrs.version}-src.tar.gz";
55 hash = "sha256-rO+cAfQzUobMrTLGHRbaXsG+vMcjVTtDoZwmyok+dS4=";
59 sourceRoot = "mysql-shell-${finalAttrs.version}-src";
62 mv mysql-${mysqlServerVersion} mysql
66 # No openssl bundling on macOS. It's not working.
67 # See https://github.com/mysql/mysql-shell/blob/5b84e0be59fc0e027ef3f4920df15f7be97624c1/cmake/ssl.cmake#L53
68 ./no-openssl-bundling.patch
72 substituteInPlace ../mysql/cmake/libutils.cmake --replace-fail /usr/bin/libtool libtool
73 substituteInPlace ../mysql/cmake/os/Darwin.cmake --replace-fail /usr/bin/libtool libtool
75 substituteInPlace cmake/libutils.cmake --replace-fail /usr/bin/libtool libtool
86 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]
87 ++ lib.optionals stdenv.hostPlatform.isDarwin [
114 ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ]
115 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ];
119 echo "Building mysqlclient mysqlxclient"
121 cmake -DWITH_SYSTEM_LIBS=ON -DWITH_FIDO=system -DWITH_ROUTER=OFF -DWITH_UNIT_TESTS=OFF \
122 -DFORCE_UNSUPPORTED_COMPILER=1 -S ../mysql -B ../mysql/build
124 cmake --build ../mysql/build --parallel ''${NIX_BUILD_CORES:-1} --target mysqlclient mysqlxclient
127 "-DMYSQL_SOURCE_DIR=''${NIX_BUILD_TOP}/mysql"
128 "-DMYSQL_BUILD_DIR=''${NIX_BUILD_TOP}/mysql/build"
129 "-DMYSQL_CONFIG_EXECUTABLE=''${NIX_BUILD_TOP}/mysql/build/scripts/mysql_config"
133 "-DWITH_PROTOBUF=system"
139 wrapProgram $out/bin/mysqlsh --set PYTHONPATH "${lib.makeSearchPath python3.sitePackages pythonDeps}"
143 homepage = "https://dev.mysql.com/doc/mysql-shell/${lib.versions.majorMinor finalAttrs.version}/en/";
144 description = "New command line scriptable shell for MySQL";
145 license = licenses.gpl2;
146 maintainers = with maintainers; [ aaronjheng ];
147 mainProgram = "mysqlsh";