Make WordPress Core

Ticket #40537: 40537.3.patch

File 40537.3.patch, 2.1 KB (added by johnbillion, 5 years ago)
  • .travis.yml

    diff --git a/.travis.yml b/.travis.yml
    index e6c8ec74ba..d499eeb3a6 100644
    a b cache: 
    66    - node_modules
    77    - vendor
    88    - $HOME/.composer/cache
     9    - $HOME/opt/$TRAVIS_PHP_VERSION
     10addons:
     11  apt:
     12    packages:
     13    - bc
    914env:
    1015  global:
    1116    - WP_TRAVISCI=travis:phpunit
    before_install: 
    3540      sed -i "s/yourusernamehere/root/" wp-tests-config.php
    3641      sed -i "s/yourpasswordhere//" wp-tests-config.php
    3742      svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
     43      # Install ImageMagick and Imagick for PHP >= 5.4:
     44      if (( $(echo "$TRAVIS_PHP_VERSION > 5.4" | bc -l) )); then
     45        echo "Installing ImageMagick and Imagick..."
     46        ./tests/phpunit/bin/install-imagick.sh
     47      fi
    3848  fi
    3949- |
    4050  if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
  • new file tests/phpunit/bin/install-imagick.sh

    diff --git a/tests/phpunit/bin/install-imagick.sh b/tests/phpunit/bin/install-imagick.sh
    new file mode 100755
    index 0000000000..1722bafa71
    - +  
     1#!/usr/bin/env bash
     2
     3# ImageMagick version to use
     4IMAGEMAGICK_VERSION='6.9.8-4'
     5
     6install_imagemagick() {
     7        curl -O "https://www.imagemagick.org/download/releases/ImageMagick-$IMAGEMAGICK_VERSION.tar.gz" -f
     8        tar xzf "ImageMagick-$IMAGEMAGICK_VERSION.tar.gz"
     9        rm "ImageMagick-$IMAGEMAGICK_VERSION.tar.gz"
     10        cd "ImageMagick-$IMAGEMAGICK_VERSION"
     11
     12        ./configure --prefix="$HOME/opt/$TRAVIS_PHP_VERSION"
     13        make
     14        make install
     15
     16        cd "$TRAVIS_BUILD_DIR"
     17}
     18
     19# Install ImageMagick if the current version isn't up to date
     20PATH="$HOME/opt/$TRAVIS_PHP_VERSION/bin:$PATH" convert -v | grep "$IMAGEMAGICK_VERSION" || install_imagemagick
     21
     22# Debugging
     23ls "$HOME/opt/$TRAVIS_PHP_VERSION"
     24
     25# Set up environment variables
     26export LD_FLAGS="-L$HOME/opt/$TRAVIS_PHP_VERSION/lib"
     27export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib:$HOME/opt/$TRAVIS_PHP_VERSION/lib"
     28export CPATH="$CPATH:$HOME/opt/$TRAVIS_PHP_VERSION/include"
     29
     30# Install Imagick for PHP
     31echo "$HOME/opt/$TRAVIS_PHP_VERSION" | pecl install imagick