Skip to content

Commit 4d8a9a1

Browse files
committed
added new sfnt2woff-zopfli local install script
1 parent aff9f86 commit 4d8a9a1

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/sh
2+
3+
# /////////////////////////////////////////////////////////////////
4+
#
5+
# sfnt2woff-zopfli-build.sh
6+
# A shell script that builds the sfnt2woff-zopfli build dependency
7+
# Copyright 2018 Christopher Simpkins
8+
# MIT License
9+
#
10+
# Usage: ./sfnt2woff-zopfli-build.sh
11+
#
12+
# /////////////////////////////////////////////////////////////////
13+
14+
# The sfnt2woff-zopfli build directory.
15+
BUILD="$HOME/sfnt2woff-zopfli-build"
16+
17+
# sfnt2woff-zopfli version
18+
SFNTWOFF_VERSION="1.1.0"
19+
SFNTWOFF="sfnt2woff-zopfli-$SFNTWOFF_VERSION"
20+
21+
# Path to sfnt2woff-zopfli executable
22+
SFNTWOFF_BIN="$BUILD/$SFNTWOFF/sfnt2woff-zopfli"
23+
24+
if test -d "$BUILD" -o -f "$BUILD"; then
25+
echo "Build directory '$BUILD' must not exist."
26+
exit 1
27+
fi
28+
29+
mkdir "$BUILD"
30+
31+
cd "$BUILD" || exit 1
32+
33+
echo "#####"
34+
echo "Download archive."
35+
echo "#####"
36+
37+
curl -L -O "https://github.com/bramstein/sfnt2woff-zopfli/archive/v$SFNTWOFF_VERSION.tar.gz"
38+
39+
echo "#####"
40+
echo "Extract archives."
41+
echo "#####"
42+
43+
tar -xzvf "v$SFNTWOFF_VERSION.tar.gz"
44+
45+
cd "$SFNTWOFF" || exit 1
46+
47+
echo "#####"
48+
echo "Build $SFNTWOFF."
49+
echo "#####"
50+
51+
make
52+
53+
if [ -f "$SFNTWOFF_BIN" ]; then
54+
echo "sfnt2woff-zopfli successfully built on the path '$SFNTWOFF_BIN'"
55+
else
56+
echo "The sfnt2woff-zopfli build failed."
57+
exit 1
58+
fi

0 commit comments

Comments
 (0)