summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/r-rmariadb/package.py
blob: 56d46fe913f2940ae46a1a15682b464e8f8844d6 (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-2022 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 RRmariadb(RPackage):
    """Database Interface and 'MariaDB' Driver.

    Implements a 'DBI'-compliant interface to 'MariaDB'
    (<https://mariadb.org/>) and 'MySQL' (<https://www.mysql.com/>)
    databases."""

    cran = "RMariaDB"

    version('1.2.1', sha256='c9176a096854ce33a98ce0faef0065c50b5d356174f90cea742c70e130cf5f0c')
    version('1.1.0', sha256='9ffa63a15052876a51a7996ca4e6a5b7b937f594b5cc7ca5a86f43789e22a956')
    version('1.0.8', sha256='3c8aedc519dc063ceb068535a3700bc5caf26f867078cc5a228aa8961e2d99f5')

    depends_on('r@2.8.0:', type=('build', 'run'))
    depends_on('r-bit64', type=('build', 'run'))
    depends_on('r-blob', type=('build', 'run'), when='@1.2.1:')
    depends_on('r-dbi@1.1.0:', type=('build', 'run'))
    depends_on('r-hms@0.5.0:', type=('build', 'run'))
    depends_on('r-lubridate', type=('build', 'run'), when='@1.1.0:')
    depends_on('r-rcpp@0.12.4:', type=('build', 'run'))
    depends_on('r-rlang', type=('build', 'run'), when='@1.2.1:')
    depends_on('r-plogr', type=('build', 'run'))
    depends_on('mariadb-client')

    depends_on('r-bh', type=('build', 'run'), when='@:1.1.0')

    # Set the library explicitly to prevent configure from finding a system
    # mysql-client
    def configure_vars(self):
        lib_dir = self.spec['mariadb-client'].prefix.lib.mariadb
        inc_dir = self.spec['mariadb-client'].prefix.include.mariadb
        args = ['LIB_DIR={0}'.format(lib_dir),
                'INCLUDE_DIR={0}'.format(inc_dir)]
        return args