Skip to content

Commit

Permalink
Add multiarch support to virtualenv. Fixes joyent/pkgsrc#425
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Hajny committed Nov 9, 2016
1 parent 808204c commit da1d30e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
12 changes: 11 additions & 1 deletion devel/py-virtualenv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions devel/py-virtualenv/distinfo
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 36 additions & 0 deletions devel/py-virtualenv/patches/patch-virtualenv.py
Original file line number Diff line number Diff line change
@@ -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):

0 comments on commit da1d30e

Please sign in to comment.