woff2-compress-build.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. # /////////////////////////////////////////////////////////////////
  3. #
  4. # woff2-compress-build.sh
  5. # A shell script that builds the woff2_compress build dependency
  6. # Copyright 2018 Christopher Simpkins
  7. # MIT License
  8. #
  9. # Usage: ./woff2-compress-build.sh
  10. #
  11. # /////////////////////////////////////////////////////////////////
  12. # The woff2 git clone directory.
  13. BUILD="$HOME"
  14. INST="$HOME/woff2"
  15. # woff2 executable path
  16. WOFF2_BIN="$BUILD/woff2/woff2_compress"
  17. if test -d "$INST" -o -f "$INST"; then
  18. echo "Build directory \`$INST' must not exist."
  19. exit 1
  20. fi
  21. cd "$BUILD" || exit 1
  22. echo "#####"
  23. echo "git clone woff2 project"
  24. echo "#####"
  25. # clone the Source Foundry fork of the woff2 repo
  26. # contains fix for OS X build bug - https://github.com/google/woff2/issues/73
  27. # recursive flag to clone the brotli submodule within the woff2 repo
  28. git clone --recursive https://github.com/source-foundry/woff2.git
  29. cd "$INST" || exit 1
  30. echo "#####"
  31. echo "Build woff2"
  32. echo "#####"
  33. make clean all
  34. if [ -f "$WOFF2_BIN" ]; then
  35. echo " "
  36. echo "woff2_compress successfully built on the path '$WOFF2_BIN'"
  37. else
  38. echo "The woff2_compress build failed."
  39. exit 1
  40. fi