From 34c0bfefa6912742eae3cfce1f641058d9644d99 Mon Sep 17 00:00:00 2001 From: Arne Becker <101113822+EbiArnie@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:35:56 +0000 Subject: [PATCH] perl-test-xml and deps: new packages (#42870) - Adds perl-test-xml and dependency: - Adds perl-xml-semanticdiff --- .../builtin/packages/perl-test-xml/package.py | 31 +++++++++++++++++++ .../packages/perl-xml-semanticdiff/package.py | 30 ++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 var/spack/repos/builtin/packages/perl-test-xml/package.py create mode 100644 var/spack/repos/builtin/packages/perl-xml-semanticdiff/package.py diff --git a/var/spack/repos/builtin/packages/perl-test-xml/package.py b/var/spack/repos/builtin/packages/perl-test-xml/package.py new file mode 100644 index 0000000000..8422de10ce --- /dev/null +++ b/var/spack/repos/builtin/packages/perl-test-xml/package.py @@ -0,0 +1,31 @@ +# Copyright 2013-2024 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.package import * + + +class PerlTestXml(PerlPackage): + """Compare XML in perl tests""" + + homepage = "https://metacpan.org/pod/Test::XML" + url = "https://cpan.metacpan.org/authors/id/S/SE/SEMANTICO/Test-XML-0.08.tar.gz" + + maintainers("EbiArnie") + + license("Artistic-1.0-Perl OR GPL-1.0-or-later") + + version("0.08", sha256="eb54cc23cdec860d3ad8ac8a697cbf038d0dec95229912d975c301890ca83ee2") + + depends_on("perl@5.6.0:", type=("build", "link", "run", "test")) + depends_on("perl-xml-parser@2.34:", type=("build", "run", "test")) + depends_on("perl-xml-semanticdiff@0.95:", type=("build", "run", "test")) + + def test_use(self): + """Test 'use module'""" + options = ["-we", 'use strict; use Test::XML; print("OK\n")'] + + perl = self.spec["perl"].command + out = perl(*options, output=str.split, error=str.split) + assert "OK" in out diff --git a/var/spack/repos/builtin/packages/perl-xml-semanticdiff/package.py b/var/spack/repos/builtin/packages/perl-xml-semanticdiff/package.py new file mode 100644 index 0000000000..8997eeb661 --- /dev/null +++ b/var/spack/repos/builtin/packages/perl-xml-semanticdiff/package.py @@ -0,0 +1,30 @@ +# Copyright 2013-2024 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.package import * + + +class PerlXmlSemanticdiff(PerlPackage): + """Perl extension for comparing XML documents.""" + + homepage = "https://metacpan.org/pod/XML::SemanticDiff" + url = "https://cpan.metacpan.org/authors/id/P/PE/PERIGRIN/XML-SemanticDiff-1.0007.tar.gz" + + maintainers("EbiArnie") + + license("Artistic-1.0-Perl OR GPL-1.0-or-later") + + version("1.0007", sha256="05fdefefbbc3f6b62fc7c9b5fabafb6b695ed68f0a3d958577251d1f0402a0f5") + + depends_on("perl@5.8.0:", type=("build", "link", "run", "test")) + depends_on("perl-xml-parser", type=("build", "run", "test")) + + def test_use(self): + """Test 'use module'""" + options = ["-we", 'use strict; use XML::SemanticDiff; print("OK\n")'] + + perl = self.spec["perl"].command + out = perl(*options, output=str.split, error=str.split) + assert "OK" in out