13 buildPythonPackage rec {
14 pname = "mysql-connector";
16 format = "setuptools";
18 disabled = pythonOlder "3.7";
21 "--with-mysql-capi=\"${mysql80}\""
22 "--with-openssl-include-dir=\"${openssl.dev}/include\""
23 "--with-openssl-lib-dir=\"${lib.getLib openssl}/lib\""
24 "-L \"${lib.getLib pkgs.zstd}/lib:${lib.getLib mysql80}/lib\""
27 src = fetchFromGitHub {
29 repo = "mysql-connector-python";
31 hash = "sha256-GtMq7E2qBqFu54hjUotzPyxScTKXNdEQcmgHnS7lBhc=";
35 # mysql-connector overrides MACOSX_DEPLOYMENT_TARGET to 11.
36 # This makes the installation with nixpkgs fail. I suspect, that's
37 # because stdenv.hostPlatform.darwinSdkVersion is (currently) set to
38 # 10.12. The patch reverts
39 # https://github.com/mysql/mysql-connector-python/commit/d1e89fd3d7391084cdf35b0806cb5d2a4b413654
40 ./0001-Revert-Fix-MacOS-wheels-platform-tag.patch
43 nativeBuildInputs = [ mysql80 ];
45 propagatedBuildInputs = [
53 pythonImportsCheck = [ "mysql" ];
55 # Tests require a running MySQL instance
59 description = "MySQL driver";
61 A MySQL driver that does not depend on MySQL C client libraries and
62 implements the DB API v2.0 specification.
64 homepage = "https://github.com/mysql/mysql-connector-python";
65 changelog = "https://raw.githubusercontent.com/mysql/mysql-connector-python/${version}/CHANGES.txt";
66 license = licenses.gpl2Only;
67 maintainers = with maintainers; [