From 160f16fc3adbca19a3a8dd5900a07af398483949 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Thu, 11 Jul 2019 06:59:57 -0600
Subject: [PATCH] Fixed CONDA with MacOS on Travis

---
 .travis.yml                             | 2 +-
 conda/plumed/conda_build_config.yaml    | 2 ++
 conda/py-plumed/conda_build_config.yaml | 2 ++
 conda/run-conda-build.sh                | 8 ++++++++
 4 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 conda/plumed/conda_build_config.yaml

diff --git a/.travis.yml b/.travis.yml
index e2eb2652d..301394295 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -95,7 +95,7 @@ matrix:
   - name: Conda build, MacOS
     os: osx
     if: branch =~ ^test- OR tag IS present OR type IN(pull_request) OR type IN(cron)
-    osx_image: xcode8.3
+    osx_image: xcode9.2
     env: PLUMED_CONDA=yes
 # I don't put any mpi variant with macports since it takes too long to compile
 ## This command can be used to allow failures:
diff --git a/conda/plumed/conda_build_config.yaml b/conda/plumed/conda_build_config.yaml
new file mode 100644
index 000000000..adf47c215
--- /dev/null
+++ b/conda/plumed/conda_build_config.yaml
@@ -0,0 +1,2 @@
+CONDA_BUILD_SYSROOT:
+  - /var/tmp/MacOSX-SDKs/MacOSX10.9.sdk   # [osx]
diff --git a/conda/py-plumed/conda_build_config.yaml b/conda/py-plumed/conda_build_config.yaml
index 5bb1e3339..716d0d3df 100644
--- a/conda/py-plumed/conda_build_config.yaml
+++ b/conda/py-plumed/conda_build_config.yaml
@@ -1,3 +1,5 @@
+CONDA_BUILD_SYSROOT:
+  - /var/tmp/MacOSX-SDKs/MacOSX10.9.sdk   # [osx]
 python:
     - 2.7
     - 3.6
diff --git a/conda/run-conda-build.sh b/conda/run-conda-build.sh
index 2b78e2456..5382bdcdd 100644
--- a/conda/run-conda-build.sh
+++ b/conda/run-conda-build.sh
@@ -9,6 +9,14 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
     csys=Linux
 elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
     csys=MacOSX
+    PREV=$(pwd)
+    cd /var/tmp
+    mkdir MacOSX-SDKs
+    cd MacOSX-SDKs
+    wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.9.sdk.tar.xz
+    tar -xf ./MacOSX10.9.sdk.tar.xz
+    rm MacOSX10.9.sdk.tar.xz
+    cd $PREV
 else
     echo "Unsupported system $TRAVIS_OS_NAME"
     exit 1
-- 
GitLab