spack/var/spack/repos/builtin/packages/paradiseo/package.py
Vanessasaurus 8e61f54260
start of work to add spack audit packages-https checker (#25670)
This PR will add a new audit, specifically for spack package homepage urls (and eventually
other kinds I suspect) to see if there is an http address that can be changed to https.

Usage is as follows:

```bash
$ spack audit packages-https <package>
```
And in list view:

```bash
$ spack audit list
generic:
  Generic checks relying on global variables

configs:
  Sanity checks on compilers.yaml
  Sanity checks on packages.yaml

packages:
  Sanity checks on specs used in directives

packages-https:
  Sanity checks on https checks of package urls, etc.
```

I think it would be unwise to include with packages, because when run for all, since we do requests it takes a long time. I also like the idea of more well scoped checks - likely there will be other addresses for http/https within a package that we eventually check. For now, there are two error cases - one is when an https url is tried but there is some SSL error (or other error that means we cannot update to https):

```bash
$ spack audit packages-https zoltan
PKG-HTTPS-DIRECTIVES: 1 issue found
1. Error with attempting https for "zoltan": 
    <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.cs.sandia.gov'. (_ssl.c:1125)>
```
This is either not fixable, or could be fixed with a change to the url or (better) contacting the site owners to ask about some certificate or similar.

The second case is when there is an http that needs to be https, which is a huge issue now, but hopefully not after this spack PR.

```bash
$ spack audit packages-https xman
Package "xman" uses http but has a valid https endpoint.
```

And then when a package is fixed:

```bash
$ spack audit packages-https zlib
PKG-HTTPS-DIRECTIVES: 0 issues found.
```
And that's mostly it. :)

Signed-off-by: vsoch <vsoch@users.noreply.github.com>

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
2021-09-02 08:46:27 +02:00

64 lines
2.4 KiB
Python

# Copyright 2013-2021 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 Paradiseo(CMakePackage):
"""A C++ white-box object-oriented framework dedicated to the reusable
design of metaheuristics."""
homepage = "https://paradiseo.gforge.inria.fr/"
git = "https://gforge.inria.fr/git/paradiseo/paradiseo.git"
# Installing from the development version is a better option at this
# point than using the very old supplied packages
version('head')
# This is a version that the package formula author has tested
# successfully. However, the clone is very large (~1Gb git
# history). The history in the head version has been trimmed
# significantly.
version('dev-safe', commit='dbb8fbe9a786efd4d1c26408ac1883442e7643a6')
variant('mpi', default=True,
description='Compile with parallel and distributed '
'metaheuristics module')
variant('smp', default=True,
description='Compile with symmetric multi-processing module ')
variant('edo', default=True,
description='Compile with (Experimental) EDO module')
variant('openmp', default=False, description='Enable OpenMP support')
variant('gnuplot', default=False, description='Enable GnuPlot support')
# Required dependencies
depends_on("cmake@2.8:", type='build')
# Optional dependencies
depends_on("mpi", when="+mpi")
depends_on("gnuplot", when='+gnuplot')
depends_on("eigen", when='+edo', type='build')
depends_on("boost~mpi", when='+edo~mpi')
depends_on("boost+mpi", when='+edo+mpi')
# Patches
patch('enable_eoserial.patch')
patch('fix_osx_detection.patch')
patch('fix_tests.patch')
patch('fix_tutorials.patch')
def cmake_args(self):
return [
'-DINSTALL_TYPE:STRING=MIN',
self.define_from_variant('MPI', 'mpi'),
# Note: This requires a C++11 compatible compiler
self.define_from_variant('SMP', 'smp'),
self.define_from_variant('EDO', 'edo'),
self.define('ENABLE_CMAKE_TESTING', self.run_tests),
self.define_from_variant('ENABLE_OPENMP', 'openmp'),
self.define_from_variant('ENABLE_GNUPLOT', 'gnuplot')
]