libdrm: add docs variants and missing dependency (#29423)

This commit is contained in:
Harmen Stoppels 2022-03-15 17:38:57 +01:00 committed by GitHub
parent 825fed2ffa
commit 8c59736ff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,13 +27,26 @@ class Libdrm(Package):
version('2.4.59', sha256='ed9d03a92c2d80e6310cc350db3430620f1659ae084a07c6824cee7bc81ae8fa')
version('2.4.33', sha256='bd2a8fecf28616f2157ca33ede691c139cc294ed2d0c4244b62ca7d22e98e5a4')
variant('docs', default=False, description="Build man pages")
depends_on('pkgconfig', type='build')
depends_on('docbook-xml', type='build')
depends_on('docbook-xsl', type='build')
depends_on('libpciaccess@0.10:')
depends_on('libpthread-stubs')
# 2.4.90 is the first version to use meson, spack defaults to meson since
# 2.4.101.
depends_on('meson', type='build', when='@2.4.101:')
# >= 2.4.104 uses reStructuredText for man pages.
with when('@2.4.104: +docs'):
depends_on('py-docutils', type='build')
# < 2.4.104 uses docbook for man pages.
with when('@:2.4.103 +docs'):
depends_on('docbook-xml', type='build')
depends_on('docbook-xsl', type='build')
depends_on('libxslt', type='build')
def url_for_version(self, version):
if version <= Version('2.4.100'):
return self.list_url + 'libdrm-%s.tar.gz' % version
@ -41,8 +54,9 @@ def url_for_version(self, version):
return self.list_url + 'libdrm-%s.tar.xz' % version
def meson_args(self):
args = []
return args
return [
'-Dman-pages=' + ('true' if '+docs' in self.spec else 'false')
]
def install(self, spec, prefix):
with working_dir('spack-build', create=True):