brew custom perls for travis
Graham Knop [Thu, 29 Aug 2013 16:55:49 +0000 (12:55 -0400)]
.travis.yml
maint/travis-perlbrew [new file with mode: 0644]

index 3e258b1..c3ee64b 100644 (file)
@@ -1,13 +1,9 @@
 language: perl
 perl:
-  - "5.19"
-  - "5.18"
-  - "5.16"
-  - "5.14"
-  - "5.12"
-  - "5.10"
-  - "5.8"
+  - "5.8.3"
+  - "5.8.3_thr"
 before_install:
+  - source maint/travis-perlbrew
   - perlbrew install-cpanm -f
   - perl -V
 install:
diff --git a/maint/travis-perlbrew b/maint/travis-perlbrew
new file mode 100644 (file)
index 0000000..f3a4a6c
--- /dev/null
@@ -0,0 +1,13 @@
+BREWVER=${TRAVIS_PERL_VERSION/_*/}
+BREWOPTS=
+[[ "${TRAVIS_PERL_VERSION}_" =~ '_thr_' ]] && BREWOPTS="$BREWOPTS -Duseithreads"
+
+if ! perlbrew use | grep -q "Currently using $TRAVIS_PERL_VERSION"; then
+  perlbrew install --as $TRAVIS_PERL_VERSION --notest --noman --verbose $BREWOPTS -j 2 $BREWVER
+  perlbrew use $TRAVIS_PERL_VERSION
+  if ! perlbrew use | grep -q "Currently using $TRAVIS_PERL_VERSION"; then
+    echo "Unable to switch to $TRAVIS_PERL_VERSION - compilation failed...?" 1>&2
+    exit 1
+  fi
+fi
+perlbrew install-cpanm -f