34 pythonDeps = with python3.pkgs; [ certifi paramiko pyyaml ];
36 mysqlShellVersion = "8.4.3";
37 mysqlServerVersion = "8.4.3";
39 stdenv.mkDerivation (finalAttrs: {
40 pname = "mysql-shell";
41 version = mysqlShellVersion;
45 url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor mysqlServerVersion}/mysql-${mysqlServerVersion}.tar.gz";
46 hash = "sha256-eslWTEeAIvcwBf+Ju7QPZ7OB/AbVUYQWvf/sdeYluBg=";
49 url = "https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell-${finalAttrs.version}-src.tar.gz";
50 hash = "sha256-rO+cAfQzUobMrTLGHRbaXsG+vMcjVTtDoZwmyok+dS4=";
54 sourceRoot = "mysql-shell-${finalAttrs.version}-src";
57 mv mysql-${mysqlServerVersion} mysql
61 # No openssl bundling on macOS. It's not working.
62 # See https://github.com/mysql/mysql-shell/blob/5b84e0be59fc0e027ef3f4920df15f7be97624c1/cmake/ssl.cmake#L53
63 ./no-openssl-bundling.patch
67 substituteInPlace ../mysql/cmake/libutils.cmake --replace-fail /usr/bin/libtool libtool
68 substituteInPlace ../mysql/cmake/os/Darwin.cmake --replace-fail /usr/bin/libtool libtool
70 substituteInPlace cmake/libutils.cmake --replace-fail /usr/bin/libtool libtool
73 nativeBuildInputs = [ pkg-config cmake git bison makeWrapper ]
74 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]
75 ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools darwin.DarwinTools ];
97 ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ]
98 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ];
102 echo "Building mysqlclient mysqlxclient"
104 cmake -DWITH_SYSTEM_LIBS=ON -DWITH_FIDO=system -DWITH_ROUTER=OFF -DWITH_UNIT_TESTS=OFF \
105 -DFORCE_UNSUPPORTED_COMPILER=1 -S ../mysql -B ../mysql/build
107 cmake --build ../mysql/build --parallel ''${NIX_BUILD_CORES:-1} --target mysqlclient mysqlxclient
110 "-DMYSQL_SOURCE_DIR=''${NIX_BUILD_TOP}/mysql"
111 "-DMYSQL_BUILD_DIR=''${NIX_BUILD_TOP}/mysql/build"
112 "-DMYSQL_CONFIG_EXECUTABLE=''${NIX_BUILD_TOP}/mysql/build/scripts/mysql_config"
116 "-DWITH_PROTOBUF=system"
122 wrapProgram $out/bin/mysqlsh --set PYTHONPATH "${lib.makeSearchPath python3.sitePackages pythonDeps}"
126 homepage = "https://dev.mysql.com/doc/mysql-shell/${lib.versions.majorMinor finalAttrs.version}/en/";
127 description = "New command line scriptable shell for MySQL";
128 license = licenses.gpl2;
129 maintainers = with maintainers; [ aaronjheng ];
130 mainProgram = "mysqlsh";