summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/ds/package.py
blob: 294f029c0bf216e2ca06830350f0b44a62d73b8d (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 2013-2023 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 os import symlink

from spack.package import *


class Ds(AutotoolsPackage):
    """SAOImage DS9 is an astronomical imaging and data visualization
    application."""

    homepage = "https://ds9.si.edu/"
    url = "http://ds9.si.edu/download/source/ds9.8.0.tar.gz"

    version("9.8.0", sha256="f3bdb46c1653997202f98c6f76632a4eb444707f4b64c14f8b96863d9c890304")

    depends_on("autoconf", type="build")
    depends_on("automake", type="build")
    depends_on("m4", type="build")
    depends_on("libtool", type="build")

    depends_on("libx11")
    depends_on("libxml2")
    depends_on("libxslt")
    depends_on("openssl")
    depends_on("tcl")
    depends_on("tcl-tclxml")
    depends_on("tk")

    def patch(self):
        # the package provides it's own Tcl utilities
        # compiling and manually setting paths for all of them is contrived
        # (most of the utilities are small and not included in spack)

        # inject libxml, libxslt prefixes into configure search paths
        filter_file(
            "/usr/bin/xml2-config",
            join_path(self.spec["libxml2"].prefix, "bin/xml2-config"),
            "tclxml/configure",
            string=True,
        )

        filter_file(
            "/usr/bin/xslt-config",
            join_path(self.spec["libxslt"].prefix, "bin/xslt-config"),
            "tclxml/configure",
            string=True,
        )

        # symlink the master configure script into the source directory
        symlink("unix/configure", "configure")

    def configure_args(self):
        srcdir = join_path(self.stage.source_path, "unix")
        return ["--srcdir={0}".format(srcdir)]

    def install(self, spec, prefix):
        # no install target provided in Makefile, install manually

        install_tree("bin", prefix.bin)
        install_tree("share", prefix.share)
        install_tree("lib", prefix.lib)