commit:     4c9d7f507594da6c0b3d0f598ece26e1cd477351
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat May  7 16:57:06 2022 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat May  7 16:57:19 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c9d7f50

dev-python/cvxopt: patch versioneer.py to fix the build.

Michał Górny fixed this upstream in versioneer itself, I just
backported his commit to cvxopt's copy of versioneer.py.

Closes: https://bugs.gentoo.org/840999
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-python/cvxopt/cvxopt-1.3.0.ebuild              |  2 ++
 .../files/cvxopt-1.3.0-versioneer-buildfix.patch   | 33 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/dev-python/cvxopt/cvxopt-1.3.0.ebuild 
b/dev-python/cvxopt/cvxopt-1.3.0.ebuild
index cef2dfd526c7..c9d48eb76775 100644
--- a/dev-python/cvxopt/cvxopt-1.3.0.ebuild
+++ b/dev-python/cvxopt/cvxopt-1.3.0.ebuild
@@ -31,6 +31,8 @@ DEPEND="
 RDEPEND="${DEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=( "${FILESDIR}/cvxopt-1.3.0-versioneer-buildfix.patch" )
+
 distutils_enable_sphinx doc/source --no-autodoc
 distutils_enable_tests pytest
 

diff --git a/dev-python/cvxopt/files/cvxopt-1.3.0-versioneer-buildfix.patch 
b/dev-python/cvxopt/files/cvxopt-1.3.0-versioneer-buildfix.patch
new file mode 100644
index 000000000000..2cc28bc7f781
--- /dev/null
+++ b/dev-python/cvxopt/files/cvxopt-1.3.0-versioneer-buildfix.patch
@@ -0,0 +1,33 @@
+From 764665fb080e5aec235a64029246cb58becf5591 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <mich...@orlitzky.com>
+Date: Sat, 7 May 2022 12:44:31 -0400
+Subject: [PATCH 1/1] FIX: skip version update on `build_ext` if .py does not
+ exist
+
+Upstream versioneer commit 280fb6ce89af73ac6ced3c66354a16506a57fc6c
+ported to cvxopt's bundled copy. See also:
+
+  https://github.com/python-versioneer/python-versioneer/issues/296
+---
+ versioneer.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/versioneer.py b/versioneer.py
+index 414cb9d..47bdd40 100644
+--- a/versioneer.py
++++ b/versioneer.py
+@@ -1847,6 +1847,11 @@ def get_cmdclass(cmdclass=None):
+             # it with an updated value
+             target_versionfile = os.path.join(self.build_lib,
+                                               cfg.versionfile_build)
++            if not os.path.exists(target_versionfile):
++                print(f"Warning: {target_versionfile} does not exist, 
skipping "
++                      "version update. This can happen if you are running 
build_ext "
++                      "without first running build_py.")
++                return
+             print("UPDATING %s" % target_versionfile)
+             write_to_version_file(target_versionfile, versions)
+     cmds["build_ext"] = cmd_build_ext
+-- 
+2.35.1
+

Reply via email to