From a5fb33b0e4d67408fdb4a685925b62db823d98d2 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 16 Nov 2016 15:29:08 +0100 Subject: python: symlink lib64/python2.7/lib-dynload/ to lib/python2.7/lib-dynload/ (#2295) --- var/spack/repos/builtin/packages/python/package.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 370e14b2ae..bf34b83c99 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -134,6 +134,25 @@ class Python(Package): self.filter_compilers(spec, prefix) + # TODO: + # On OpenSuse 13, python uses /lib64/python2.7/lib-dynload/*.so + # instead of /lib/python2.7/lib-dynload/*.so. Oddly enough the + # result is that Python can not find modules like cPickle. A workaround + # for now is to symlink to `lib`: + src = os.path.join(prefix, + 'lib64', + 'python{0}'.format(self.version.up_to(2)), + 'lib-dynload') + dst = os.path.join(prefix, + 'lib', + 'python{0}'.format(self.version.up_to(2)), + 'lib-dynload') + if os.path.isdir(src) and not os.path.isdir(dst): + mkdirp(dst) + for f in os.listdir(src): + os.symlink(os.path.join(src, f), + os.path.join(dst, f)) + # TODO: Once better testing support is integrated, add the following tests # https://wiki.python.org/moin/TkInter # -- cgit v1.2.3-70-g09d2