summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/libsndfile/package.py
blob: 031517c7552fcafedc3e34b5bb4a7f320522891a (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
32
33
34
35
36
37
38
39
40
41
42
# 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 Libsndfile(AutotoolsPackage):
    """Libsndfile is a C library for reading and writing files containing
    sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format)
    through one standard library interface. It is released in source code
    format under the Gnu Lesser General Public License."""

    homepage = "http://www.mega-nerd.com/libsndfile/"
    url = "http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz"

    license("LGPL-2.1-or-later")

    version("1.0.28", sha256="1ff33929f042fa333aed1e8923aa628c3ee9e1eb85512686c55092d1e5a9dfa9")

    variant("alsa", default=False, description="Use alsa in example programs")
    variant(
        "external-libs", default=False, description="Build with support for FLAC, Ogg and Vorbis"
    )
    variant("sqlite", default=False, description="Build with sqlite support")

    depends_on("pkgconfig", type="build")
    depends_on("alsa-lib", when="+alsa")
    depends_on("flac@1.3.1:", when="+external-libs")
    depends_on("libogg@1.1.3:", when="+external-libs")
    depends_on("libvorbis@1.2.3:", when="+external-libs")
    depends_on("sqlite@3.2:", when="+sqlite")

    def configure_args(self):
        args = []

        args += self.enable_or_disable("alsa")
        args += self.enable_or_disable("external-libs")
        args += self.enable_or_disable("sqlite")

        return args