-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yaml #397
Merged
+101
−0
Merged
Add yaml #397
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git CMakeLists.txt CMakeLists.txt | ||
index e84c28c..eab70b2 100644 | ||
--- CMakeLists.txt | ||
+++ CMakeLists.txt | ||
@@ -3,6 +3,13 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
project (yaml C) | ||
|
||
+# Allow the developer to select if Dynamic or Static libraries are built | ||
+OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) | ||
+SET (LIB_TYPE STATIC) | ||
+IF (BUILD_SHARED_LIBS) | ||
+ SET (LIB_TYPE SHARED) | ||
+ENDIF (BUILD_SHARED_LIBS) | ||
+ | ||
set (YAML_VERSION_MAJOR 0) | ||
set (YAML_VERSION_MINOR 1) | ||
set (YAML_VERSION_PATCH 6) | ||
@@ -12,5 +19,4 @@ 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 ${LIB_TYPE} ${SRC}) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
mkdir build | ||
if errorlevel 1 exit 1 | ||
|
||
cd build | ||
if errorlevel 1 exit 1 | ||
|
||
|
||
for %%X in ( | ||
"on" | ||
"off" | ||
) do ( | ||
cmake -G ^ | ||
"NMake Makefiles" ^ | ||
-DCMAKE_BUILD_TYPE=Release ^ | ||
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ | ||
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ | ||
-DBUILD_SHARED_LIBS=%%X ^ | ||
.. | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
./configure \ | ||
--prefix="${PREFIX}" | ||
make | ||
make check | ||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{% 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This patch ( yaml/libyaml#10 ) let's us build DLLs and LIBs. It was the simplest thing I could come up with. Though improvements are certainly welcome. |
||
|
||
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.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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going by the CMake file by @gillins on the jpeg recipe, I think you can achieve the same effect by adding two libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, adding 2 different ones is the right approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, you should prefer it, as it gives you both a static lib and a dynamic lib. Might need to change the name of the static lib, though, so they don't overlap.
maybe
yaml_s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with doing this is this breaks with existing
yaml
package indefaults
. If you could share what you guys are doing to build it there, I would be happy to update this even if it is shared verbally, but I don't think it is a good idea to rename this library and break with thedefaults
yaml
package.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like someone created or copied a custom VS solution and projects. This is "land before time" stuff - no history in our repo on it. File modification times between 2010 and 2012.
Suffice to say, the DLL is the one that everyone uses. It should have the default name. The static one can safely have some other name, IMHO (and the defaults channel package does not include it, anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there be a way to have both libraries have the same name and only do one build? I initially tried to find something like this, but was unable to get anything like that to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Windows has 2 different things both with .lib, and you need both of
them. One filename has to change to have both in one package.
On Thu, Apr 21, 2016, 20:04 jakirkham notifications@github.com wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to make sure the import lib for the DLL doesn't get overwritten by your static lib so probably safest to have different names. I was also unable to work out how to do one build for static/shared with cmake for jpeg. This might be because on Linux (and some other OS's) static and shared builds need different compile flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit ( 9295684 ) from @msarahan should resolve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be necromancing an ancient topic, but this static lib name change did indeed break a number of things (as some of the downstream consumers of libyaml are very stable and not often updated, it's taken awhile to discover the issues). We've changed the default back, but made it configurable from cmake (see yaml/libyaml#136) so anyone that might need the new name can at least get it back if they want.