common.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. set -x
  3. set -euo pipefail
  4. # shellcheck disable=SC1091
  5. . lib.sh
  6. # For architectures except amd64 and i386, look for packages on ports.ubuntu.com instead.
  7. # This is important if you enable additional architectures so you can install libraries to cross-compile against.
  8. # Look for 'dpkg --add-architecture' in the README for more details.
  9. if grep -i ubuntu /etc/os-release >/dev/null; then
  10. sed 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list > /etc/apt/sources.list.d/ports.list
  11. sed -i 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch=amd64,i386] http:\/\/\1.archive.ubuntu.com\/ubuntu\//g' /etc/apt/sources.list
  12. fi
  13. install_packages \
  14. autoconf \
  15. automake \
  16. binutils \
  17. ca-certificates \
  18. curl \
  19. file \
  20. gcc \
  21. git \
  22. libtool \
  23. m4 \
  24. make
  25. if_centos install_packages \
  26. clang-devel \
  27. gcc-c++ \
  28. glibc-devel \
  29. pkgconfig
  30. if_ubuntu install_packages \
  31. g++ \
  32. libc6-dev \
  33. libclang-dev \
  34. pkg-config