summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/perl-cache-cache/package.py
blob: c982e20acee73ced3a2aa00bbac50856d1dc1493 (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-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 PerlCacheCache(PerlPackage):
    """Extends Cache::SizeAwareMemoryCache"""

    homepage = "https://metacpan.org/pod/Cache::Cache"
    url = "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Cache-Cache-1.08.tar.gz"

    maintainers("EbiArnie")

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

    version("1.08", sha256="d2c7fd5dba5dd010b7d8923516890bb6ccf6b5f188ccb69f35cb0fd6c031d1e8")

    depends_on("perl-digest-sha1@2.02:", type=("build", "run", "test"))
    depends_on("perl-error@0.15:", type=("build", "run", "test"))
    depends_on("perl-ipc-sharelite@0.09:", type=("build", "run", "test"))

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

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