Skip to content

Commit

Permalink
Merge pull request #267 from bgilbert/meson
Browse files Browse the repository at this point in the history
Drop workaround for sdist failure on stale work tree
  • Loading branch information
bgilbert authored Jul 14, 2024
2 parents cb400c4 + 15a11c5 commit 67a59e0
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions bintool
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ from common.meson import (
)
from common.software import Project

WINDOWS_API_VERS = (4,)
LINUX_API_VERS = (3,)
# we have a higher minimum than the underlying meson.build
MESON_MIN_VER = (1, 5, 0)

CACHEDIR_TAG_CONTENTS = '''Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by openslide-bin.
# For information about cache directory tags, see https://bford.info/cachedir/
Expand Down Expand Up @@ -147,16 +152,26 @@ class BuildParams:
return False

with self.lock():
if has_api('winbuild', [1, 2, 3]):
if has_api('winbuild', WINDOWS_API_VERS):
plat: Platform = MesonPlatform(
self, 'windows', 'x64', cross=True
)
elif has_api('linux', [1, 2]):
elif has_api('linux', LINUX_API_VERS):
plat = MesonPlatform(
self, 'linux', platform.machine(), cross=False
)
elif sys.platform == 'darwin':
# no container image to check for
meson_ver = (
subprocess.check_output(['meson', '--version'])
.decode()
.strip()
)
if tuple(int(c) for c in meson_ver.split('.')) < MESON_MIN_VER:
raise Exception(
f'Meson version {meson_ver} < '
f'{".".join(str(c) for c in MESON_MIN_VER)}'
)
plat = MacPlatform(self, ['arm64', 'x86_64'])
else:
raise Exception(
Expand Down Expand Up @@ -344,11 +359,6 @@ class MesonPlatform(Platform):
cwd=self.params.root,
)
dir = self._setup('sdist', ['-Dall_systems=true'])
# avoid spurious complaints about a dirty work tree
# https://github.com/mesonbuild/meson/pull/13152
subprocess.check_call(
['git', 'update-index', '-q', '--refresh'], cwd=self.params.root
)
subprocess.check_call(
[
# xz compresses better, but PyPI requires tar.gz, and there's
Expand Down

0 comments on commit 67a59e0

Please sign in to comment.