Command to build deps

This commit is contained in:
Kovid Goyal 2019-09-05 07:13:20 +05:30
parent 1fbfffd772
commit f52d529090
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 38 additions and 16 deletions

View File

@ -20,14 +20,15 @@ __all__ = [
'upload_installers', 'upload_installers',
'upload_user_manual', 'upload_demo', 'reupload', 'upload_user_manual', 'upload_demo', 'reupload',
'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas', 'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas',
'linux', 'linux32', 'linux64', 'win', 'win32', 'win64', 'osx', 'linux', 'linux32', 'linux64', 'win', 'win32', 'win64', 'osx', 'build_dep',
] ]
from setup.installers import Linux, Win, OSX, Linux32, Linux64, Win32, Win64, ExtDev from setup.installers import Linux, Win, OSX, Linux32, Linux64, Win32, Win64, ExtDev, BuildDep
linux, linux32, linux64 = Linux(), Linux32(), Linux64() linux, linux32, linux64 = Linux(), Linux32(), Linux64()
win, win32, win64 = Win(), Win32(), Win64() win, win32, win64 = Win(), Win32(), Win64()
osx = OSX() osx = OSX()
extdev = ExtDev() extdev = ExtDev()
build_dep = BuildDep()
from setup.translations import POT, GetTranslations, Translations, ISO639, ISO3166 from setup.translations import POT, GetTranslations, Translations, ISO639, ISO3166
pot = POT() pot = POT()

View File

@ -88,6 +88,15 @@ def build_single(which='windows', bitness='64', shutdown=True):
subprocess.Popen(cmd).wait() subprocess.Popen(cmd).wait()
def build_dep(args):
base, bypy = get_paths()
exe = get_exe()
cmd = [exe, bypy] + list(args)
ret = subprocess.Popen(cmd).wait()
if ret != 0:
raise SystemExit(ret)
class BuildInstaller(Command): class BuildInstaller(Command):
OS = BITNESS = '' OS = BITNESS = ''
@ -151,6 +160,18 @@ class Win(BuildInstallers):
OS = 'win' OS = 'win'
class BuildDep(Command):
description = (
'Build a calibre dependency. For e.g. build_dep windows expat.'
' Without arguments builds all deps for specified platform. Use windows 32 for 32bit.'
)
def run(self, opts):
args = opts.cli_args
build_dep(args)
class ExtDev(Command): class ExtDev(Command):
description = 'Develop a single native extension conveniently' description = 'Develop a single native extension conveniently'