2019-01-01 14:04:23 +08:00
|
|
|
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2017-12-06 01:33:55 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2017-12-06 01:33:55 +08:00
|
|
|
from spack import *
|
|
|
|
import glob
|
|
|
|
|
|
|
|
|
|
|
|
class Opennurbs(Package):
|
|
|
|
"""OpenNURBS is an open-source NURBS-based geometric modeling library
|
|
|
|
and toolset, with meshing and display / output functions.
|
|
|
|
"""
|
|
|
|
|
|
|
|
homepage = "https://github.com/OpenNURBS/OpenNURBS"
|
2018-07-24 09:55:17 +08:00
|
|
|
git = "https://github.com/OpenNURBS/OpenNURBS.git"
|
2017-12-06 01:33:55 +08:00
|
|
|
|
|
|
|
maintainers = ['jrood-nrel']
|
|
|
|
|
2018-07-24 09:55:17 +08:00
|
|
|
version('develop', branch='develop')
|
2017-12-06 01:33:55 +08:00
|
|
|
|
2019-10-11 13:44:41 +08:00
|
|
|
version('percept', sha256='d12a8f14f0b27d286fb7a75ab3c4e300f77d1fbb028326d1c8d28e4641605538',
|
2017-12-06 01:33:55 +08:00
|
|
|
url='https://github.com/PerceptTools/percept/raw/master/build-cmake/opennurbs-percept.tar.gz')
|
|
|
|
|
|
|
|
variant('shared', default=True,
|
|
|
|
description="Build shared libraries")
|
|
|
|
|
|
|
|
# CMake installation method
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
cmake_args = [
|
|
|
|
'-DBUILD_SHARED_LIBS:BOOL=%s' % (
|
|
|
|
'ON' if '+shared' in spec else 'OFF')
|
|
|
|
]
|
|
|
|
|
|
|
|
cmake_args.extend(std_cmake_args)
|
|
|
|
|
|
|
|
with working_dir('spack-build', create=True):
|
|
|
|
cmake('..', *cmake_args)
|
|
|
|
make()
|
|
|
|
make('install')
|
|
|
|
|
|
|
|
# Pre-cmake installation method
|
|
|
|
@when('@percept')
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
make(parallel=False)
|
|
|
|
|
|
|
|
# Install manually
|
|
|
|
mkdir(prefix.lib)
|
|
|
|
mkdir(prefix.include)
|
|
|
|
install('libopenNURBS.a', prefix.lib)
|
|
|
|
install_tree('zlib', join_path(prefix.include, 'zlib'))
|
|
|
|
headers = glob.glob(join_path('.', '*.h'))
|
|
|
|
for h in headers:
|
|
|
|
install(h, prefix.include)
|