summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/unifdef/package.py
blob: a1a8da0e98ca41d99e3dbb9cb1e92fa982d905d2 (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
# 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 Unifdef(MakefilePackage):
    """The unifdef utility selectively processes conditional C preprocessor #if
    and #ifdef directives. It removes from a file both the directives and the
    additional text that they delimit, while otherwise leaving the file
    alone."""

    homepage = "https://dotat.at/prog/unifdef/"
    url = "https://dotat.at/prog/unifdef/unifdef-2.11.tar.xz"

    maintainers("matthiasdiener")

    license("BSD-2-Clause AND BSD-3-Clause", checked_by="tgamblin")

    version("2.12", sha256="43ce0f02ecdcdc723b2475575563ddb192e988c886d368260bc0a63aee3ac400")
    version("2.11", sha256="828ffc270ac262b88fe011136acef2780c05b0dc3c5435d005651740788d4537")

    def edit(self, spec, prefix):
        makefile = FileFilter("Makefile")
        makefile.filter(r"\$\{HOME\}", prefix)