From 399ca3b671ec15a44b7ea24d27d91f960b78274a Mon Sep 17 00:00:00 2001 From: iarspider Date: Thu, 22 Oct 2020 02:16:11 +0200 Subject: Add qgraf (#19404) * Add recipe for qgraf * Revert "Add recipe for qgraf" This reverts commit 76783f73867a32b4a96e980e31a433ed3c0037fd. * Add qgraf * Update package.py Changes from review * Changes from MR * Fix for URLs containing @ symbol Co-authored-by: Ivan Razumov Co-authored-by: Adam J. Stewart --- lib/spack/spack/url.py | 5 ++++- var/spack/repos/builtin/packages/qgraf/package.py | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/qgraf/package.py diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py index 4969d5f353..aa40524ae8 100644 --- a/lib/spack/spack/url.py +++ b/lib/spack/spack/url.py @@ -31,7 +31,7 @@ from six import StringIO from six.moves.urllib.parse import urlsplit, urlunsplit import llnl.util.tty as tty -from llnl.util.tty.color import colorize +from llnl.util.tty.color import cescape, colorize import spack.error import spack.util.compression as comp @@ -898,6 +898,9 @@ def color_url(path, **kwargs): errors (bool): Append parse errors at end of string. subs (bool): Color substitutions as well as parsed name/version. """ + # Allow URLs containing @ and } + path = cescape(path) + errors = kwargs.get('errors', False) subs = kwargs.get('subs', False) diff --git a/var/spack/repos/builtin/packages/qgraf/package.py b/var/spack/repos/builtin/packages/qgraf/package.py new file mode 100644 index 0000000000..5affba785f --- /dev/null +++ b/var/spack/repos/builtin/packages/qgraf/package.py @@ -0,0 +1,21 @@ +# 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 Qgraf(Package): + """Qgraf is a computer program that generates Feynman diagrams + for various types of QFT models""" + + homepage = "http://cfif.ist.utl.pt/~paulo/qgraf.html" + url = "http://anonymous:anonymous@qgraf.tecnico.ulisboa.pt/v3.4/qgraf-3.4.2.tgz" + + version('3.4.2', sha256='cfc029fb871c78943865ef8b51ebcd3cd4428448b8816714b049669dfdeab8aa') + + def install(self, spec, prefix): + fortran = Executable(spack_fc) + fortran('qgraf-{0}.f'.format(self.spec.version), '-o', 'qgraf') + install_tree('.', prefix) -- cgit v1.2.3-70-g09d2