Skip to content
Browse files

adding libgd

  • Loading branch information...
1 parent dcadd7f commit a4270c1123984cd62a9461ac82e450cd67c17df2 @aaronbatalion committed Oct 8, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −1 bin/compile
View
21 bin/compile
@@ -2,7 +2,12 @@
# usage: bin/compile <build-dir> <cache-dir>
set -eo pipefail
-
+mktmpdir() {
+ dir=$(mktemp -t node-$1-XXXX)
+ rm -rf $dir
+ mkdir -p $dir
+ echo $dir
+}
mkdir -p "$1" "$2"
build=$(cd "$1/" && pwd)
cache=$(cd "$2/" && pwd)
@@ -74,6 +79,20 @@ p=$GOPATH/src/$name
mkdir -p $p
cp -R $build/* $p
+S3_BUCKET="heroku-buildpack-roosize"
+LIBGD_VERSION="2.0.36RC1"
+LIBGD_PACKAGE="http://${S3_BUCKET}.s3.amazonaws.com/gd-${LIBGD_VERSION}.tar.gz"
+VENDORED_LIBGD="$(mktmpdir libgd)"
+mkdir -p $VENDORED_LIBGD && curl $LIBGD_PACKAGE -s -o - | tar xzf - -C $VENDORED_LIBGD
+# setting up paths for building
+PATH="$VENDORED_LIBGD:$PATH"
+INCLUDE_PATH="$VENDORED_LIBGD/include"
+export LD_PRELOAD="$VENDORED_LIBGD/lib/libgd.so"
+export LD_LIBRARY_PATH="$VENDORED_LIBGD/lib"
+export LIBPATH="$VENDORED_LIBGD/lib"
+export CPATH="$INCLUDE_PATH"
+export CPPPATH="$INCLUDE_PATH"
+
unset GIT_DIR # unset git dir or it will mess with goinstall
echo "-----> Running: go get ./..."
cd $p

0 comments on commit a4270c1

Please sign in to comment.
Something went wrong with that request. Please try again.