2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-phantomjs.sh
|
|
|
|
|
## Desc: Install PhantomJS
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
|
2021-04-02 18:47:50 +03:00
|
|
|
# Source the helpers for use with the script
|
|
|
|
|
source $HELPER_SCRIPTS/install.sh
|
|
|
|
|
|
2023-11-29 20:25:29 +01:00
|
|
|
# Install required dependencies
|
2024-05-29 13:43:07 +02:00
|
|
|
apt-get install chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
|
2023-11-29 20:25:29 +01:00
|
|
|
|
|
|
|
|
# Define the version and hash of PhantomJS to be installed
|
2023-12-29 12:36:27 +01:00
|
|
|
DIR_NAME=phantomjs-2.1.1-linux-x86_64
|
|
|
|
|
ARCHIVE_HASH="86dd9a4bf4aee45f1a84c9f61cf1947c1d6dce9b9e8d2a907105da7852460d2f"
|
2023-11-29 20:25:29 +01:00
|
|
|
|
|
|
|
|
# Download the archive and verify its integrity using checksum comparison
|
2023-12-29 12:36:27 +01:00
|
|
|
download_url="https://bitbucket.org/ariya/phantomjs/downloads/$DIR_NAME.tar.bz2"
|
2023-11-29 20:25:29 +01:00
|
|
|
archive_path=$(download_with_retry "$download_url")
|
2023-12-29 12:36:27 +01:00
|
|
|
use_checksum_comparison "$archive_path" "$ARCHIVE_HASH"
|
2023-11-29 20:25:29 +01:00
|
|
|
|
|
|
|
|
# Extract the archive and create a symbolic link to the executable
|
|
|
|
|
tar xjf "$archive_path" -C /usr/local/share
|
2023-12-29 12:36:27 +01:00
|
|
|
ln -sf /usr/local/share/$DIR_NAME/bin/phantomjs /usr/local/bin
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2020-12-25 18:03:35 +03:00
|
|
|
invoke_tests "Tools" "Phantomjs"
|