Skip to content

Commit

Permalink
WIP: libcurl backend
Browse files Browse the repository at this point in the history
TODO:

 - [ ] mirrorlist
  • Loading branch information
cgwalters committed Jan 19, 2017
1 parent a0e003a commit ffc0f5e
Show file tree
Hide file tree
Showing 20 changed files with 3,202 additions and 138 deletions.
28 changes: 28 additions & 0 deletions .redhat-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,31 @@ env:

tests:
artifacts:

---

inherit: true
required: true

context: curl

env:
CC: 'gcc'

build:
config-opts: >
--prefix=/usr
--libdir=/usr/lib64
--enable-installed-tests
--enable-gtk-doc
--with-curl
packages:
- pkgconfig(libcurl)

tests:
- make check
- gnome-desktop-testing-runner -p 0 ostree

artifacts:
- test-suite.log
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sudo: required
env:
- ci_distro=ubuntu ci_suite=trusty
- ci_docker=debian:jessie-slim ci_distro=debian ci_suite=jessie
- ci_docker=debian:jessie-slim ci_distro=debian ci_suite=jessie ci_configopts="--with-curl"
- ci_docker=debian:stretch-slim ci_distro=debian ci_suite=stretch
- ci_docker=ubuntu:xenial ci_distro=ubuntu ci_suite=xenial

Expand Down
17 changes: 15 additions & 2 deletions Makefile-libostree.am
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,31 @@ libostree_1_la_CFLAGS += $(LIBSYSTEMD_CFLAGS)
libostree_1_la_LIBADD += $(LIBSYSTEMD_LIBS)
endif

if USE_LIBSOUP
if USE_CURL_OR_SOUP
libostree_1_la_SOURCES += \
src/libostree/ostree-fetcher.h \
src/libostree/ostree-fetcher.c \
src/libostree/ostree-fetcher-util.h \
src/libostree/ostree-fetcher-util.c \
src/libostree/ostree-fetcher-uri.c \
src/libostree/ostree-metalink.h \
src/libostree/ostree-metalink.c \
$(NULL)
endif

if USE_CURL
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-curl.c \
src/libostree/ostree-soup-uri.h src/libostree/ostree-soup-uri.c \
src/libostree/ostree-soup-form.c \
$(NULL)
libostree_1_la_CFLAGS += $(OT_DEP_CURL_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_CURL_LIBS)
else
if USE_LIBSOUP
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-soup.c
libostree_1_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_1_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
endif
endif

if USE_LIBMOUNT
libostree_1_la_CFLAGS += $(OT_DEP_LIBMOUNT_CFLAGS)
Expand Down
30 changes: 20 additions & 10 deletions Makefile-ostree.am
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ ostree_SOURCES += \
src/ostree/ot-remote-builtin-summary.c \
$(NULL)

if USE_LIBSOUP
ostree_SOURCES += \
src/ostree/ot-remote-builtin-add-cookie.c \
src/ostree/ot-remote-builtin-delete-cookie.c \
src/ostree/ot-remote-builtin-list-cookies.c \
$(NULL)

if USE_CURL_OR_SOUP
ostree_SOURCES += src/ostree/ot-remote-builtin-add-cookie.c \
src/ostree/ot-remote-builtin-delete-cookie.c \
src/ostree/ot-remote-builtin-list-cookies.c \
src/ostree/ot-remote-cookie-util.h \
src/ostree/ot-remote-cookie-util.c \
$(NULL)
endif

src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile
Expand All @@ -112,15 +114,23 @@ ostree_CFLAGS = $(ostree_bin_shared_cflags)
ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la libostree-kernel-args.la $(LIBSYSTEMD_LIBS)


if USE_LIBSOUP
ostree_SOURCES += src/ostree/ot-builtin-pull.c src/ostree/ot-builtin-trivial-httpd.c
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
if USE_CURL_OR_SOUP
ostree_SOURCES += src/ostree/ot-builtin-pull.c
endif

if USE_LIBSOUP
# Eventually once we stop things from using this, we should support disabling this
ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c
pkglibexec_PROGRAMS += ostree-trivial-httpd
ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)

if !USE_CURL
# This is necessary for the cookie jar bits
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
endif
endif

if USE_LIBARCHIVE
Expand Down
26 changes: 24 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,29 @@ PKG_CHECK_MODULES(OT_DEP_ZLIB, zlib)
dnl We're not actually linking to this, just using the header
PKG_CHECK_MODULES(OT_DEP_E2P, e2p)

dnl Arbitrary version that's in CentOS7.2 now
CURL_DEPENDENCY=7.29.0
AC_ARG_WITH(curl,
AS_HELP_STRING([--with-curl], [Use libcurl @<:@default=no@:>@]),
[], [with_curl=no])
AS_IF([test x$with_curl != xno ], [
PKG_CHECK_MODULES(OT_DEP_CURL, libcurl >= $CURL_DEPENDENCY)
with_curl=yes
AC_DEFINE([HAVE_LIBCURL], 1, [Define if we have libcurl.pc])
dnl Currently using libcurl requires soup for trivial-httpd for tests
with_soup_default=yes
], [with_soup_default=check])
AM_CONDITIONAL(USE_CURL, test x$with_curl != xno)
if test x$with_curl = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES +libcurl"; fi

dnl When bumping the libsoup-2.4 dependency, remember to bump
dnl SOUP_VERSION_MIN_REQUIRED and SOUP_VERSION_MAX_ALLOWED in
dnl Makefile.am
SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
AC_ARG_WITH(soup,
AS_HELP_STRING([--with-soup], [Use libsoup @<:@default=yes@:>@]),
[], [with_soup=check])
AS_IF([test x$with_soup != xno ], [
[], [with_soup=$with_soup_default])
AS_IF([test x$with_soup != xno], [
AC_ARG_ENABLE(libsoup_client_certs,
AS_HELP_STRING([--enable-libsoup-client-certs],
[Require availability of new enough libsoup TLS client cert API (default: auto)]),,
Expand Down Expand Up @@ -120,6 +135,13 @@ if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libsoup"; fi
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
AM_CONDITIONAL(HAVE_LIBSOUP_CLIENT_CERTS, test x$have_libsoup_client_certs = xyes)

AS_IF([test x$with_curl = xyes && test x$with_soup = xno], [
AC_MSG_ERROR([Curl enabled, but libsoup is not; libsoup is needed for tests])
])
AM_CONDITIONAL(USE_CURL_OR_SOUP, test x$with_curl != xno || test x$with_soup != xno)
AS_IF([test x$with_curl != xno || test x$with_soup != xno],
[AC_DEFINE([HAVE_LIBCURL_OR_LIBSOUP], 1, [Define if we have soup or curl])])

m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
Expand Down
Loading

0 comments on commit ffc0f5e

Please sign in to comment.