diff --git a/pkgs/development/tools/mysql-shell/default.nix b/pkgs/development/tools/mysql-shell/default.nix index 915ed33c4669..e83846364170 100644 --- a/pkgs/development/tools/mysql-shell/default.nix +++ b/pkgs/development/tools/mysql-shell/default.nix @@ -31,14 +31,12 @@ , CoreServices , developer_cmds , DarwinTools +, makeWrapper }: let - pythonDeps = [ python3.pkgs.certifi python3.pkgs.paramiko ]; - site = '' - - import sys; sys.path.extend([${lib.concatStringsSep ", " (map (x: ''"${x}/${python3.sitePackages}"'') pythonDeps)}]) - ''; + pythonDeps = with python3.pkgs; [ certifi paramiko pyyaml ]; + pythonPath = lib.makeSearchPath python3.sitePackages pythonDeps; in stdenv.mkDerivation rec{ pname = "mysql-shell"; @@ -62,12 +60,9 @@ stdenv.mkDerivation rec{ substituteInPlace ../mysql-${version}/cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool - - # For python dependencies - echo '${site}' >> python/packages/mysqlsh/__init__.py ''; - nativeBuildInputs = [ pkg-config cmake git bison ] ++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ]; + nativeBuildInputs = [ pkg-config cmake git bison makeWrapper ] ++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ]; buildInputs = [ boost @@ -121,6 +116,10 @@ stdenv.mkDerivation rec{ CXXFLAGS = [ "-DV8_COMPRESS_POINTERS=1" "-DV8_31BIT_SMIS_ON_64BIT_ARCH=1" ]; + postFixup = '' + wrapProgram $out/bin/mysqlsh --set PYTHONPATH "${pythonPath}" + ''; + meta = with lib; { homepage = "https://dev.mysql.com/doc/mysql-shell/${lib.versions.majorMinor version}/en/"; description = "A new command line scriptable shell for MySQL";