build_libuv.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. #
  3. # Build libuv from source, you need to run this script as root.
  4. #
  5. # Copyright: SPDX-License-Identifier: GPL-3.0-or-later
  6. #
  7. # Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
  8. set -e
  9. LIBUV_VERSION="v1.32.0"
  10. # Their folder is libuv-1.32.0 while the tarball version is v1.32.0, so fix that until they fix it...
  11. LIBUV_DIR="/opt/libuv-${LIBUV_VERSION/v/}"
  12. # If we are not in netdata git repo, at the top level directory, fail
  13. TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)")
  14. CWD=$(git rev-parse --show-cdup)
  15. if [ -n "$CWD" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then
  16. echo "Run as .travis/package_management/$(basename "$0") from top level directory of netdata git repository"
  17. echo "Build libuv package from source code failed"
  18. exit 1
  19. fi
  20. echo "Fetching libuv from github"
  21. wget -O /opt/libuv.tar.gz "https://github.com/libuv/libuv/archive/${LIBUV_VERSION}.tar.gz"
  22. echo "Entering /opt and extracting source"
  23. cd /opt && tar -xf libuv.tar.gz && rm libuv.tar.gz
  24. echo "Entering ${LIBUV_DIR}"
  25. cd "${LIBUV_DIR}"
  26. echo "Compiling and installing"
  27. sh autogen.sh
  28. ./configure
  29. make && make check && make install
  30. echo "Done, enjoy libuv!"