diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..48a3d23aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +support/build/*/builds \ No newline at end of file diff --git a/support/build/libmemcached/build b/support/build/libmemcached/build new file mode 100755 index 000000000..926303c59 --- /dev/null +++ b/support/build/libmemcached/build @@ -0,0 +1,40 @@ +#!/bin/bash + +# fail hard +set -o pipefail +# fail harder +set -eux + +# +#./configure --prefix=/tmp/foo1 +#https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz +# + +PREFIX=/app/.heroku/php +mkdir -p $PREFIX + +curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz +tar xzf cyrus-sasl-2.1.26.tar.gz +pushd cyrus-sasl-2.1.26 +./configure --prefix=$PREFIX +make +make install +popd + +# Take care of vendoring +dep_version=${VERSION:-1.0.16} +dep_dirname=libmemcached-${dep_version} +dep_archive_name=${dep_dirname}.tar.gz + +curl -LO https://launchpad.net/libmemcached/1.0/${dep_version}/+download/${dep_archive_name} + +tar xzf $dep_archive_name +pushd $dep_dirname +CPPFLAGS=-I$PREFIX/include LDFLAGS=-L$PREFIX/lib ./configure --prefix=$PREFIX --without-memcached +make +make install +popd + +mv $PREFIX/* $2/ + +echo "Done packaging $dep_dirname" diff --git a/support/build/php/build b/support/build/php/build new file mode 100755 index 000000000..cc427857d --- /dev/null +++ b/support/build/php/build @@ -0,0 +1,87 @@ +#!/bin/bash + +# fail hard +set -o pipefail +# fail harder +set -eux + +PREFIX=/app/.heroku/php +mkdir -p $PREFIX/bin +export PATH=$PREFIX/bin:$PATH + +curl -L https://dl.dropboxusercontent.com/u/26887866/heroku/zlib-1.2.8.tgz | tar xz -C $PREFIX + +# Take care of vendoring +dep_version=${VERSION:-5.5.10} +dep_dirname=php-$dep_version +dep_archive_name=$dep_dirname.tar.bz2 + +# Download PHP if necessary. +if [ ! -f $dep_archive_name ] +then + curl -Lo $dep_archive_name http://us1.php.net/get/$dep_archive_name/from/www.php.net/mirror +fi + + + +# fetch mcrypt +if [ -z MCRYPT_URL ] +then + MCRYPT_URL="https://heroku-buildpack-php.s3.amazonaws.com/mcrypt-2.5.8-2.tar.gz" +fi +#curl --silent --max-time 60 --location "$MCRYPT_URL" | tar xz + +# Clean and extract PHP. +rm -rf $dep_dirname +tar jxf $dep_archive_name + +# Compile PHP +pushd $dep_dirname +./configure \ + --prefix=$PREFIX \ + --with-config-file-path=/app/.heroku/php/etc \ + --with-config-file-scan-dir=/app/.heroku/php/etc/php/conf.d \ + --with-openssl \ + --enable-fpm \ + --enable-soap=shared \ + --enable-sockets \ + --enable-zip \ + --with-zlib=$PREFIX \ + --with-pgsql \ + --with-pdo-pgsql +make -s +make install -s +popd + +curl -L https://dl.dropboxusercontent.com/u/26887866/heroku/libmemcached-1.0.16.tgz | tar xz -C $PREFIX +curl -L https://github.com/php-memcached-dev/php-memcached/archive/2.2.0b1.tar.gz | tar xz +pushd php-memcached-2.2.0b1 +phpize +./configure \ + --enable-memcached \ + --with-libmemcached-dir=$PREFIX +make -s +make install -s +popd + +# Copy in MySQL client library. +# mkdir -p $PREFIX/lib/phpls +# cp /usr/lib/libmysqlclient.so.16 $PREFIX/lib/php + +# $PATH manipulation Necessary for 'pecl install', which relies on +# PHP binaries relative to $PATH. + +$PREFIX/bin/pecl channel-update pecl.php.net + +# bundle composer +curl -sS https://getcomposer.org/installer | php -- --install-dir=$PREFIX/bin +mv $PREFIX/bin/composer.phar $PREFIX/bin/composer + +# Use defaults for apc build prompts. +# yes '' | $PREFIX/bin/pecl install apc + +# echo $dep_version > $PREFIX/.heroku/dep_version + +mv $PREFIX/* $2/ + +echo "Done building $dep_dirname" \ No newline at end of file diff --git a/support/build/zlib/build b/support/build/zlib/build new file mode 100755 index 000000000..03ec1136e --- /dev/null +++ b/support/build/zlib/build @@ -0,0 +1,27 @@ +#!/bin/bash + +# fail hard +set -o pipefail +# fail harder +set -eux + +PREFIX=/app/.heroku/php +mkdir -p $PREFIX + +# Take care of vendoring +dep_version=${VERSION:-1.2.8} +dep_dirname=zlib-${dep_version} +dep_archive_name=${dep_dirname}.tar.gz + +curl -Lo $dep_archive_name http://zlib.net/${dep_archive_name} + +tar xzf $dep_archive_name +pushd $dep_dirname +./configure --prefix=$PREFIX +make +make install +popd + +mv $PREFIX/* $2/ + +echo "Done packaging $dep_dirname"