Add KITTY_VCS_REV for release builds as well
This commit is contained in:
parent
5b46d990a2
commit
cd8bb462c3
@ -106,6 +106,8 @@ def build_c_extensions(ext_dir, args):
|
|||||||
cmd = SETUP_CMD + ['macos-freeze' if ismacos else 'linux-freeze']
|
cmd = SETUP_CMD + ['macos-freeze' if ismacos else 'linux-freeze']
|
||||||
if args.dont_strip:
|
if args.dont_strip:
|
||||||
cmd.append('--debug')
|
cmd.append('--debug')
|
||||||
|
if args.extra_program_data:
|
||||||
|
cmd.append(f'--vcs-rev={args.extra_program_data}')
|
||||||
dest = kitty_constants['appname'] + ('.app' if ismacos else '')
|
dest = kitty_constants['appname'] + ('.app' if ismacos else '')
|
||||||
dest = build_frozen_launcher.prefix = os.path.join(ext_dir, dest)
|
dest = build_frozen_launcher.prefix = os.path.join(ext_dir, dest)
|
||||||
cmd += ['--prefix', dest, '--full']
|
cmd += ['--prefix', dest, '--full']
|
||||||
|
|||||||
@ -69,6 +69,7 @@ class Env:
|
|||||||
ans.wayland_scanner = self.wayland_scanner
|
ans.wayland_scanner = self.wayland_scanner
|
||||||
ans.wayland_scanner_code = self.wayland_scanner_code
|
ans.wayland_scanner_code = self.wayland_scanner_code
|
||||||
ans.wayland_protocols = self.wayland_protocols
|
ans.wayland_protocols = self.wayland_protocols
|
||||||
|
ans.vcs_rev = self.vcs_rev
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -62,6 +62,10 @@ def call(*cmd: str, cwd: Optional[str] = None, echo: bool = False) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def run_build(args: Any) -> None:
|
def run_build(args: Any) -> None:
|
||||||
|
import runpy
|
||||||
|
|
||||||
|
m = runpy.run_path('./setup.py', run_name='__publish__')
|
||||||
|
vcs_rev: str = m['get_vcs_rev']()
|
||||||
|
|
||||||
def run_with_retry(cmd: str) -> None:
|
def run_with_retry(cmd: str) -> None:
|
||||||
try:
|
try:
|
||||||
@ -78,9 +82,9 @@ def run_build(args: Any) -> None:
|
|||||||
|
|
||||||
for x in ('64', '32', 'arm64'):
|
for x in ('64', '32', 'arm64'):
|
||||||
prefix = f'python ../bypy linux --arch {x} '
|
prefix = f'python ../bypy linux --arch {x} '
|
||||||
run_with_retry(prefix + 'program --non-interactive')
|
run_with_retry(prefix + f'program --non-interactive --extra-program-data "{vcs_rev}"')
|
||||||
call(prefix + 'shutdown', echo=True)
|
call(prefix + 'shutdown', echo=True)
|
||||||
run_with_retry('python ../bypy macos program --sign-installers --notarize --non-interactive')
|
run_with_retry(f'python ../bypy macos program --sign-installers --notarize --non-interactive --extra-program-data "{vcs_rev}"')
|
||||||
call('python ../bypy macos shutdown', echo=True)
|
call('python ../bypy macos shutdown', echo=True)
|
||||||
call('./setup.py build-static-binaries')
|
call('./setup.py build-static-binaries')
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -838,7 +838,7 @@ def init_env_from_args(args: Options, native_optimizations: bool = False) -> Non
|
|||||||
args.debug, args.sanitize, native_optimizations, args.link_time_optimization, args.profile,
|
args.debug, args.sanitize, native_optimizations, args.link_time_optimization, args.profile,
|
||||||
args.egl_library, args.startup_notification_library, args.canberra_library, args.fontconfig_library,
|
args.egl_library, args.startup_notification_library, args.canberra_library, args.fontconfig_library,
|
||||||
args.extra_logging, args.extra_include_dirs, args.ignore_compiler_warnings,
|
args.extra_logging, args.extra_include_dirs, args.ignore_compiler_warnings,
|
||||||
args.build_universal_binary, args.extra_library_dirs, verbose=args.verbose > 0
|
args.build_universal_binary, args.extra_library_dirs, verbose=args.verbose > 0, vcs_rev=args.vcs_rev,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user