New package: sumo (#16096)

* New package: sumo

This PR adds the sumo package, as well as the fox package as a
dependency. It also updates and adds some fixes for openscenegraph.

For fox, the patch is for the development version. That patch should not
be necessary in future versions as it has been applied upstream. The
stable version is 1.6.57 and is marked as preferred. This is the version
needed for sumo.

Added dependencies for openscenegraph as well as set constraints on qt
versions.

* Update var/spack/repos/builtin/packages/sumo/package.py

I had intended to set this version constraint but somehow did not.

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Add dependency types to sumo recipe

- googletest: 'test'
- swig: 'build'
- java: 'build', 'run'

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Glenn Johnson 2020-04-21 13:27:34 -05:00 committed by GitHub
parent 4f5bd044d6
commit 74c159b883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 124 additions and 4 deletions

View File

@ -0,0 +1,11 @@
--- a/lib/FXRex.cpp 2019-08-22 21:46:13.000000000 -0500
+++ b/lib/FXRex.cpp 2020-04-13 16:46:31.718701955 -0500
@@ -503,7 +503,7 @@
*/
// Debugging regex code
-#define REXDEBUG 1
+// #define REXDEBUG 1
// As close to infinity as we're going to get; this seems big enough. We can not make
// it too large as this may wrap around when added to something else!

View File

@ -0,0 +1,46 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Fox(AutotoolsPackage):
"""FOX is a C++ based Toolkit for developing Graphical User Interfaces
easily and effectively. It offers a wide, and growing, collection of
Controls, and provides state of the art facilities such as drag and drop,
selection, as well as OpenGL widgets for 3D graphical manipulation. FOX
also implements icons, images, and user-convenience features such as status
line help, and tooltips. Tooltips may even be used for 3D objects!"""
homepage = "http://fox-toolkit.org/"
url = "http://fox-toolkit.org/ftp/fox-1.7.67.tar.gz"
version('1.7.67', sha256='7e511685119ef096fa90d334da46f0e50cfed8d414df32d80a7850442052f57d')
version('1.6.57', preferred=True, sha256='65ef15de9e0f3a396dc36d9ea29c158b78fad47f7184780357b929c94d458923')
patch('no_rexdebug.patch', when='@1.7.67')
variant('opengl', default=False, description='opengl support')
depends_on('bzip2')
depends_on('jpeg')
depends_on('libpng')
depends_on('libtiff')
depends_on('zlib')
depends_on('libx11')
depends_on('libsm')
depends_on('libxft')
depends_on('libxext')
depends_on('libxcursor')
depends_on('libxi')
depends_on('libxrandr')
depends_on('gl', when='+opengl')
def configure_args(self):
# Make the png link flags explicit or it will try to pick up libpng15
# from system
args = ['LDFLAGS={0}'.format(self.spec['libpng'].libs.search_flags)]
args += self.with_or_without('opengl')
return args

View File

@ -14,6 +14,7 @@ class Openscenegraph(CMakePackage):
homepage = "http://www.openscenegraph.org" homepage = "http://www.openscenegraph.org"
url = "https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.4.tar.gz" url = "https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.4.tar.gz"
version('3.6.5', sha256='aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12')
version('3.6.4', sha256='81394d1b484c631028b85d21c5535280c21bbd911cb058e8746c87e93e7b9d33') version('3.6.4', sha256='81394d1b484c631028b85d21c5535280c21bbd911cb058e8746c87e93e7b9d33')
version('3.2.3', sha256='a1ecc6524197024834e1277916922b32f30246cb583e27ed19bf3bf889534362') version('3.2.3', sha256='a1ecc6524197024834e1277916922b32f30246cb583e27ed19bf3bf889534362')
version('3.1.5', sha256='dddecf2b33302076712100af59b880e7647bc595a9a7cc99186e98d6e0eaeb5c') version('3.1.5', sha256='dddecf2b33302076712100af59b880e7647bc595a9a7cc99186e98d6e0eaeb5c')
@ -21,8 +22,11 @@ class Openscenegraph(CMakePackage):
variant('shared', default=True, description='Builds a shared version of the library') variant('shared', default=True, description='Builds a shared version of the library')
depends_on('cmake@2.8.7:', type='build') depends_on('cmake@2.8.7:', type='build')
depends_on('qt@4:') depends_on('qt@4:', when='@3.2:')
depends_on('qt@:4', when='@:3.1')
depends_on('zlib') depends_on('zlib')
depends_on('libxinerama')
depends_on('libxrandr')
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
@ -32,13 +36,17 @@ def cmake_args(self):
args = [ args = [
'-DDYNAMIC_OPENSCENEGRAPH={0}'.format(shared_status), '-DDYNAMIC_OPENSCENEGRAPH={0}'.format(shared_status),
'-DDYNAMIC_OPENTHREADS={0}'.format(shared_status), '-DDYNAMIC_OPENTHREADS={0}'.format(shared_status),
'-DZLIB_INCLUDE_DIR={0}'.format(spec['zlib'].prefix.include),
'-DZLIB_LIBRARY={0}/libz.{1}'.format(spec['zlib'].prefix.lib,
dso_suffix),
'-DBUILD_OSG_APPLICATIONS=OFF', '-DBUILD_OSG_APPLICATIONS=OFF',
'-DOSG_NOTIFY_DISABLED=ON', '-DOSG_NOTIFY_DISABLED=ON',
'-DLIB_POSTFIX=', '-DLIB_POSTFIX=',
'-DCMAKE_RELWITHDEBINFO_POSTFIX=',
] ]
if spec.satisfies('@:3.2'):
args.extend([
'-DZLIB_INCLUDE_DIR={0}'.format(spec['zlib'].prefix.include),
'-DZLIB_LIBRARY={0}/libz.{1}'.format(spec['zlib'].prefix.lib,
dso_suffix),
])
# NOTE: This is necessary in order to allow OpenSceneGraph to compile # NOTE: This is necessary in order to allow OpenSceneGraph to compile
# despite containing a number of implicit bool to int conversions. # despite containing a number of implicit bool to int conversions.

View File

@ -0,0 +1,55 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Sumo(CMakePackage):
"""Eclipse SUMO is an open source, highly portable, microscopic and
continuous road traffic simulation package designed to handle large road
networks. It allows for intermodal simulation including pedestrians and
comes with a large set of tools for scenario creation."""
homepage = "http://projects.eclipse.org/projects/technology.sumo"
url = "https://github.com/eclipse/sumo/archive/v1_5_0.tar.gz"
version('1.5.0', sha256='be6ba0361b487a5e71c81e60b4c07a67826d5e170500c10c37374c1086ac2cb6')
variant('gdal',
default=True,
description='gdal support, for arcgis')
variant('ffmpeg',
default=False,
description='ffmpeg support, for video output')
variant('openscenegraph',
default=False,
description='openscenegraph support, for experimental 3D GUI')
variant('gl2ps',
default=False,
description='gl2ps support')
variant('eigen',
default=False,
description='eigen support')
extends('python')
depends_on('py-setuptools', type='build')
depends_on('googletest', type='test')
depends_on('xerces-c')
depends_on('proj')
depends_on('fox@1.6.57+opengl')
depends_on('swig', type='build')
depends_on('java', type=('build', 'run'))
depends_on('gdal', when='+gdal')
depends_on('ffmpeg', when='+ffmpeg')
depends_on('openscenegraph', when='+openscenegraph')
depends_on('gl2ps', when='+gl2ps')
depends_on('eigen', when='+eigen')
def url_for_version(self, version):
url = "https://github.com/eclipse/sumo/archive/v{0}.tar.gz"
return url.format(version.underscored)
def setup_run_environment(self, env):
env.set('SUMO_HOME', self.prefix)