32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
 | |
| import re
 | |
| from SCons.Script import *
 | |
| 
 | |
| _REPO_NAME = 'ImageMagick'
 | |
| _REPO_URL = 'https://github.com/ImageMagick/ImageMagick.git'
 | |
| _TAG_PATTERN = re.compile(r'^([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)$')
 | |
| 
 | |
| def versions(env: Environment, update: bool = False):
 | |
|     tags = env.GitTags(repo_name = _REPO_NAME, remote_url = _REPO_URL, force_fetch=update)
 | |
|     result = []
 | |
|     for tag in tags:
 | |
|         match = _TAG_PATTERN.match(tag)
 | |
|         if match:
 | |
|             result.append((int(match.groups()[0]), int(match.groups()[1]), int(match.groups()[2]), int(match.groups()[3])))
 | |
|     return result
 | |
| 
 | |
| def dependencies(env: Environment, version) -> 'dict':
 | |
|     return {}
 | |
| 
 | |
| def cook(env: Environment, version) -> dict:
 | |
|     raise Exception('this still needs to be implemented property :/')
 | |
|     # git_ref = f'refs/tags/{version[0]}.{version[1]}.{version[2]}-{version[3]}'
 | |
|     # repo = env.GitBranch(repo_name = _REPO_NAME, remote_url = _REPO_URL, git_ref = git_ref)
 | |
|     # checkout_root = repo['checkout_root']
 | |
|     # build_result = env.AutotoolsProject(checkout_root)
 | |
|     # return {
 | |
|     #     'LIBPATH': build_result['LIBPATH'],
 | |
|     #     'CPPPATH': build_result['CPPPATH'],
 | |
|     #     'LIBS': ['backtrace']
 | |
|     # }
 |