# Copyright 2013-2021 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 RMixtools(RPackage):
    """mixtools: Tools for Analyzing Finite Mixture Models

    Analyzes finite mixture models for various parametric and semiparametric
    settings."""

    homepage = "https://cloud.r-project.org/package=mixtools"
    url      = "https://cloud.r-project.org/src/contrib/mixtools_1.1.0.tar.gz"
    list_url = "https://cloud.r-project.org/src/contrib/Archive/mixtools"

    version('1.1.0', sha256='543fd8d8dc8d4b6079ebf491cf97f27d6225e1a6e65d8fd48553ada23ba88d8f')
    version('1.0.4', sha256='62f4b0a17ce520c4f8ed50ab44f120e459143b461a9e420cd39056ee4fc8798c')

    depends_on('r@3.2:', type=('build', 'run'))
    depends_on('r-mass', type=('build', 'run'))
    depends_on('r-segmented', type=('build', 'run'))
    depends_on('r-survival', type=('build', 'run'))

@@ -251,18 +251,8 @@
  %22%22%22
-mixtools: 
 Tool
@@ -289,16 +289,16 @@
  Models%0A
+
 %0A    Ana
@@ -380,16 +380,835 @@
 ettings.
+  This includes mixtures of parametric distributions (normal,%0A    multivariate normal, multinomial, gamma), various Reliability Mixture%0A    Models (RMMs), mixtures-of-regressions settings (linear regression,%0A    logistic regression, Poisson regression, linear regression with%0A    changepoints, predictor-dependent mixing proportions, random effects%0A    regressions, hierarchical mixtures-of-experts), and tools for selecting the%0A    number of components (bootstrapping the likelihood ratio test statistic,%0A    mixturegrams, and model selection criteria).  Bayesian estimation of%0A    mixtures-of-linear-regressions models is available as well as a novel data%0A    depth method for obtaining credible bands.  This package is based upon work%0A    supported by the National Science Foundation under Grant No.%0A    SES-0518772.
 %22%22%22%0A%0A   
@@ -1420,16 +1420,112 @@
 tools%22%0A%0A
+    version('1.2.0', sha256='ef033ef13625209065d26767bf70d129972e6808927f755629f1d70a118b9023')%0A
     vers
@@ -1709,16 +1709,16 @@
 798c')%0A%0A
-
     depe
@@ -1749,32 +1749,165 @@
 build', 'run'))%0A
+    depends_on('r@3.5.0:', when='@1.2.0:', type=('build', 'run'))%0A    depends_on('r-kernlab', when='@1.2.0:', type=('build', 'run'))%0A
     depends_on('

add version 1.2.0 to r-mixtools (#21100)