woff2-compress-build.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_COMMIT="5e5f2cf20d5f9d3373a2d8b4905105f80646c014"
  16. # woff2 executable path
  17. WOFF2_BIN="$BUILD/woff2/woff2_compress"
  18. if test -d "$INST" -o -f "$INST"; then
  19. echo "Build directory \`$INST' must not exist."
  20. exit 1
  21. fi
  22. cd "$BUILD" || exit 1
  23. echo "#####"
  24. echo "git clone woff2 project"
  25. echo "#####"
  26. # clone the woff2 repository
  27. git clone --recursive https://github.com/google/woff2.git
  28. cd "$INST" || exit 1
  29. # checkout desired version tag
  30. echo " "
  31. echo "Checking out woff2 at commit $WOFF2_COMMIT"
  32. git checkout $WOFF2_COMMIT
  33. echo "#####"
  34. echo "Build woff2"
  35. echo "#####"
  36. make clean all
  37. if [ -f "$WOFF2_BIN" ]; then
  38. echo " "
  39. echo "woff2_compress successfully built on the path '$WOFF2_BIN'"
  40. else
  41. echo "The woff2_compress build failed."
  42. exit 1
  43. fi