summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/mesa-demos/package.py
blob: 6e6f2cbfc6d07b98081e2a42c4d3b5754320cc02 (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
# 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)
import sys

from spack.package import *


class MesaDemos(AutotoolsPackage):
    """This package provides some demo applications for testing Mesa."""

    homepage = "https://www.mesa3d.org"
    url      = "https://github.com/freedesktop/mesa-demos/archive/mesa-demos-8.3.0.tar.gz"

    version('8.3.0', sha256='9bc1b37f4fc7bfc3f818f2d3851ffde28e8167ef11dca87f4781e9ef6206901f')
    version('8.2.0', sha256='5a9f71b815d968d0c3b77edfcc3782d0211f8520b00da9e554ccfed80c8889f6')
    version('8.1.0', sha256='cc5826105355830208c90047fc38c5b09fa3ab0045366e7e859104935b00b76d')

    variant('osmesa', default=False, description="Enable the OSMesa frontend.")

    is_linux = sys.platform.startswith('linux')
    variant('glx', default=is_linux, description="Enable the GLX frontend.")

    conflicts('+osmesa', when='+glx')

    depends_on('autoconf',  type='build')
    depends_on('automake',  type='build')
    depends_on('libtool',   type='build')
    depends_on('m4',        type='build')
    depends_on('pkgconfig', type='build')

    depends_on('gl')
    depends_on('glx', when='+glx')
    depends_on('libx11',  when='+glx')
    depends_on('libxext', when='+glx')
    depends_on('osmesa', when='+osmesa')

    depends_on('glu', when='~osmesa')
    depends_on('mesa-glu+osmesa', when='+osmesa')
    depends_on('freeglut')
    depends_on('glew@1.5.4:')

    def configure_args(self):
        args = [
            '--disable-egl',
            '--disable-gles1',
            '--disable-gles2',
            '--disable-vg',
            '--disable-libdrm',
            '--disable-wayland',
            '--disable-gbm',
            '--disable-freetype2',
            '--disable-rbug',
            self.enable_or_disable('osmesa'),
            self.enable_or_disable('x11', variant='glx'),
        ]

        return args