From 3c0988851bb662d1c16cdc6218a44507cda3a917 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Wed, 13 Feb 2019 11:26:39 -0600
Subject: [PATCH] Revert "Remove Travis build scripts for the time being
 (#269)"

This reverts commit 9cf26089ae5b83634e13d21b68696a54f4a378d9.
---
 .travis.yml            | 23 +++++++++++++++++++++++
 travis/build-wheels.sh | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 .travis.yml
 create mode 100755 travis/build-wheels.sh

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..d838cc4f
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+notifications:
+  email: false
+if: tag IS present
+matrix:
+  include:
+  - sudo: required
+    services:
+      - docker
+    env:
+      - DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
+  - sudo: required
+    services:
+      - docker
+    env:
+      - DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
+      - PRE_CMD=linux32
+install:
+  - docker pull $DOCKER_IMAGE
+script:
+  - pwd
+  - ls -la
+  - docker run --rm -v `pwd`:/io -e TWINE_USERNAME -e TWINE_PASSWORD $DOCKER_IMAGE $PRE_CMD /io/travis/build-wheels.sh
+  - ls wheelhouse/
diff --git a/travis/build-wheels.sh b/travis/build-wheels.sh
new file mode 100755
index 00000000..22df67a7
--- /dev/null
+++ b/travis/build-wheels.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -e -x
+
+export PYHOME=/home
+export CL_H=${PYHOME}/cl_h
+export CL_ICDLOAD=${PYHOME}/cl_icdload
+
+cd ${PYHOME}
+yum install -y git cmake
+git clone https://github.com/KhronosGroup/OpenCL-Headers.git ${CL_H}
+git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git ${CL_ICDLOAD}
+ln -s ${CL_H}/CL /usr/include/CL
+make -C ${CL_ICDLOAD}
+cp -r ${CL_ICDLOAD}/build/lib/lib* /usr/lib
+
+# Compile wheels
+for PYBIN in /opt/python/*/bin; do
+    "${PYBIN}/pip" install numpy pybind11 mako
+    "${PYBIN}/pip" wheel /io/ -w wheelhouse/
+done
+
+# Bundle external shared libraries into the wheels
+for whl in wheelhouse/*.whl; do
+    auditwheel repair "$whl" -w /io/wheelhouse/
+done
+
+/opt/python/cp37-cp37m/bin/pip install twine
+for WHEEL in /io/wheelhouse/pyopencl*.whl; do
+    # dev
+    # /opt/python/cp37-cp37m/bin/twine upload \
+    #     --skip-existing \
+    #     --repository-url https://test.pypi.org/legacy/ \
+    #     -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" \
+    #     "${WHEEL}"
+    # prod
+    /opt/python/cp37-cp37m/bin/twine upload \
+        --skip-existing \
+        -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" \
+        "${WHEEL}"
+done
-- 
GitLab