nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv
2, lib
3, buildPythonPackage
4, django
5, dnspython
6, fetchFromGitHub
7, protobuf
8, pythonOlder
9}:
10
11buildPythonPackage rec {
12 pname = "mysql-connector";
13 version = "8.0.29";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "mysql";
20 repo = "mysql-connector-python";
21 rev = version;
22 hash = "sha256-X0qiXNYkNoR00ESUdByPj4dPnEnjLyopm25lm1JvkAk=";
23 };
24
25 patches = [
26 # mysql-connector overrides MACOSX_DEPLOYMENT_TARGET to 11.
27 # This makes the installation with nixpkgs fail. I suspect, that's
28 # because stdenv.targetPlatform.darwinSdkVersion is (currently) set to
29 # 10.12. The patch reverts
30 # https://github.com/mysql/mysql-connector-python/commit/d1e89fd3d7391084cdf35b0806cb5d2a4b413654
31 ./0001-Revert-Fix-MacOS-wheels-platform-tag.patch
32 ];
33
34 propagatedBuildInputs = [
35 dnspython
36 protobuf
37 ];
38
39 pythonImportsCheck = [
40 "mysql"
41 ];
42
43 # Tests require a running MySQL instance
44 doCheck = false;
45
46 meta = with lib; {
47 broken = stdenv.isDarwin;
48 description = "A MySQL driver";
49 longDescription = ''
50 A MySQL driver that does not depend on MySQL C client libraries and
51 implements the DB API v2.0 specification.
52 '';
53 homepage = "https://github.com/mysql/mysql-connector-python";
54 changelog = "https://raw.githubusercontent.com/mysql/mysql-connector-python/${version}/CHANGES.txt";
55 license = licenses.gpl2Only;
56 maintainers = with maintainers; [ neosimsim turion ];
57 };
58}