diff --git a/recipes/yaml/CMakeLists.txt.patch b/recipes/yaml/CMakeLists.txt.patch new file mode 100644 index 0000000000000..a93a346436fa6 --- /dev/null +++ b/recipes/yaml/CMakeLists.txt.patch @@ -0,0 +1,16 @@ +diff --git CMakeLists.txt CMakeLists.txt +index e84c28c..4561133 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -11,6 +11,7 @@ set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VER + file (GLOB SRC src/*.c) + + include_directories (include win32) +-add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC) +-add_library (yaml STATIC ${SRC}) +- ++add_library (yaml SHARED ${SRC}) ++set_target_properties(yaml PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_EXPORT -DHAVE_CONFIG_H") ++add_library (yaml_static STATIC ${SRC}) ++set_target_properties(yaml_static PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_STATIC -DHAVE_CONFIG_H") +\ No newline at end of file diff --git a/recipes/yaml/bld.bat b/recipes/yaml/bld.bat new file mode 100755 index 0000000000000..8c4f923449913 --- /dev/null +++ b/recipes/yaml/bld.bat @@ -0,0 +1,25 @@ +mkdir build +cd build + +cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release .. +if errorlevel 1 exit 1 + +nmake +if errorlevel 1 exit 1 + +:: No tests included in the cmake build. +:: +:: ctest +:: if errorlevel 1 exit 1 + +copy ..\include\yaml.h %LIBRARY_INC% +if errorlevel 1 exit 1 + +copy yaml.dll %LIBRARY_BIN% +if errorlevel 1 exit 1 + +copy yaml.lib %LIBRARY_LIB% +if errorlevel 1 exit 1 + +copy yaml_static.lib %LIBRARY_LIB% +if errorlevel 1 exit 1 diff --git a/recipes/yaml/build.sh b/recipes/yaml/build.sh new file mode 100755 index 0000000000000..dbb384f8c499c --- /dev/null +++ b/recipes/yaml/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +./configure --prefix="${PREFIX}" +make +make check +make install diff --git a/recipes/yaml/meta.yaml b/recipes/yaml/meta.yaml new file mode 100644 index 0000000000000..73952e4958fc3 --- /dev/null +++ b/recipes/yaml/meta.yaml @@ -0,0 +1,54 @@ +{% set version = "0.1.6" %} + +package: + name: yaml + version: {{ version }} + +source: + fn: yaml-{{ version }}.tar.gz + url: http://pyyaml.org/download/libyaml/yaml-{{ version }}.tar.gz + md5: 5fe00cda18ca5daeb43762b80c38e06e + patches: + # Change CMakeLists so that we can build static and shared libraries. + # See this PR ( https://github.com/yaml/libyaml/pull/10 ) for details. + - CMakeLists.txt.patch + +build: + number: 0 + features: + - vc9 # [win and py27] + - vc10 # [win and py34] + - vc14 # [win and py35] + +requirements: + build: + - cmake # [win] + - python # [win] + - pkg-config # [unix] + - libtool # [unix] + +test: + requires: + - python {{ environ['PY_VER'] + '*' }} # [win] + + commands: + # Check headers. + - test -f "${PREFIX}/include/yaml.h" # [unix] + - if not exist %LIBRARY_INC%\\yaml.h exit 1 # [win] + + # Check libraries. + - test -f "${PREFIX}/lib/libyaml.a" # [unix] + - test -f "${PREFIX}/lib/libyaml.dylib" # [osx] + - test -f "${PREFIX}/lib/libyaml.so" # [linux] + - if not exist %LIBRARY_LIB%\\yaml_static.lib exit 1 # [win] + - if not exist %LIBRARY_LIB%\\yaml.lib exit 1 # [win] + - if not exist %LIBRARY_BIN%\\yaml.dll exit 1 # [win] + +about: + home: http://pyyaml.org/wiki/LibYAML' + license: MIT + summary: A C library for parsing and emitting YAML. + +extra: + recipe-maintainers: + - jakirkham