Skip to content
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

Switch to jansson sm Remove YAJL and Jansson #146

Merged
merged 6 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:

setup: |
git submodule update --init --recursive
git clone https://github.com/akheron/jansson
xw19 marked this conversation as resolved.
Show resolved Hide resolved

install: |
apt-get update -q -y
Expand All @@ -48,14 +49,13 @@ jobs:
make;
make install;
cd ..

# Configure and Run libocispec
export JANSSON_CFLAGS=-I/usr/local/include;
export JANSSON_LIBS=/usr/local/lib/libjansson.so
find $(pwd) -name '.git' -exec bash -c 'git config --global --add safe.directory ${0%/.git}' {} \;
./autogen.sh --enable-embedded-yajl
./configure --enable-embedded-yajl CFLAGS='-Wall -Wextra -Werror'
make -j $(nproc) distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-embedded-yajl" AM_DISTCHECK_DVI_TARGET="" TESTS=""
./autogen.sh
./configure CFLAGS='-Wall -Wextra -Werror'
make -j $(nproc) distcheck AM_DISTCHECK_DVI_TARGET="" TESTS=""
# check that the working dir is clean
git describe --broken --dirty --all | grep -qv dirty
make clean
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@
[submodule "image-spec"]
path = image-spec
url = https://github.com/opencontainers/image-spec
[submodule "yajl"]
path = yajl
url = https://github.com/containers/yajl.git
[submodule "jansson"]
path = jansson
url = https://github.com/akheron/jansson
8 changes: 5 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ RUN apt-get update && \

COPY . libocispec

RUN cd libocispec/jansson && autoreconf -fi && ./configure && make && make install
RUN git clone https://github.com/akheron/jansson

RUN cd jansson && autoreconf -fi && ./configure && make && make install
xw19 marked this conversation as resolved.
Show resolved Hide resolved

RUN cd libocispec && \
export JANSSON_CFLAGS=-I/usr/local/include && \
export JANSSON_LIBS=/usr/local/lib/libjansson.so && \
./autogen.sh --enable-embedded-yajl && \
./configure --enable-embedded-yajl CFLAGS='-Wall -Wextra -Werror' && \
./autogen.sh && \
./configure CFLAGS='-Wall -Wextra -Werror' && \
make -j $(nproc) distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-embedded-yajl" AM_DISTCHECK_DVI_TARGET="" TESTS="" && \
make clean
28 changes: 1 addition & 27 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
DIST_SUBDIRS = yajl jansson
SUBDIRS = yajl jansson

AM_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir)/src -I$(top_builddir)/src

if HAVE_EMBEDDED_YAJL
AM_CFLAGS += -I$(top_srcdir)/yajl/src/headers
endif HAVE_EMBEDDED_YAJL

if HAVE_EMBEDDED_JANSSON
AM_CFLAGS += -I$(top_srcdir)/jansson/src
endif HAVE_EMBEDDED_JANSSON

CLEANFILES = $(man_MANS) src/runtime_spec_stamp src/image_spec_stamp src/image_manifest_stamp src/basic-test_stamp

GITIGNOREFILES = build-aux/ gtk-doc.make config.h.in aclocal.m4
Expand Down Expand Up @@ -159,18 +148,6 @@ CLEANFILES += $(HEADER_FILES) $(SOURCE_FILES) $(TMP_H_FILES) $(TMP_C_FILES)

TESTS_LDADD = libocispec.la $(SELINUX_LIBS)

if HAVE_EMBEDDED_YAJL
TESTS_LDADD += yajl/libyajl.la
else
TESTS_LDADD += $(YAJL_LIBS)
endif

if HAVE_EMBEDDED_JANSSON
TESTS_LDADD += jansson/src/.libs/libjansson.la
else
TESTS_LDADD += $(JANSSON_LIBS)
endif

libocispec_a_SOURCES =

libocispec.a: libocispec.la $(BUILT_SOURCES) src/runtime_spec_stamp src/image_spec_stamp src/image_manifest_stamp src/basic-test_stamp
Expand Down Expand Up @@ -266,14 +243,11 @@ EXTRA_DIST = autogen.sh \
runtime-spec \
image-spec \
src/ocispec/json_common.h \
src/ocispec/json_common.c \
src/yajl
src/ocispec/json_common.c

sync:
(cd image-spec; git pull https://github.com/opencontainers/image-spec)
(cd runtime-spec; git pull https://github.com/opencontainers/runtime-spec)
(cd yajl; git pull https://github.com/containers/yajl main)
(cd jansson; git pull https://github.com/akheron/jansson master)


generate: src/runtime_spec_stamp src/image_spec_stamp src/image_manifest_stamp src/basic-test_stamp
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from C, and generate json string from corresponding struct.
The parser is generated directly from the JSON schema in the source repository.

## Installation
Expects [yajl](https://github.com/containers/yajl) and [jansson](https://github.com/akheron/jansson) to be installed and linkable.
Expects [jansson](https://github.com/akheron/jansson) to be installed and linkable.
```sh
$ ./autogen.sh
$ ./configure
Expand Down
4 changes: 0 additions & 4 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

(cd yajl; ./autogen.sh)

git submodule update --init --recursive

test -n "$srcdir" || srcdir=`dirname "$0"`
Expand All @@ -15,8 +13,6 @@ if ! (autoreconf --version >/dev/null 2>&1); then
exit 1
fi

(cd ./jansson; autoreconf -i)

mkdir -p m4

autoreconf --force --install --verbose
Expand Down
29 changes: 1 addition & 28 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.63])
AC_INIT([libocispec], [0.3], [[email protected]])
AC_INIT([libocispec], [0.4], [[email protected]])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
Expand All @@ -12,33 +12,6 @@ AM_INIT_AUTOMAKE([1.11 -Wno-portability foreign tar-ustar no-dist-gzip dist-xz s
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])

AM_EXTRA_RECURSIVE_TARGETS([yajl jansson])
AC_CONFIG_SUBDIRS([yajl jansson])

AC_ARG_ENABLE(embedded-yajl,
AS_HELP_STRING([--enable-embedded-yajl], [Statically link a modified yajl version]),
[
case "${enableval}" in
yes) embedded_yajl=true ;;
no) embedded_yajl=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-embedded-yajl) ;;
esac],[embedded_yajl=false])

AM_CONDITIONAL([HAVE_EMBEDDED_YAJL], [test x"$embedded_yajl" = xtrue])
AM_COND_IF([HAVE_EMBEDDED_YAJL], [], [
AC_SEARCH_LIBS(yajl_tree_get, [yajl], [AC_DEFINE([HAVE_YAJL], 1, [Define if libyajl is available])], [AC_MSG_ERROR([*** libyajl headers not found])])
PKG_CHECK_MODULES([YAJL], [yajl >= 2.0.0])
])

AC_ARG_ENABLE(embedded-jansson,
AS_HELP_STRING([--enable-embedded-jansson], [Statically link a jansson version]),
[
case "${enableval}" in
yes) embedded_jansson=true ;;
no) embedded_jansson=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-embedded-jansson) ;;
esac],[embedded_jansson=false])

AM_CONDITIONAL([HAVE_EMBEDDED_JANSSON], [test x"$embedded_jansson" = xtrue])
AM_COND_IF([HAVE_EMBEDDED_JANSSON], [], [
AC_SEARCH_LIBS(json_object, [jansson], [AC_DEFINE([HAVE_JANSSON], 1, [Define if libjansson is available])], [AC_MSG_ERROR([*** libjansson headers not found])])
Expand Down
1 change: 0 additions & 1 deletion jansson
Submodule jansson deleted from 684e18
1 change: 0 additions & 1 deletion yajl
Submodule yajl deleted from 6bc521
Loading