From da1d30ebfff67954d3f986c05a29f9e3a3db9ff8 Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Wed, 9 Nov 2016 15:21:31 +0000 Subject: [PATCH] Add multiarch support to virtualenv. Fixes joyent/pkgsrc#425 --- devel/py-virtualenv/Makefile | 12 ++++++- devel/py-virtualenv/distinfo | 1 + .../py-virtualenv/patches/patch-virtualenv.py | 36 +++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 devel/py-virtualenv/patches/patch-virtualenv.py diff --git a/devel/py-virtualenv/Makefile b/devel/py-virtualenv/Makefile index c5e6b3b5b1acc..e9483927e5a02 100644 --- a/devel/py-virtualenv/Makefile +++ b/devel/py-virtualenv/Makefile @@ -12,8 +12,18 @@ LICENSE= mit REPLACE_PYTHON= virtualenv.py +SUBST_CLASSES+= arch +SUBST_STAGE.arch= pre-configure +SUBST_MESSAGE.arch= Fixing multiarch support +SUBST_FILES.arch= virtualenv.py +SUBST_SED.arch= -e 's|@BINARCHSUFFIX32@|${BINARCHSUFFIX.32:S/\///}|' +SUBST_SED.arch+= -e 's|@BINARCHSUFFIX64@|${BINARCHSUFFIX.64:S/\///}|' + post-install: - ${MV} ${DESTDIR}${PREFIX}/bin/virtualenv ${DESTDIR}${PREFIX}/bin/virtualenv-${PYVERSSUFFIX} + if ${TEST} -f ${DESTDIR}${PREFIX}/bin/virtualenv; then \ + ${MV} ${DESTDIR}${PREFIX}/bin/virtualenv \ + ${DESTDIR}${PREFIX}/bin/virtualenv-${PYVERSSUFFIX}; \ + fi .include "../../lang/python/application.mk" .include "../../lang/python/egg.mk" diff --git a/devel/py-virtualenv/distinfo b/devel/py-virtualenv/distinfo index 930caeb624dd0..732dc2badbad5 100644 --- a/devel/py-virtualenv/distinfo +++ b/devel/py-virtualenv/distinfo @@ -4,3 +4,4 @@ SHA1 (virtualenv-15.0.3.tar.gz) = 09606af31b7bf4967ff4c84bfc8f983261951c7e RMD160 (virtualenv-15.0.3.tar.gz) = bf32c45de7ac2f66d981c624979ff2cf08f498be SHA512 (virtualenv-15.0.3.tar.gz) = f417dbefe8864be9028ab9efd69844b94550dc7f739688b00c32c15ad4f84a2b0d4885564ed0d0e0b43960a328fe81092cebfb8dd0d4b10a804b42122d9c9621 Size (virtualenv-15.0.3.tar.gz) = 1849119 bytes +SHA1 (patch-virtualenv.py) = 7587ca5e051bbb3ac92df1a8b129cfb682e7984d diff --git a/devel/py-virtualenv/patches/patch-virtualenv.py b/devel/py-virtualenv/patches/patch-virtualenv.py new file mode 100644 index 0000000000000..95ae8affb60ba --- /dev/null +++ b/devel/py-virtualenv/patches/patch-virtualenv.py @@ -0,0 +1,36 @@ +$NetBSD$ + +Add basic multiarch support to virtualenv. Creates copies of real binaries (in addition to the abiexec wrapper.) + +--- virtualenv.py.orig 2016-08-05 12:22:20.000000000 +0000 ++++ virtualenv.py +@@ -1199,6 +1199,9 @@ def install_python(home_dir, lib_dir, in + symlink=False) + + mkdir(bin_dir) ++ # Create multiarch bin dirs ++ mkdir(join(bin_dir, '@BINARCHSUFFIX32@')) ++ mkdir(join(bin_dir, '@BINARCHSUFFIX64@')) + py_executable = join(bin_dir, os.path.basename(sys.executable)) + if 'Python.framework' in prefix: + # OS X framework builds cause validation to break +@@ -1229,6 +1232,19 @@ def install_python(home_dir, lib_dir, in + executable = sys.executable + shutil.copyfile(executable, py_executable) + make_exe(py_executable) ++ # Copy multiarch binaries ++ executable32 = os.path.join(os.path.dirname(executable), ++ '@BINARCHSUFFIX32@', os.path.basename(executable)) ++ executable64 = os.path.join(os.path.dirname(executable), ++ '@BINARCHSUFFIX64@', os.path.basename(executable)) ++ py_executable32 = os.path.join(os.path.dirname(py_executable), ++ '@BINARCHSUFFIX32@', os.path.basename(py_executable)) ++ py_executable64 = os.path.join(os.path.dirname(py_executable), ++ '@BINARCHSUFFIX64@', os.path.basename(py_executable)) ++ shutil.copyfile(executable32, py_executable32) ++ shutil.copyfile(executable64, py_executable64) ++ make_exe(py_executable32) ++ make_exe(py_executable64) + if is_win or is_cygwin: + pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe') + if os.path.exists(pythonw):