summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/perl-type-tiny/package.py
blob: c7055db080712be0ebe40ea03f8c4f9a8cdd6d53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
# Copyright 2023 EMBL-European Bioinformatics Institute
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *


class PerlTypeTiny(PerlPackage):
    """Tiny, yet Moo(se)-compatible type constraint"""

    homepage = "https://metacpan.org/pod/Type::Tiny"
    url = "https://cpan.metacpan.org/authors/id/T/TO/TOBYINK/Type-Tiny-2.004000.tar.gz"

    maintainers("EbiArnie")

    license("GPL-1.0-or-later OR Artistic-1.0-Perl")

    version("2.004000", sha256="697e7f775edfc85f4cf07792d04fd19b09c25285f98f5938e8efc4f74507a128")

    depends_on("perl@5.8.1:", type=("build", "link", "run", "test"))
    depends_on("perl-exporter-tiny@1.006000:", type=("run"))

    def test_use(self):
        """Test 'use module'"""
        options = ["-we", 'use strict; use Type::Tiny; print("OK\n")']

        perl = self.spec["perl"].command
        out = perl(*options, output=str.split, error=str.split)
        assert "OK" in out