Skip to content

Use a specific version of Freetype for testing #5306

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 5, 2015
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Amend, rather than override, CFLAGS
  • Loading branch information
mdboom committed Nov 5, 2015
commit c2af9c68a6676f9d84946f56e322ba760b4dd83e
7 changes: 5 additions & 2 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,13 +996,16 @@ def do_custom_build(self):
raise IOError("{0} does not match expected hash.".format(tarball))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do a hash check here to make sure that we get an uncorrupted file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

print("Building {0}".format(tarball))
cflags = 'CFLAGS="{0} -fPIC" '.format(os.environ.get('CFLAGS', ''))

subprocess.check_call(
['tar zxf {0}'.format(tarball)], shell=True, cwd='build')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you need to bother with shell=True here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without shell=True you have to give an absolute path to tar which requires reimplementing which in Python. There's enough one-off code in setupext.py as it is, and since this isn't running code from outside, the security implications are minor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's true. subprocess.check_call(['tar', 'zxf', tarball], cwd='build') works just fine for me. Maybe it's because you're passing a string in a list instead of a plain string, or a list of strings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. It seems the "list of strings" and "shell=True" are mutually exclusive. I'll update this to not use shell.

subprocess.check_call(
['CFLAGS=-fPIC ./configure --without-zlib --without-bzip2 --without-png'],
[cflags +
'./configure --without-zlib --without-bzip2 --without-png'],
shell=True, cwd=src_path)
subprocess.check_call(
['CFLAGS=-fPIC make'], shell=True, cwd=src_path)
[cflags + 'make'], shell=True, cwd=src_path)


class FT2Font(SetupPackage):
Expand Down