2016-05-12 12:22:25 +08:00
|
|
|
##############################################################################
|
|
|
|
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
|
|
|
|
# Produced at the Lawrence Livermore National Laboratory.
|
|
|
|
#
|
|
|
|
# This file is part of Spack.
|
|
|
|
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
|
|
|
# LLNL-CODE-647188
|
|
|
|
#
|
|
|
|
# For details, see https://github.com/llnl/spack
|
|
|
|
# Please also see the LICENSE file for our notice and the LGPL.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License (as
|
|
|
|
# published by the Free Software Foundation) version 2.1, February 1999.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
|
|
|
|
# conditions of the GNU Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
##############################################################################
|
2015-01-21 01:39:21 +08:00
|
|
|
from spack import *
|
|
|
|
import os
|
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
|
2015-01-21 01:39:21 +08:00
|
|
|
class PyPyside(Package):
|
2015-11-17 06:03:34 +08:00
|
|
|
"""Python bindings for Qt."""
|
2015-01-21 01:39:21 +08:00
|
|
|
homepage = "https://pypi.python.org/pypi/pyside"
|
|
|
|
url = "https://pypi.python.org/packages/source/P/PySide/PySide-1.2.2.tar.gz"
|
|
|
|
|
2016-08-10 05:13:57 +08:00
|
|
|
version('1.2.4', '3cb7174c13bd45e3e8f77638926cb8c0')
|
2015-01-21 01:39:21 +08:00
|
|
|
version('1.2.2', 'c45bc400c8a86d6b35f34c29e379e44d')
|
|
|
|
|
2016-03-09 23:46:56 +08:00
|
|
|
depends_on('cmake', type='build')
|
2015-02-17 13:53:34 +08:00
|
|
|
|
2015-01-21 01:39:21 +08:00
|
|
|
extends('python')
|
2016-03-09 23:46:56 +08:00
|
|
|
depends_on('py-setuptools', type='build')
|
2016-08-10 05:13:57 +08:00
|
|
|
depends_on('qt@4.6:4.999')
|
2015-02-09 18:54:49 +08:00
|
|
|
|
2015-02-10 07:55:18 +08:00
|
|
|
def patch(self):
|
2015-02-09 18:54:49 +08:00
|
|
|
"""Undo PySide RPATH handling and add Spack RPATH."""
|
2015-02-17 13:53:34 +08:00
|
|
|
# Figure out the special RPATH
|
|
|
|
pypkg = self.spec['python'].package
|
|
|
|
rpath = self.rpath
|
2016-08-10 16:50:00 +08:00
|
|
|
rpath.append(os.path.join(
|
|
|
|
self.prefix, pypkg.site_packages_dir, 'PySide'))
|
2015-02-17 13:53:34 +08:00
|
|
|
|
2015-02-09 18:54:49 +08:00
|
|
|
# Add Spack's standard CMake args to the sub-builds.
|
|
|
|
# They're called BY setup.py so we have to patch it.
|
|
|
|
filter_file(
|
|
|
|
r'OPTION_CMAKE,',
|
|
|
|
r'OPTION_CMAKE, ' + (
|
|
|
|
'"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", '
|
2015-02-17 13:53:34 +08:00
|
|
|
'"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(rpath)),
|
2015-02-09 18:54:49 +08:00
|
|
|
'setup.py')
|
|
|
|
|
|
|
|
# PySide tries to patch ELF files to remove RPATHs
|
|
|
|
# Disable this and go with the one we set.
|
2016-08-10 06:00:31 +08:00
|
|
|
if self.spec.satisfies('@1.2.4:'):
|
|
|
|
rpath_file = 'setup.py'
|
|
|
|
else:
|
|
|
|
rpath_file = 'pyside_postinstall.py'
|
|
|
|
|
|
|
|
filter_file(r'(^\s*)(rpath_cmd\(.*\))', r'\1#\2', rpath_file)
|
2015-02-09 18:54:49 +08:00
|
|
|
|
2015-01-21 01:39:21 +08:00
|
|
|
def install(self, spec, prefix):
|
2015-02-09 18:54:49 +08:00
|
|
|
python('setup.py', 'install',
|
|
|
|
'--prefix=%s' % prefix,
|
|
|
|
'--jobs=%s' % make_jobs)
|