commit: 479b4a9313cd551db129a7a5d399d4a2975f1fb9
parent 4e7ee1fdabed14f5f418e9ee92dcaa62571d9653
Author: Michael Forney <mforney@mforney.org>
Date: Fri, 1 Nov 2019 18:51:40 -0700
Add libcbor 0.5.0
Diffstat:
5 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -93,6 +93,9 @@
path = pkg/libass/src
url = https://github.com/libass/libass
ignore = all
+[submodule "pkg/libcbor/src"]
+ path = pkg/libcbor/src
+ url = https://github.com/PJK/libcbor.git
[submodule "pkg/libdrm/src"]
path = pkg/libdrm/src
url = https://anongit.freedesktop.org/git/mesa/drm.git
diff --git a/pkg/gen.lua b/pkg/gen.lua
@@ -33,6 +33,7 @@ subgen 'jbig2dec'
subgen 'kbd'
subgen 'less'
subgen 'libass'
+subgen 'libcbor'
subgen 'libdrm'
subgen 'libevdev'
subgen 'libevent'
diff --git a/pkg/libcbor/gen.lua b/pkg/libcbor/gen.lua
@@ -0,0 +1,67 @@
+cflags{
+ '-Wall', '-pedantic',
+ '-D HAVE_ENDIAN_H',
+ '-I $outdir/include',
+}
+
+build('sed', '$outdir/include/cbor/configuration.h', '$srcdir/src/cbor/configuration.h.in', {
+ expr={
+ [[-e 's,$${CBOR_VERSION_MAJOR},0,']],
+ [[-e 's,$${CBOR_VERSION_MINOR},5,']],
+ [[-e 's,$${CBOR_VERSION_PATCH},0,']],
+ [[-e 's,$${CBOR_BUFFER_GROWTH},2,']],
+ [[-e 's,$${CBOR_RESTRICT_SPECIFIER},restrict,']],
+ [[-e 's,$${CBOR_INLINE_SPECIFIER},inline,']],
+ '-e /CBOR_CUSTOM_ALLOC/d',
+ '-e /CBOR_PRETTY_PRINTER/d',
+ },
+})
+
+pkg.hdrs = {
+ copy('$outdir/include', '$srcdir/src', {
+ 'cbor.h',
+ 'cbor/arrays.h',
+ 'cbor/bytestrings.h',
+ 'cbor/callbacks.h',
+ 'cbor/common.h',
+ 'cbor/data.h',
+ 'cbor/encoding.h',
+ 'cbor/floats_ctrls.h',
+ 'cbor/ints.h',
+ 'cbor/maps.h',
+ 'cbor/serialization.h',
+ 'cbor/streaming.h',
+ 'cbor/strings.h',
+ 'cbor/tags.h',
+ }),
+ '$outdir/include/cbor/configuration.h',
+}
+pkg.deps = {'$dir/headers'}
+
+lib('libcbor.a', [[
+ src/cbor.c
+ src/cbor/(
+ streaming.c
+ internal/(
+ encoders.c
+ builder_callbacks.c
+ loaders.c
+ memory_utils.c
+ stack.c
+ unicode.c
+ )
+ encoding.c
+ serialization.c
+ arrays.c
+ common.c
+ floats_ctrls.c
+ bytestrings.c
+ callbacks.c
+ strings.c
+ maps.c
+ tags.c
+ ints.c
+ )
+]])
+
+fetch 'git'
diff --git a/pkg/libcbor/src b/pkg/libcbor/src
@@ -0,0 +1 @@
+Subproject commit 6ffbfc41559a6ef5a3a18a0ffe005d19eb7fd528
diff --git a/pkg/libcbor/ver b/pkg/libcbor/ver
@@ -0,0 +1 @@
+0.5.0 r0