Skip to content

Commit

Permalink
Attempting appveyor support. Based on work by @ocefpaf, see Unidata#347
Browse files Browse the repository at this point in the history
… for more information.
  • Loading branch information
WardF committed Apr 24, 2018
1 parent d180758 commit f216710
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
38 changes: 38 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
environment:
matrix:
- TARGET_ARCH: x64
CONDA_PY: 27
CONDA_INSTALL_LOCN: C:\\Miniconda-x64

- TARGET_ARCH: x64
CONDA_PY: 36
CONDA_INSTALL_LOCN: C:\\Miniconda35-x64

platform:
- x64

install:
# If there is a newer build queued for the same PR, cancel this one.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }

# Add path, activate conda, update conda, and add conda-forge channel for the dependencies.
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
- cmd: conda update conda
- cmd: conda config --add channels conda-forge --force
- cmd: set PYTHONUNBUFFERED=1

# Fix conda bug when building vc 9.
- cmd: conda install conda-build vs2008_express_vc_python_patch
- cmd: call setup_x64
# Debug info.
- cmd: conda info --all
- cmd: conda list

# Skip .NET project specific build phase.
build: off

test_script:
22 changes: 22 additions & 0 deletions conda.recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set PATH=%PATH%;C:\msys64\usr\bin

mkdir %SRC_DIR%\build
cd %SRC_DIR%\build

cmake -G "Visual Studio 15 Win64" ^
-D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-D BUILD_SHARED_LIBS=ON ^
-D ENABLE_TESTS=ON ^
-D ENABLE_HDF4=ON ^
-D CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-D ZLIB_LIBRARY=%LIBRARY_LIB%\zlib.lib ^
-D ZLIB_INCLUDE_DIR=%LIBRARY_INC% ^
-D CMAKE_BUILD_TYPE=Release ^
%SRC_DIR%
if errorlevel 1 exit 1

cmake --build . --config Release || exit 1

ctest || exit 1

nmake install || exit 1
33 changes: 33 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

{% set version = "dev" %}

package:
name: netcdf-c
version: {{ version }}

source:
path: ../

build:
features:
- vc9 # [win and py27]
- vc14 # [win and py>=35]

requirements:
build:
- python # Here only to activate the `vc`s.
- msinttypes
- curl
- zlib 1.2.*
- hdf4
- hdf5 1.8.20
- vc 15 # [win and py>=35]
run:
- curl
- zlib 1.2.*
- hdf4
- hdf5 1.8.20
- vc 15 # [win and py>=35]

test:
commands:

0 comments on commit f216710

Please sign in to comment.