shrinkwrap_pkgs / root.py

try:
    from shrinkwrap.install import ShrinkwrapInstall
except ImportError:
    import subprocess; subprocess.check_call('pip install -b $VIRTUAL_ENV/build/build-shrinkwrap shrinkwrap', shell=True)
    from shrinkwrap.install import ShrinkwrapInstall
import os
from setuptools import setup


version = '5.34.01'
source_url = 'ftp://root.cern.ch/root/root_v%s.source.tar.gz' % version


def installer(self):
    # Get source and unpack to $VIRTUAL_ENV/src
    self.download_and_unpack_tarball(source_url, to_src_dir=True)

    # Fix source directory name
    os.chdir(self.src_dir)
    root_dir = 'root-v' + version
    os.rename('root', root_dir)

    # Configure and compile in place
    os.chdir(root_dir)
    config_options = '--enable-minuit2 --enable-roofit --with-python-libdir=%s' % self.python_libdir
    self.shell('./configure ' + config_options)
    self.make()

    # Setup environment
    env_contents = 'source %s' % os.path.join(self.src_dir, root_dir, 'bin', 'thisroot.sh')
    self.install_env('root.sh', contents=env_contents)


setup(
    name='root',
    version=version,
    author='Stan Seibert',
    author_email='stan@mtrr.org',
    shrinkwrap_installer=installer,
    shrinkwrap_requires=['fftw'],
    cmdclass={'install': ShrinkwrapInstall},
)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.