snac2: 2.68 -> 2.70 (#379043)
[NixPkgs.git] / pkgs / development / python-modules / mysql-connector / default.nix
blobe234bbef0e18d6c7f96514824fc19d4fa0dc29fd
2   lib,
3   buildPythonPackage,
4   dnspython,
5   fetchFromGitHub,
6   protobuf,
7   pythonOlder,
8   mysql80,
9   openssl,
10   pkgs,
13 buildPythonPackage rec {
14   pname = "mysql-connector";
15   version = "8.0.33";
16   format = "setuptools";
18   disabled = pythonOlder "3.7";
20   setupPyBuildFlags = [
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\""
25   ];
27   src = fetchFromGitHub {
28     owner = "mysql";
29     repo = "mysql-connector-python";
30     rev = version;
31     hash = "sha256-GtMq7E2qBqFu54hjUotzPyxScTKXNdEQcmgHnS7lBhc=";
32   };
34   patches = [
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
41   ];
43   nativeBuildInputs = [ mysql80 ];
45   propagatedBuildInputs = [
46     dnspython
47     protobuf
48     mysql80
49     openssl
50     pkgs.zstd
51   ];
53   pythonImportsCheck = [ "mysql" ];
55   # Tests require a running MySQL instance
56   doCheck = false;
58   meta = with lib; {
59     description = "MySQL driver";
60     longDescription = ''
61       A MySQL driver that does not depend on MySQL C client libraries and
62       implements the DB API v2.0 specification.
63     '';
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; [
68       neosimsim
69     ];
70   };