File indexing completed on 2024-05-12 04:22:35
0001 #!/bin/python3 0002 0003 import os 0004 import sys 0005 import subprocess 0006 import argparse 0007 0008 # Capture our command line parameters 0009 parser = argparse.ArgumentParser(description='A script for building Krita Windows package on CI') 0010 parser.add_argument('--skip-debug-package', default=False, action='store_true') 0011 arguments = parser.parse_args() 0012 0013 buildPath = os.path.abspath('_build') 0014 depsPath = os.path.abspath('_install') 0015 0016 if arguments.skip_debug_package: 0017 os.environ['KRITA_SKIP_DEBUG_PACKAGE'] = '1' 0018 0019 kritaVersionString = '' 0020 0021 with open(os.path.join(buildPath, "libs/version/kritaversion.h"), "r") as fp: 0022 for line in fp: 0023 if line.strip().startswith('#define KRITA_VERSION_STRING'): 0024 kritaVersionString = line.split()[-1].strip('\"') 0025 print ('krita version: {}'.format(kritaVersionString)) 0026 break 0027 0028 commandToRun = ' '.join(['packaging\windows\package-complete.cmd', 0029 '--no-interactive', 0030 '--package-name', 'krita-{}-{}'.format(kritaVersionString, os.environ['CI_COMMIT_SHORT_SHA']), 0031 '--src-dir', os.getcwd(), 0032 '--deps-install-dir', depsPath, 0033 '--krita-install-dir', depsPath]) 0034 0035 # Run the command 0036 try: 0037 print( "## RUNNING: " + commandToRun ) 0038 subprocess.check_call( commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True ) 0039 except Exception: 0040 print("## Failed to build the appimage") 0041 sys.exit(1)