So ports builders have been randomly having py-curl fail to build
with an exception complaining about having to set MODPY_SETUPTOOLS=Yes.
It's been happening more often lately.
Here's a minimal diff to fix it. Very little changes, but it fixes it.
It probably could use a real reworking, but it's late and I'm tired. :)
ok?
(Run away now if you don't care *why* it is happening)
py-curl's setup.py has a weird bit of code that looks to see if it
can import py-wheel and if so, switches from using the old and
crusty distutils.core.setup to using setuptools.setup. We have code
in the lang/python module designed to throw an exception when it
"detect the case where a port will build regardless of setuptools
but the final plist will be different if it's present."
So if py-wheel is around when py-curl tries to build, boom.
I patch the code to just use setuptools unconditionally. Then I
set MODPY_SETUPTOOLS=Yes so it doesn't continue tripping that code.
I also pulled the pre-build as it was trying to do clever things
to use setup.py without setuptools.
I updated the plist just to see if that messed with anything, and
you can see the only change is to use an @so tag on pycurl.so.
--Kurt
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/py-curl/Makefile,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile
--- Makefile 8 Nov 2019 21:57:29 -0000 1.46
+++ Makefile 4 Dec 2019 05:37:17 -0000
@@ -19,6 +19,7 @@ WANTLIB += crypto curl nghttp2 pthread s
MODULES= lang/python
MODPY_PI= Yes
+MODPY_SETUPTOOLS = Yes
FLAVORS= python3
FLAVOR?=
@@ -29,9 +30,6 @@ SUBST_VARS+= MODPY_PY_PREFIX
MODPY_PYTEST = Yes
MODPY_PYTEST_ARGS = tests
-
-pre-configure:
- @${SUBST_CMD} ${WRKSRC}/setup.py
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples
Index: patches/patch-setup_py
===================================================================
RCS file: /cvs/ports/net/py-curl/patches/patch-setup_py,v
retrieving revision 1.7
diff -u -p -r1.7 patch-setup_py
--- patches/patch-setup_py 23 Jun 2018 15:25:18 -0000 1.7
+++ patches/patch-setup_py 4 Dec 2019 05:37:17 -0000
@@ -2,7 +2,21 @@ $OpenBSD: patch-setup_py,v 1.7 2018/06/2
Index: setup.py
--- setup.py.orig
+++ setup.py
-@@ -606,6 +606,8 @@ def get_data_files():
+@@ -10,12 +10,7 @@ VERSION = "7.43.0.2"
+
+ import glob, os, re, sys, subprocess
+ import distutils
+-try:
+- import wheel
+- if wheel:
+- from setuptools import setup
+-except ImportError:
+- from distutils.core import setup
++from setuptools import setup
+ from distutils.extension import Extension
+ from distutils.util import split_quoted
+ from distutils.version import LooseVersion
+@@ -606,6 +601,8 @@ def get_data_files():
data_files = []
if sys.platform == "win32":
datadir = os.path.join("doc", PACKAGE)
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/py-curl/pkg/PLIST,v
retrieving revision 1.11
diff -u -p -r1.11 PLIST
--- pkg/PLIST 23 Jun 2018 15:25:18 -0000 1.11
+++ pkg/PLIST 4 Dec 2019 05:37:17 -0000
@@ -4,7 +4,7 @@ lib/python${MODPY_VERSION}/site-packages
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/curl/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/curl/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pycurl-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
-lib/python${MODPY_VERSION}/site-packages/pycurl.so
+@so lib/python${MODPY_VERSION}/site-packages/pycurl.so
share/doc/${MODPY_PY_PREFIX}curl/
share/doc/${MODPY_PY_PREFIX}curl/AUTHORS
share/doc/${MODPY_PY_PREFIX}curl/COPYING-LGPL
No comments:
Post a Comment