on master help sign in
Close #145. Create a separate libyaml package.
commit1e655f0ff220baaf5fafae695973cceeee5185d0 authorAlex Franchuk <afranchuk@lgsinnovations.com> dateWed 10 Oct 2018, 15:49 (8 years ago) parent4c08154
28 files changed+100−50
.gitmodules+1−1 ChangeLog.md+4 README.md+3−3 copy-libyaml.sh−10 libyaml/.gitignore+3 libyaml/ChangeLog.md+6 Makefile → libyaml/Makefile libyaml/README.md+3 libyaml/Setup.hs+2 c/helper.c → libyaml/c/helper.c c/helper.h → libyaml/c/helper.h libyaml/copy-libyaml.sh+10 libyaml/LICENSE → libyaml/libyaml_src/LICENSE libyaml/api.c → libyaml/libyaml_src/api.c libyaml/dumper.c → libyaml/libyaml_src/dumper.c libyaml/emitter.c → libyaml/libyaml_src/emitter.c libyaml/loader.c → libyaml/libyaml_src/loader.c libyaml/parser.c → libyaml/libyaml_src/parser.c libyaml/reader.c → libyaml/libyaml_src/reader.c libyaml/scanner.c → libyaml/libyaml_src/scanner.c libyaml/writer.c → libyaml/libyaml_src/writer.c libyaml/yaml.h → libyaml/libyaml_src/yaml.h libyaml/yaml_private.h → libyaml/libyaml_src/yaml_private.h libyaml/package.yaml+62 src/Text/Libyaml.hs → libyaml/src/Text/Libyaml.hs vendor/libyaml → libyaml/vendor/libyaml package.yaml+2−36 stack.yaml+4
.gitmodules+1−1
@@ -1,3 +1,3 @@
11[submodule "vendor/libyaml"]
2− path = vendor/libyaml
2+ path = libyaml/vendor/libyaml
33 url = https://github.com/snoyberg/libyaml
ChangeLog.md+4
@@ -1,5 +1,9 @@
11# ChangeLog for yaml
22
3+## 0.10.4.1
4+
5+* Split out the `libyaml` and `Text.Libyaml` code into its own package. [#145](https://github.com/snoyberg/yaml/issues/145)
6+
37## 0.10.4.0
48
59* Add `decodeMarked` and `decodeFileMarked` functions to `Text.Libyaml`, and
README.md+3−3
@@ -5,15 +5,15 @@
55
66Provides support for parsing and emitting Yaml documents.
77
8−This package includes the [full libyaml C library version 0.2.1 by Kirill Simonov](https://github.com/yaml/libyaml) in the package so you don't need to worry about any non-Haskell dependencies.
8+This project includes a `libyaml` package, which has the [full libyaml C library version 0.2.1 by Kirill Simonov](https://github.com/yaml/libyaml) in the package so you don't need to worry about any non-Haskell dependencies.
99
10−The package is broken down into two primary modules. `Data.Yaml` provides a high-level interface based around the JSON datatypes provided by the `aeson` package. `Text.Libyaml` provides a lower-level, streaming interface. For most users, `Data.Yaml` is recommended.
10+The project is broken down into two primary packages/modules. `yaml` contains `Data.Yaml`, which provides a high-level interface based around the JSON datatypes provided by the `aeson` package. `libyaml` contains `Text.Libyaml`, which provides a lower-level, streaming interface. For most users, `yaml` and `Data.Yaml` is recommended.
1111
1212### Examples
1313
1414Usage examples can be found in the `Data.Yaml` documentation or in the [examples](https://github.com/snoyberg/yaml/tree/master/examples) directory.
1515
16−### Additional modules
16+### Additional `yaml` modules
1717
1818* `Data.Yaml.Include` supports adding `!include` directives to your YAML files.
1919* `Data.Yaml.Builder` and `Data.Yaml.Parser` allow more fine-grained control of parsing an rendering, as opposed to just using the aeson typeclass and datatype system for parsing and rendering.
copy-libyaml.shdeleted−10
@@ -1,10 +0,0 @@
1−#!/usr/bin/env bash
2−
3−set -ex
4−
5−rm -rf libyaml
6−mkdir -p libyaml
7−cp vendor/libyaml/LICENSE libyaml
8−cp vendor/libyaml/src/*.c libyaml
9−cp vendor/libyaml/src/*.h libyaml
10−cp vendor/libyaml/include/*.h libyaml
libyaml/.gitignorenew file+3
@@ -0,0 +1,3 @@
1+.stack-work/
2+libyaml.cabal
3+*~
libyaml/ChangeLog.mdnew file+6
@@ -0,0 +1,6 @@
1+# Changelog for libyaml
2+
3+## 0.1.0.0
4+
5+* Split `libyaml` into a separate package from `yaml`. This split occurred at
6+ `yaml` version 0.10.4.0.
Makefile → libyaml/Makefilerenamed

The content is the same.

libyaml/README.mdnew file+3
@@ -0,0 +1,3 @@
1+# libyaml
2+
3+This package provides a haskell wrapper over the [libyaml C library version 0.2.1 by Kirill Simonov](https://github.com/yaml/libyaml). It contains the C source so you don't need to worry about any non-Haskell dependencies.
libyaml/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
c/helper.c → libyaml/c/helper.crenamed

The content is the same.

c/helper.h → libyaml/c/helper.hrenamed

The content is the same.

libyaml/copy-libyaml.shnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/env bash
2+
3+set -ex
4+
5+rm -rf libyaml_src
6+mkdir -p libyaml_src
7+cp vendor/libyaml/LICENSE libyaml_src
8+cp vendor/libyaml/src/*.c libyaml_src
9+cp vendor/libyaml/src/*.h libyaml_src
10+cp vendor/libyaml/include/*.h libyaml_src
libyaml/LICENSE → libyaml/libyaml_src/LICENSErenamed

The content is the same.

libyaml/api.c → libyaml/libyaml_src/api.crenamed

The content is the same.

libyaml/dumper.c → libyaml/libyaml_src/dumper.crenamed

The content is the same.

libyaml/emitter.c → libyaml/libyaml_src/emitter.crenamed

The content is the same.

libyaml/loader.c → libyaml/libyaml_src/loader.crenamed

The content is the same.

libyaml/parser.c → libyaml/libyaml_src/parser.crenamed

The content is the same.

libyaml/reader.c → libyaml/libyaml_src/reader.crenamed

The content is the same.

libyaml/scanner.c → libyaml/libyaml_src/scanner.crenamed

The content is the same.

libyaml/writer.c → libyaml/libyaml_src/writer.crenamed

The content is the same.

libyaml/yaml.h → libyaml/libyaml_src/yaml.hrenamed

The content is the same.

libyaml/yaml_private.h → libyaml/libyaml_src/yaml_private.hrenamed

The content is the same.

libyaml/package.yamlnew file+62
@@ -0,0 +1,62 @@
1+name: libyaml
2+version: 0.1.0.0
3+synopsis: Low-level, streaming YAML interface.
4+description: README and API documentation are available at <https://www.stackage.org/package/libyaml>
5+category: Text
6+author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov
7+maintainer: Michael Snoyman <michael@snoyman.com>
8+license: BSD3
9+github: snoyberg/yaml
10+stability: stable
11+
12+extra-source-files:
13+- c/helper.h
14+- libyaml_src/yaml_private.h
15+- libyaml_src/yaml.h
16+- libyaml_src/LICENSE
17+- README.md
18+- ChangeLog.md
19+
20+flags:
21+ system-libyaml:
22+ description: Use the system-wide libyaml instead of the bundled copy
23+ manual: false
24+ default: false
25+ no-unicode:
26+ description: Don't enable unicode output. Instead, unicode characters will be escaped.
27+ manual: false
28+ default: false
29+
30+dependencies:
31+- base >=4.9.1 && <5 # GHC 8.0.2 and later
32+- bytestring >=0.9.1.4
33+- conduit >=1.2.8 && <1.4
34+- resourcet >=0.3 && <1.3
35+
36+library:
37+ c-sources: c/helper.c
38+ ghc-options: -Wall
39+ include-dirs:
40+ - c
41+ source-dirs: src
42+ when:
43+ - condition: flag(no-unicode)
44+ cpp-options: -D__NO_UNICODE__
45+ - condition: ! '!(flag(system-libyaml))'
46+ then:
47+ c-sources:
48+ - libyaml_src/api.c
49+ - libyaml_src/dumper.c
50+ - libyaml_src/emitter.c
51+ - libyaml_src/loader.c
52+ - libyaml_src/parser.c
53+ - libyaml_src/reader.c
54+ - libyaml_src/scanner.c
55+ - libyaml_src/writer.c
56+ include-dirs:
57+ - libyaml_src
58+ else:
59+ extra-libraries: yaml
60+ - condition: os(windows)
61+ cpp-options: -DWINDOWS
62+
src/Text/Libyaml.hs → libyaml/src/Text/Libyaml.hsrenamed

The content is the same.

vendor/libyaml → libyaml/vendor/libyamlrenamed

The content is the same.

package.yaml+2−36
@@ -1,5 +1,5 @@
11name: yaml
2−version: 0.10.4.0
2+version: 0.10.4.1
33synopsis: Support for parsing and rendering YAML documents.
44description: README and API documentation are available at <https://www.stackage.org/package/yaml>
55category: Data
@@ -10,10 +10,6 @@ github: snoyberg/yaml
1010stability: stable
1111
1212extra-source-files:
13−- c/helper.h
14−- libyaml/yaml_private.h
15−- libyaml/yaml.h
16−- libyaml/LICENSE
1713- test/largest-string.yaml
1814- test/json.yaml
1915- test/resources/foo.yaml
@@ -36,14 +32,6 @@ flags:
3632 description: don't build the examples
3733 manual: false
3834 default: true
39− system-libyaml:
40− description: Use the system-wide libyaml instead of the bundled copy
41− manual: false
42− default: false
43− no-unicode:
44− description: Don't enable unicode output. Instead, unicode characters will be escaped.
45− manual: false
46− default: false
4735
4836dependencies:
4937- base >=4.9.1 && <5 # GHC 8.0.2 and later
@@ -62,39 +50,17 @@ dependencies:
6250- filepath
6351- directory
6452- template-haskell
53+- libyaml >=0.1 && <0.2
6554when:
6655 condition: "!impl(ghc >= 8.0)"
6756 dependencies:
6857 - semigroups
6958
7059library:
71− c-sources: c/helper.c
7260 other-extensions:
7361 - LambdaCase
7462 ghc-options: -Wall
75− include-dirs:
76− - c
7763 source-dirs: src
78− when:
79− - condition: flag(no-unicode)
80− cpp-options: -D__NO_UNICODE__
81− - condition: ! '!(flag(system-libyaml))'
82− then:
83− c-sources:
84− - libyaml/api.c
85− - libyaml/dumper.c
86− - libyaml/emitter.c
87− - libyaml/loader.c
88− - libyaml/parser.c
89− - libyaml/reader.c
90− - libyaml/scanner.c
91− - libyaml/writer.c
92− include-dirs:
93− - libyaml
94− else:
95− extra-libraries: yaml
96− - condition: os(windows)
97− cpp-options: -DWINDOWS
9864
9965executables:
10066 json2yaml:
stack.yaml+4
@@ -3,3 +3,7 @@ resolver: lts-11.10
33flags:
44 yaml:
55 no-examples: false
6+
7+packages:
8+ - .
9+ - libyaml