Something went wrong. Try again.
lol
Something went wrong. Try again.
1.9 kB · 75 lines
Nix
at master
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576{ lib, buildPythonPackage, dnspython, fetchFromGitHub, protobuf, mysql84, openssl, pkgs,}:
buildPythonPackage rec { pname = "mysql-connector"; version = "9.6.0"; format = "setuptools";
setupPyBuildFlags = [ "--with-mysql-capi=${mysql84}" "--with-openssl-include-dir=${openssl.dev}/include" "--with-openssl-lib-dir=${lib.getLib openssl}/lib" "-L" "${lib.getLib pkgs.zstd}/lib:${lib.getLib mysql84}/lib" ];
src = fetchFromGitHub { owner = "mysql"; repo = "mysql-connector-python"; tag = version; hash = "sha256-EwdJpiyplck26Tc9SiczxGieJ3GcTGMQva/fDzhzWn4="; };
sourceRoot = "${src.name}/mysql-connector-python";
patches = [ # mysql-connector overrides MACOSX_DEPLOYMENT_TARGET to 11. # This makes the installation with nixpkgs fail. I suspect, that's # because stdenv.hostPlatform.darwinSdkVersion is (currently) set to # 10.12. The patch reverts # https://github.com/mysql/mysql-connector-python/commit/d1e89fd3d7391084cdf35b0806cb5d2a4b413654 ./0001-Revert-Fix-MacOS-wheels-platform-tag.patch ];
nativeBuildInputs = [ mysql84 ];
buildInputs = [ mysql84 openssl pkgs.zlib pkgs.zstd ];
propagatedBuildInputs = [ dnspython protobuf ];
pythonImportsCheck = [ "mysql" ];
# Tests require a running MySQL instance doCheck = false;
meta = { description = "MySQL driver"; longDescription = '' A MySQL driver that does not depend on MySQL C client libraries and implements the DB API v2.0 specification. ''; homepage = "https://github.com/mysql/mysql-connector-python"; changelog = "https://raw.githubusercontent.com/mysql/mysql-connector-python/${src.tag}/CHANGES.txt"; license = lib.licenses.gpl2Only; maintainers = with lib.maintainers; [ neosimsim ]; };}