diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..8c79821 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,69 @@ +# This file was automatically generated by conda-smithy. To update a component of this +# file, make changes to conda-forge.yaml and/or recipe/meta.yaml, and run +# "conda-smithy regenerate". + +environment: + + CONDA_INSTALL_LOCN: "C:\\conda" + + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the + # /E:ON and /V:ON options are not enabled in the batch script intepreter + # See: http://stackoverflow.com/a/13751649/163740 + CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd" + + # We set a default Python version for the miniconda that is to be installed. This can be + # overridden in the matrix definition where appropriate. + CONDA_PY: "27" + BINSTAR_TOKEN: + # The BINSTAR_TOKEN secure variable. This is defined canonically in conda-forge.yml. + secure: MP4hZYylDyUWEsrt3u3cod2sbFeRwUziH02mvQOdbjsTO/l1yIxDkP/76rSIjcGC + + matrix: + - TARGET_ARCH: x86 + CONDA_PY: 35 + + - TARGET_ARCH: x64 + CONDA_PY: 35 + + +# We always use a 64-bit machine, but can build x86 distributions +# with the TARGET_ARCH variable. +platform: + - x64 + +install: + # If there is a newer build queued for the same PR, cancel this one. + # The AppVeyor 'rollout builds' option is supposed to serve the same + # purpose but it is problematic because it tends to cancel builds pushed + # directly to master instead of just PR builds (or the converse). + # credits: JuliaLang developers. + - 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." } + + # Cywing's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) + - cmd: rmdir C:\cygwin /s /q + - appveyor DownloadFile "https://raw.githubusercontent.com/pelson/Obvious-CI/master/bootstrap-obvious-ci-and-miniconda.py" + - cmd: python bootstrap-obvious-ci-and-miniconda.py %CONDA_INSTALL_LOCN% %TARGET_ARCH% %CONDA_PY:~0,1% --without-obvci + - cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH% + - cmd: set PYTHONUNBUFFERED=1 + + - cmd: conda config --set show_channel_urls true + - cmd: conda install -c pelson/channel/development --yes --quiet obvious-ci + - cmd: conda config --add channels conda-forge + - cmd: conda info + - cmd: conda install -n root --quiet --yes conda-build anaconda-client jinja2 setuptools + # Workaround for Python 3.4 and x64 bug in latest conda-build. + # FIXME: Remove once there is a release that fixes the upstream issue + # ( https://github.com/conda/conda-build/issues/895 ). + - cmd: if "%TARGET_ARCH%" == "x64" if "%CONDA_PY%" == "34" conda install conda-build=1.20.0 --yes + +# Skip .NET project specific build phase. +build: off + +test_script: + - "%CMD_IN_ENV% conda build recipe --quiet" +deploy_script: + + - 'python ci_support\upload_or_check_non_existence.py .\recipe conda-forge --channel=main' diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 0000000..2ca3966 --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,60 @@ +if "%ARCH%"=="32" ( + set PLATFORM=Win32 +) else ( + set PLATFORM=x64 +) + +mkdir dll\%PLATFORM%\Release +mkdir lib\%PLATFORM%\Release + +set mpc_root=%cd% +cd .. + +for %%d in (mpir, mpfr) do ( + mkdir %%d\dll\%PLATFORM%\Release + mkdir %%d\lib\%PLATFORM%\Release + + REM copy libraries + copy %LIBRARY_BIN%\%%d.dll %%d\dll\%PLATFORM%\Release\%%d.dll + copy %LIBRARY_LIB%\%%d.lib %%d\dll\%PLATFORM%\Release\%%d.lib + copy %LIBRARY_LIB%\%%d_static.lib %%d\lib\%PLATFORM%\Release\%%d.lib +) + +REM copy headers +xcopy %LIBRARY_INC%\*.h mpir\lib\%PLATFORM%\Release\ /E +xcopy %LIBRARY_INC%\*.h mpir\dll\%PLATFORM%\Release\ /E + +cd %mpc_root%\build.vc14 + +msbuild.exe /p:Platform=%PLATFORM% /p:Configuration=Release /p:PostBuildEvent="" mpc_lib\mpc_lib.vcxproj +msbuild.exe /p:Platform=%PLATFORM% /p:Configuration=Release /p:PostBuildEvent="" mpc_dll\mpc_dll.vcxproj + +copy dll\%PLATFORM%\Release\mpc.lib %LIBRARY_LIB%\mpc.lib +copy dll\%PLATFORM%\Release\mpc.dll %LIBRARY_BIN%\mpc.dll +copy dll\%PLATFORM%\Release\mpc.pdb %LIBRARY_BIN%\mpc.pdb + +copy lib\%PLATFORM%\Release\mpc.lib %LIBRARY_LIB%\mpc_static.lib + +cd %mpc_root% +copy src\mpc.h %LIBRARY_INC%\mpc.h + + +REM testing +cd build.vc14 +xcopy dll\%PLATFORM%\Release\mpc.* ..\dll\%PLATFORM%\Release\ /E +mkdir dll_tests\%PLATFORM%\Release + +msbuild.exe /property:SolutionDir=..\..\ /property:OutDir=..\..\%PLATFORM%\Release\ /p:Platform=%PLATFORM% /p:Configuration=Release dll_tests\add_test_lib\add_test_lib.vcxproj +copy %PLATFORM%\Release\test_lib.lib dll_tests\%PLATFORM%\Release\test_lib.lib + +for /d %%d in (dll_tests\*) do ( + for %%f in (%%d\*.vcxproj) do ( + msbuild.exe /property:SolutionDir=..\..\ /property:OutDir=..\..\%PLATFORM%\Release\ /p:Platform=%PLATFORM% /p:Configuration=Release %%f + ) +) + +REM for /r "%PLATFORM%\Release\" %%a in (*.exe) do ( %%~fa ) +xcopy ..\tests\* %PLATFORM%\Release\ /E +cd %PLATFORM%\Release +treal.exe +if errorlevel 1 exit 1 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 56c022b..8d71ec9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,33 +1,48 @@ {% set version = "1.0.3" %} +{% set commit = "58fa4d15fff10f26c490518bc0da2b69732e22ee" %} package: name: mpc version: {{ version }} source: - fn: mpc-{{ version }}.tar.gz - url: http://www.multiprecision.org/mpc/download/mpc-{{ version }}.tar.gz - sha1: b8be66396c726fdc36ebb0f692ed8a8cca3bcc66 + fn: mpc-{{ version }}.tar.gz # [unix] + url: http://www.multiprecision.org/mpc/download/mpc-{{ version }}.tar.gz # [unix] + sha1: b8be66396c726fdc36ebb0f692ed8a8cca3bcc66 # [unix] + fn: {{ commit }}.zip # [win] + url: https://github.com/BrianGladman/mpc/archive/{{ commit }}.zip # [win] + md5: a3ccbbb17770110427a983638824f31b # [win] build: number: 1 - skip: true # [win] + skip: true # [win and not py35] + features: + - vc14 # [win and py35] requirements: build: - - libtool - - m4 - - gmp + - python # [win] + - m4 # [unix] + - libtool # [unix] + - gmp # [unix] + - mpir # [win] - mpfr run: - - gmp + - gmp # [unix] + - mpir # [win] + - vc 14 # [win] - mpfr test: commands: - - test -f ${PREFIX}/lib/libmpc.a # [unix] - - test -f ${PREFIX}/lib/libmpc.dylib # [osx] - - test -f ${PREFIX}/lib/libmpc.so # [linux] + - if not exist %LIBRARY_INC%\\mpc.h exit 1 # [win] + - if not exist %LIBRARY_LIB%\\mpc.lib exit 1 # [win] + - if not exist %LIBRARY_BIN%\\mpc.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\\mpc_static.lib exit 1 # [win] + - test -f ${PREFIX}/include/mpc.h # [unix] + - test -f ${PREFIX}/lib/libmpc.a # [unix] + - test -f ${PREFIX}/lib/libmpc.dylib # [osx] + - test -f ${PREFIX}/lib/libmpc.so # [linux] about: home: http://www.multiprecision.org/