-
-
Notifications
You must be signed in to change notification settings - Fork 626
Refactor build scripting to support Python 3 only builds, pinned build dependency versions, optional system installed build dependencies #416
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
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
8490024
add support for pipenv Python dependency version pinning
chrissimpkins 384f3fa
copies build-ttf.sh as build-ttf-system.sh to use as basis for script…
chrissimpkins fe6e6ba
[build-pipenv.sh] added new shell script that supports builds of venv…
chrissimpkins e3c0e97
updated script documentation
chrissimpkins 1700e78
[build-pipenv.sh] modified if blocks in shell script
chrissimpkins 74d359e
[build-pipenv.sh] add Python interpreter version to environment report
chrissimpkins 0eb8a96
[build-ttf.sh] transitioned Python build tool calls to use of pipenv …
chrissimpkins 176a14a
[build-subsets.sh] eliminated build dependency checks, these are now …
chrissimpkins bda185c
[build-subsets.sh] transitioned to use of pipenv virtualenv installs …
chrissimpkins da20882
[Makefile] added pipenv venv setup script to the build process
chrissimpkins 7de5d65
added Python interpreter version definition to virtualenv scripting
chrissimpkins 10c5444
modified build variable name
chrissimpkins aff9f86
removed unnecessary build shell script
chrissimpkins 4d8a9a1
added new sfnt2woff-zopfli local install script
chrissimpkins 953c35b
[build-ttf.sh] updated script to support pinned and system installed …
chrissimpkins 14b1912
[Makefile] updated make targets
chrissimpkins dd71f61
[build-woff.sh] added support for pinned version and system installed…
chrissimpkins 353455d
[build-ttf.sh] fixes incorrect executable path checks with system ins…
chrissimpkins 0da551b
[build-woff.sh] refactored default build approach path test for depen…
chrissimpkins c0f9b0c
added new woff2-compress-build shell script for local builds of woff2…
chrissimpkins f1c3c53
[Makefile] updated make target shell script path for local woff2_comp…
chrissimpkins 8b05246
[build-woff2.sh] added support for pinned dependency builds and rolli…
chrissimpkins 63c6f05
[build-woff2.sh] removed unnecessary variable
chrissimpkins 83eac63
[Makefile] updated shellcheck target deps
chrissimpkins 2b1d273
[build-subsets.sh] updated shell script to support pinned build depen…
chrissimpkins 843e689
new build-archives.sh shell script
chrissimpkins 1028b7e
[Makefile] updated archives make target with new shell script path
chrissimpkins 842a21f
[Makefile] added subsets-system make target
chrissimpkins 4c48555
[Makefile] added subsets-system target to .PHONY
chrissimpkins e20d786
[fix-dsig.py] removed from __future__ imports, code formatting = pass…
chrissimpkins 0a01f04
[fix-fstype.py] source code formatting changes = passes flake8 tests
chrissimpkins 96a35cb
[woff2-compress-build.sh] convert to upstream woff2 at v1.0.2 (includ…
chrissimpkins ee180fb
[build-pipenv.sh] modified command to create the pipenv virtual envir…
chrissimpkins 8b7feda
[Makefile] added documentation and process specific target arrangement
chrissimpkins d6df277
[BUILD.md] updated build documentation with v4.x build tooling changes
chrissimpkins 1dd3664
[BUILD.md] added TOC
chrissimpkins b1ebe12
[BUILD.md] minor text revisions
chrissimpkins bc6a683
[BUILD.md] added documentation for system PATH installed build depend…
chrissimpkins 2a46cad
[woff2-compress-build.sh] modified woff2_compress to use brotli v1.0.3
chrissimpkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,94 @@ | ||
all: build | ||
|
||
archives: | ||
postbuild_processing/archive_prep/archiver.sh | ||
# FONT COMPILES | ||
|
||
# | ||
# Recommended usage: | ||
# | ||
# The following targets build *.ttf, *.woff, *.woff2 (including *.woff and *.woff2 subsets): | ||
# | ||
# `make` - builds fonts with pinned build dependency versions of all Python and local, compiled C/C++ projects | ||
# `make build-system` - builds fonts with system PATH installed versions of build dependencies | ||
# | ||
# Dependency installs for default builds with `make` can be executed with: | ||
# | ||
# 1) pip3 install pipenv | ||
# 2) make compile-local-dep | ||
# | ||
# Optional dependency install for `make` if your development system does not support the defined Python interpreter version: | ||
# | ||
# 3) curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | ||
# | ||
|
||
build: ttf webfonts | ||
|
||
build-with-dependencies: source/*.ufo | ||
./build-ttf.sh --install-dependencies | ||
./build-woff.sh --install-dependencies | ||
./build-woff2.sh --install-dependencies | ||
build-with-dependencies: compile-local-dep ttf webfonts | ||
|
||
build-system: ttf-system webfonts-system | ||
|
||
build-local-ttfa: | ||
tools/scripts/install/ttfautohint-build.sh | ||
|
||
build-local-sfnt2woffzopfli: | ||
tools/scripts/install/sfnt2woff-zopfli-build.sh | ||
|
||
build-local-woff2: | ||
tools/scripts/install/woff2-compress-build.sh | ||
|
||
compile-local-dep: build-local-ttfa build-local-sfnt2woffzopfli build-local-woff2 | ||
|
||
pipenv: | ||
./build-pipenv.sh | ||
|
||
subsets: pipenv | ||
./build-subsets.sh | ||
|
||
subsets-system: | ||
./build-subsets.sh --system | ||
|
||
ttf: pipenv | ||
./build-ttf.sh | ||
|
||
ttf-system: | ||
./build-ttf.sh --system | ||
|
||
webfonts: woff woff2 subsets | ||
|
||
webfonts-system: woff-system woff2-system subsets-system | ||
|
||
woff: pipenv | ||
./build-woff.sh | ||
|
||
woff-system: | ||
./build-woff.sh --system | ||
|
||
woff2: pipenv | ||
./build-woff2.sh | ||
|
||
woff2-system: | ||
./build-woff2.sh --system | ||
|
||
|
||
# RELEASE PREP | ||
|
||
archives: | ||
./build-archives.sh | ||
|
||
css: | ||
tools/scripts/css/css-build.sh | ||
|
||
lint: shellcheck ufolint | ||
|
||
shellcheck: build-ttf.sh build-woff.sh build-woff2.sh build-subsets.sh tools/scripts/install/ttfautohint-build.sh postbuild_processing/archive_prep/archiver.sh tools/scripts/css/css-build.sh | ||
$@ $^ | ||
# TESTING | ||
|
||
subsets: source/*.ufo | ||
./build-subsets.sh | ||
lint: shellcheck ufolint | ||
|
||
ttf: | ||
./build-ttf.sh | ||
shellcheck: *.sh tools/scripts/css/*.sh tools/scripts/install/*.sh | ||
$@ $^ | ||
|
||
ufolint: source/*.ufo | ||
$@ $^ | ||
|
||
webfonts: | ||
./build-woff.sh | ||
./build-woff2.sh | ||
./build-subsets.sh | ||
|
||
woff: | ||
./build-woff.sh | ||
# PHONY TARGETS | ||
|
||
woff2: | ||
./build-woff2.sh | ||
.PHONY: all archives build build-with-dependencies build-local-ttfa build-local-sfnt2woffzopfli build-local-woff2 build-system compile-local-dep css lint pipenv shellcheck subsets subsets-system ttf ttf-system ufolint webfonts webfonts-system woff woff-system woff2 woff2-system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[[source]] | ||
|
||
url = "https://pypi.python.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
|
||
[packages] | ||
|
||
fonttools = "*" | ||
fontmake = "*" | ||
|
||
|
||
[dev-packages] | ||
|
||
|
||
|
||
[requires] | ||
|
||
python_version = "3.6" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
|
||
# ///////////////////////////////////////////////////////////////// | ||
# | ||
# build-pipenv.sh | ||
# A shell script that creates a virtualenv for Hack font builds | ||
# Copyright 2018 Christopher Simpkins | ||
# MIT License | ||
# | ||
# Usage: ./build-pipenv.sh | ||
# | ||
# ///////////////////////////////////////////////////////////////// | ||
|
||
if ! which pipenv | ||
then | ||
echo "Unable to detect a pipenv install. Please install with 'pip install pipenv' then repeat your build attempt." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# create virtualenv and install build dependencies | ||
pipenv install --ignore-pipfile | ||
|
||
# test for fontmake install in venv | ||
if ! pipenv run fontmake --version | ||
then | ||
echo "Unable to detect fontmake install with pipenv. Please repeat your build attempt." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# test for fontTools install in venv | ||
if ! pipenv run python -c "import fontTools" | ||
then | ||
echo "Unable to detect fontTools install with pipenv. Please repeat your build attempt." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# print environment used for build to std output stream | ||
|
||
echo "=================================" | ||
echo " PYTHON BUILD ENVIRONMENT" | ||
echo "=================================" | ||
echo " " | ||
echo "Python interpreter version:" | ||
pipenv run python --version | ||
echo " " | ||
pipenv graph | ||
|
||
echo " " | ||
echo "=================================" | ||
echo " " | ||
echo "=================================" | ||
echo " " |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to specify fonttools in addition to fontmake, because the former is a dependency of the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safe to depend on the fact that this will always be the case? We have local Python scripts that depend on fontTools and will not pull it in with a pip install. pipenv simply ignores it since it was pulled in with fontmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, if you've scripts that directly depend on fonttools then it makes sense to have it there.