Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Backport PR #13455 on branch v3.0.x (BLD: only try to get freetype src if src does not exist)#13460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 42 additions & 34 deletionssetupext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1147,43 +1147,51 @@ def do_custom_build(self):
else:
libfreetype = 'libfreetype.a'

if os.path.isfile(os.path.join(src_path, 'objs', '.libs', libfreetype)):
# bailing because it is already built
if os.path.isfile(os.path.join(
src_path, 'objs', '.libs', libfreetype)):
return
if not os.path.exists('build'):
os.makedirs('build')

url_fmts = [
('https://downloads.sourceforge.net/project/freetype'
'/freetype2/{version}/{tarball}'),
('https://download.savannah.gnu.org/releases/freetype'
'/{tarball}')
]
tarball = 'freetype-{0}.tar.gz'.format(LOCAL_FREETYPE_VERSION)

target_urls = [
url_fmt.format(version=LOCAL_FREETYPE_VERSION,
tarball=tarball)
for url_fmt in url_fmts]

for tarball_url in target_urls:
try:
tar_contents = download_or_cache(tarball_url,
LOCAL_FREETYPE_HASH)
break
except Exception:
pass
else:
raise IOError("Failed to download FreeType. Please download " +
"one of {target_urls} ".format(
target_urls=target_urls) +
"and extract it into the build directory "
"at the top-level of the source repository")

print("Building {}".format(tarball))
tar_contents.seek(0)
with tarfile.open(tarball, mode="r:gz", fileobj=tar_contents) as tgz:
tgz.extractall("build")
# do we need to download / load the source from cache?
if not os.path.exists(src_path):
if not os.path.exists('build'):
os.makedirs('build')

url_fmts = [
('https://downloads.sourceforge.net/project/freetype'
'/freetype2/{version}/{tarball}'),
('https://download.savannah.gnu.org/releases/freetype'
'/{tarball}')
]
tarball = 'freetype-{0}.tar.gz'.format(LOCAL_FREETYPE_VERSION)

target_urls = [
url_fmt.format(version=LOCAL_FREETYPE_VERSION,
tarball=tarball)
for url_fmt in url_fmts]

for tarball_url in target_urls:
try:
tar_contents = download_or_cache(tarball_url,
LOCAL_FREETYPE_HASH)
break
except Exception:
pass
else:
raise IOError("Failed to download FreeType. Please download "
"one of {target_urls} and extract it into "
"{src_path} at the top-level of the source "
"repository".format(
target_urls=target_urls, src_path=src_path))

print("Extracting {}".format(tarball))
# just to be sure
tar_contents.seek(0)
with tarfile.open(tarball, mode="r:gz",
fileobj=tar_contents) as tgz:
tgz.extractall("build")

print("Building freetype in {}".format(src_path))
if sys.platform != 'win32':
# compilation on all other platforms than windows
env = {**os.environ,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp