38 pythonDeps = with python3.pkgs; [ certifi paramiko pyyaml ];
39 pythonPath = lib.makeSearchPath python3.sitePackages pythonDeps;
41 stdenv.mkDerivation rec{
42 pname = "mysql-shell";
47 url = "https://cdn.mysql.com//Downloads/MySQL-Shell/mysql-shell-${version}-src.tar.gz";
48 sha256 = "sha256-/UJgcYkPG8RShZzybqdcMQDpNUTVWAfAa2p0Cm23fXA=";
51 url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor version}/mysql-${version}.tar.gz";
52 sha256 = "sha256-yYjVxrqaVmkqbNbpgTRltfyTaO1LRh35cFmi/BYMi4Q=";
56 sourceRoot = "mysql-shell-${version}-src";
59 substituteInPlace ../mysql-${version}/cmake/libutils.cmake --replace /usr/bin/libtool libtool
60 substituteInPlace ../mysql-${version}/cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool
62 substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool
65 nativeBuildInputs = [ pkg-config cmake git bison makeWrapper ] ++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
87 ] ++ pythonDeps ++ lib.optionals stdenv.isLinux [
90 ] ++ lib.optionals stdenv.isDarwin [ cctools CoreServices developer_cmds DarwinTools ];
94 cmake -DWITH_BOOST=system -DWITH_SYSTEM_LIBS=ON -DWITH_ROUTER=OFF -DWITH_UNIT_TESTS=OFF \
95 -DFORCE_UNSUPPORTED_COMPILER=1 -S ../mysql-${version} -B ../mysql-${version}/build
97 cmake --build ../mysql-${version}/build --parallel ''${NIX_BUILD_CORES:-1} --target mysqlclient mysqlxclient
101 "-DMYSQL_SOURCE_DIR=../mysql-${version}"
102 "-DMYSQL_BUILD_DIR=../mysql-${version}/build"
103 "-DMYSQL_CONFIG_EXECUTABLE=../../mysql-${version}/build/scripts/mysql_config"
107 "-DWITH_PROTOBUF=${protobuf}"
109 "-DV8_INCLUDE_DIR=${v8}/include"
110 "-DV8_LIB_DIR=${v8}/lib"
114 CXXFLAGS = [ "-DV8_COMPRESS_POINTERS=1" "-DV8_31BIT_SMIS_ON_64BIT_ARCH=1" ];
117 wrapProgram $out/bin/mysqlsh --set PYTHONPATH "${pythonPath}"
121 homepage = "https://dev.mysql.com/doc/mysql-shell/${lib.versions.majorMinor version}/en/";
122 description = "A new command line scriptable shell for MySQL";
123 license = licenses.gpl2;
124 maintainers = with maintainers; [ aaronjheng ];
125 mainProgram = "mysqlsh";