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

Commit3306021

Browse files
authored
Merge pull request#13455 from tacaswell/fix_freetype_download_logic
BLD: only try to get freetype src if src does not exist
2 parentsa33422b +2ff0f71 commit3306021

File tree

1 file changed

+42
-34
lines changed

1 file changed

+42
-34
lines changed

‎setupext.py

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -960,43 +960,51 @@ def do_custom_build(self):
960960
else:
961961
libfreetype='libfreetype.a'
962962

963-
ifos.path.isfile(os.path.join(src_path,'objs','.libs',libfreetype)):
963+
# bailing because it is already built
964+
ifos.path.isfile(os.path.join(
965+
src_path,'objs','.libs',libfreetype)):
964966
return
965-
ifnotos.path.exists('build'):
966-
os.makedirs('build')
967-
968-
url_fmts= [
969-
('https://downloads.sourceforge.net/project/freetype'
970-
'/freetype2/{version}/{tarball}'),
971-
('https://download.savannah.gnu.org/releases/freetype'
972-
'/{tarball}')
973-
]
974-
tarball='freetype-{0}.tar.gz'.format(LOCAL_FREETYPE_VERSION)
975-
976-
target_urls= [
977-
url_fmt.format(version=LOCAL_FREETYPE_VERSION,
978-
tarball=tarball)
979-
forurl_fmtinurl_fmts]
980-
981-
fortarball_urlintarget_urls:
982-
try:
983-
tar_contents=download_or_cache(tarball_url,
984-
LOCAL_FREETYPE_HASH)
985-
break
986-
exceptException:
987-
pass
988-
else:
989-
raiseIOError("Failed to download FreeType. Please download "+
990-
"one of {target_urls} ".format(
991-
target_urls=target_urls)+
992-
"and extract it into the build directory "
993-
"at the top-level of the source repository")
994967

995-
print("Building {}".format(tarball))
996-
tar_contents.seek(0)
997-
withtarfile.open(tarball,mode="r:gz",fileobj=tar_contents)astgz:
998-
tgz.extractall("build")
968+
# do we need to download / load the source from cache?
969+
ifnotos.path.exists(src_path):
970+
ifnotos.path.exists('build'):
971+
os.makedirs('build')
999972

973+
url_fmts= [
974+
('https://downloads.sourceforge.net/project/freetype'
975+
'/freetype2/{version}/{tarball}'),
976+
('https://download.savannah.gnu.org/releases/freetype'
977+
'/{tarball}')
978+
]
979+
tarball='freetype-{0}.tar.gz'.format(LOCAL_FREETYPE_VERSION)
980+
981+
target_urls= [
982+
url_fmt.format(version=LOCAL_FREETYPE_VERSION,
983+
tarball=tarball)
984+
forurl_fmtinurl_fmts]
985+
986+
fortarball_urlintarget_urls:
987+
try:
988+
tar_contents=download_or_cache(tarball_url,
989+
LOCAL_FREETYPE_HASH)
990+
break
991+
exceptException:
992+
pass
993+
else:
994+
raiseIOError("Failed to download FreeType. Please download "
995+
"one of {target_urls} and extract it into "
996+
"{src_path} at the top-level of the source "
997+
"repository".format(
998+
target_urls=target_urls,src_path=src_path))
999+
1000+
print("Extracting {}".format(tarball))
1001+
# just to be sure
1002+
tar_contents.seek(0)
1003+
withtarfile.open(tarball,mode="r:gz",
1004+
fileobj=tar_contents)astgz:
1005+
tgz.extractall("build")
1006+
1007+
print("Building freetype in {}".format(src_path))
10001008
ifsys.platform!='win32':
10011009
# compilation on all other platforms than windows
10021010
env= {**os.environ,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp