2020-05-03 17:38:23 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, python }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2020-05-03 17:38:23 +00:00
|
|
|
py = python;
|
2020-04-24 23:36:52 +00:00
|
|
|
in buildPythonPackage rec {
|
|
|
|
pname = "mysql-connector";
|
2021-04-22 02:08:21 +00:00
|
|
|
version = "8.0.24";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mysql";
|
|
|
|
repo = "mysql-connector-python";
|
|
|
|
rev = version;
|
2021-04-22 02:08:21 +00:00
|
|
|
sha256 = "1zb5wf65rnpbk0lw31i4piy0bq09hqa62gx7bh241zc5310zccc7";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
patches = [
|
|
|
|
# mysql-connector overrides MACOSX_DEPLOYMENT_TARGET to 11.
|
|
|
|
# This makes the installation with nixpkgs fail. I suspect, that's
|
|
|
|
# because stdenv.targetPlatform.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
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = with py.pkgs; [ protobuf dnspython ];
|
|
|
|
|
|
|
|
# Tests are failing (TODO: unknown reason)
|
|
|
|
# TypeError: __init__() missing 1 required positional argument: 'string'
|
|
|
|
# But the library should be working as expected.
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
pythonImportsCheck = [ "mysql" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "A 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";
|
2020-05-03 17:38:23 +00:00
|
|
|
changelog = "https://raw.githubusercontent.com/mysql/mysql-connector-python/${version}/CHANGES.txt";
|
2021-04-22 02:08:21 +00:00
|
|
|
license = [ lib.licenses.gpl2Only ];
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with lib.maintainers; [ neosimsim turion ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|