Add xxd for hsa-rocr-dev build script (#23855)

This commit is contained in:
Harmen Stoppels
2021-05-25 22:58:30 +02:00
committed by GitHub
parent 3cef5663d8
commit f2ce57bf77
4 changed files with 41 additions and 8 deletions

View File

@@ -34,7 +34,9 @@ class HsaRocrDev(CMakePackage):
variant('image', default=True, description='build with or without image support')
depends_on('cmake@3:', type="build")
depends_on('xxd', when='@3.7: +image', type='build')
depends_on('libelf@0.8:', type='link')
for ver in ['3.5.0', '3.7.0', '3.8.0', '3.9.0', '3.10.0', '4.0.0', '4.1.0',
'4.2.0', 'master']:
depends_on('hsakmt-roct@' + ver, type=('link', 'run'), when='@' + ver)
@@ -51,12 +53,13 @@ class HsaRocrDev(CMakePackage):
def cmake_args(self):
libelf_include = self.spec['libelf'].prefix.include.libelf
args = ['-DLIBELF_INCLUDE_DIRS=%s' % libelf_include]
self.define_from_variant('BUILD_SHARED_LIBS', 'shared')
args = [
self.define('LIBELF_INCLUDE_DIRS', libelf_include),
self.define_from_variant('BUILD_SHARED_LIBS', 'shared')
]
if '@3.7.0:' in self.spec:
self.define_from_variant('IMAGE_SUPPORT', 'image')
args.append(self.define_from_variant('IMAGE_SUPPORT', 'image'))
if '@4.2.0:' in self.spec:
bitcode_dir = self.spec['rocm-device-libs'].prefix.amdgcn.bitcode

View File

@@ -49,6 +49,8 @@ class Vim(AutotoolsPackage):
variant('cscope', default=False, description="build with cscope support")
depends_on('cscope', when='+cscope', type='run')
provides('xxd')
# TODO: Once better support for multi-valued variants is added, add
# support for auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/photon/carbon
variant('gui', default=False, description="build with gui (gvim)")

View File

@@ -0,0 +1,27 @@
# 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 *
import os
class XxdStandalone(MakefilePackage):
"""xxd creates a hex dump of a given file or standard input.
It is bundled with vim, but as xxd is used in build scripts,
it makes sense to have it available as a standalone package."""
homepage = "https://www.vim.org/"
url = "https://github.com/vim/vim/archive/v8.2.1201.tar.gz"
maintainers = ['haampie']
build_targets = ['-C', os.path.join('src', 'xxd')]
provides('xxd')
version('8.2.1201', sha256='39032fe866f44724b104468038dc9ac4ff2c00a4b18c9a1e2c27064ab1f1143d')
def install(self, spec, prefix):
mkdirp(prefix.bin)
install(os.path.join(self.build_directory, 'src', 'xxd', 'xxd'), prefix.bin)