libtree: add "master" version, variants and dependencies (#25337)

This commit is contained in:
Harmen Stoppels 2021-08-11 10:14:01 +02:00 committed by GitHub
parent 84e2469e41
commit 3b23b42519
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,10 +11,11 @@ class Libtree(CMakePackage):
single folder"""
homepage = "https://github.com/haampie/libtree"
git = "https://github.com/haampie/libtree.git"
url = "https://github.com/haampie/libtree/releases/download/v1.0.3/sources.tar.gz"
maintainers = ['haampie']
version('master', branch='master')
version('1.2.3', sha256='4a912cf97109219fe931942a30579336b6ab9865395447bd157bbfa74bf4e8cf')
version('1.2.2', sha256='4ccf09227609869b85a170550b636defcf0b0674ecb0785063b81785b1c29bdd')
version('1.2.1', sha256='26791c0f418b93d502879db0e1fd2fd3081b885ad87326611d992a5f8977a9b0')
@ -26,3 +27,33 @@ class Libtree(CMakePackage):
version('1.1.0', sha256='6cf36fb9a4c8c3af01855527d4931110732bb2d1c19be9334c689f1fd1c78536')
version('1.0.4', sha256='b15a54b6f388b8bd8636e288fcb581029f1e65353660387b0096a554ad8e9e45')
version('1.0.3', sha256='67ce886c191d50959a5727246cdb04af38872cd811c9ed4e3822f77a8f40b20b')
variant('chrpath', default=False, description='Use chrpath for deployment')
variant('strip', default=False, description='Use binutils strip for deployment')
# header only dependencies
depends_on('cpp-termcolor', when='@2.0:', type='build')
depends_on('cxxopts', when='@2.0:', type='build')
depends_on('elfio', when='@2.0:', type='build')
# runtime deps
depends_on('chrpath', when='+chrpath', type='run')
depends_on('binutils', when='+strip', type='run')
# testing
depends_on('googletest', type='test')
def cmake_args(self):
tests_enabled = 'ON' if self.run_tests else 'OFF'
if self.spec.satisfies('@2.0:'):
tests_define = 'LIBTREE_BUILD_TESTS'
else:
tests_define = 'BUILD_TESTING'
return [
self.define(tests_define, tests_enabled)
]
def check(self):
with working_dir(self.build_directory):
ctest('--output-on-failure')