summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/librsvg/package.py
blob: 7671539e69504e11498f09e8864c56b6ad07838a (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
# Copyright 2013-2019 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 import *


class Librsvg(AutotoolsPackage):
    """Library to render SVG files using Cairo"""

    homepage = "https://wiki.gnome.org/Projects/LibRsvg"
    url      = "https://download.gnome.org/sources/librsvg/2.44/librsvg-2.44.14.tar.xz"

    version('2.44.14', sha256='6a85a7868639cdd4aa064245cc8e9d864dad8b8e9a4a8031bb09a4796bc4e303')

    depends_on("gobject-introspection", type='build')
    depends_on("pkg-config", type='build')
    depends_on("rust", type='build')
    depends_on("cairo")
    depends_on("gdk-pixbuf")
    depends_on("glib")
    depends_on("libcroco")
    depends_on("pango")
    depends_on('libffi')
    depends_on('libxml2')

    def url_for_version(self, version):
        url  = "https://download.gnome.org/sources/librsvg"
        url += "{0}/librsvg-{1}.tar.xz"
        return url.format(version.up_to(2), version)

    def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
        spack_env.prepend_path("XDG_DATA_DIRS", self.prefix.share)
        run_env.prepend_path("XDG_DATA_DIRS", self.prefix.share)

    def setup_environment(self, spack_env, run_env):
        spack_env.prepend_path("XDG_DATA_DIRS", self.prefix.share)
        run_env.prepend_path("XDG_DATA_DIRS", self.prefix.share)