From c584d0c421df111c178bba55b1dfe47ddf04fa9e Mon Sep 17 00:00:00 2001 From: Alexander Ben Nasrallah Date: Tue, 20 Jul 2021 10:34:53 +0200 Subject: [PATCH 1/2] pythonPackages.mysql-connector: Add turion and neosimsim to maintainers --- maintainers/maintainer-list.nix | 6 ++++++ pkgs/development/python-modules/mysql-connector/default.nix | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9ba85483ccd2..491cfe8a92c4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7457,6 +7457,12 @@ githubId = 2590830; name = "Sage Raflik"; }; + neosimsim = { + email = "me@abn.sh"; + github = "neosimsim"; + githubId = 1771772; + name = "Alexander Ben Nasrallah"; + }; nequissimus = { email = "tim@nequissimus.com"; github = "nequissimus"; diff --git a/pkgs/development/python-modules/mysql-connector/default.nix b/pkgs/development/python-modules/mysql-connector/default.nix index 0856b30758dc..c52908bf3a5b 100644 --- a/pkgs/development/python-modules/mysql-connector/default.nix +++ b/pkgs/development/python-modules/mysql-connector/default.nix @@ -31,6 +31,6 @@ in buildPythonPackage rec { homepage = "https://github.com/mysql/mysql-connector-python"; changelog = "https://raw.githubusercontent.com/mysql/mysql-connector-python/${version}/CHANGES.txt"; license = [ lib.licenses.gpl2Only ]; - maintainers = with lib.maintainers; [ ]; + maintainers = with lib.maintainers; [ neosimsim turion ]; }; } From 6ce6aae6743fcb4c923dc0c681e3252c6dcfafa6 Mon Sep 17 00:00:00 2001 From: Alexander Ben Nasrallah Date: Tue, 20 Jul 2021 10:37:27 +0200 Subject: [PATCH 2/2] pythonPackages.mysql-connector: Fix on darwin 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 --- ...Revert-Fix-MacOS-wheels-platform-tag.patch | 36 +++++++++++++++++++ .../mysql-connector/default.nix | 9 +++++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/mysql-connector/0001-Revert-Fix-MacOS-wheels-platform-tag.patch diff --git a/pkgs/development/python-modules/mysql-connector/0001-Revert-Fix-MacOS-wheels-platform-tag.patch b/pkgs/development/python-modules/mysql-connector/0001-Revert-Fix-MacOS-wheels-platform-tag.patch new file mode 100644 index 000000000000..4356052d8715 --- /dev/null +++ b/pkgs/development/python-modules/mysql-connector/0001-Revert-Fix-MacOS-wheels-platform-tag.patch @@ -0,0 +1,36 @@ +From c5d32ef5d656b0aa4b2c1fc61c901d40bf2fb96a Mon Sep 17 00:00:00 2001 +From: Alexander Ben Nasrallah +Date: Mon, 19 Jul 2021 17:24:41 +0200 +Subject: [PATCH] Revert "Fix MacOS wheels platform tag" + +This reverts commit d1e89fd3d7391084cdf35b0806cb5d2a4b413654. +--- + cpydist/__init__.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/cpydist/__init__.py b/cpydist/__init__.py +index 0e7f341..2619d7a 100644 +--- a/cpydist/__init__.py ++++ b/cpydist/__init__.py +@@ -41,7 +41,7 @@ from distutils.command.install import install + from distutils.command.install_lib import install_lib + from distutils.core import Command + from distutils.dir_util import mkpath, remove_tree +-from distutils.sysconfig import get_config_vars, get_python_version ++from distutils.sysconfig import get_python_version + from distutils.version import LooseVersion + from subprocess import check_call, Popen, PIPE + +@@ -57,9 +57,6 @@ version_py = os.path.join("lib", "mysql", "connector", "version.py") + with open(version_py, "rb") as fp: + exec(compile(fp.read(), version_py, "exec")) + +-if "MACOSX_DEPLOYMENT_TARGET" in get_config_vars(): +- get_config_vars()["MACOSX_DEPLOYMENT_TARGET"] = "11.0" +- + COMMON_USER_OPTIONS = [ + ("byte-code-only", None, + "remove Python .py files; leave byte code .pyc only"), +-- +2.31.1 + diff --git a/pkgs/development/python-modules/mysql-connector/default.nix b/pkgs/development/python-modules/mysql-connector/default.nix index c52908bf3a5b..211bdec41fe0 100644 --- a/pkgs/development/python-modules/mysql-connector/default.nix +++ b/pkgs/development/python-modules/mysql-connector/default.nix @@ -13,6 +13,15 @@ in buildPythonPackage rec { sha256 = "1zb5wf65rnpbk0lw31i4piy0bq09hqa62gx7bh241zc5310zccc7"; }; + 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 + ]; + propagatedBuildInputs = with py.pkgs; [ protobuf dnspython ]; # Tests are failing (TODO: unknown reason)