From 87e0bc9e21357cb703224793f957c2d42656e7b9 Mon Sep 17 00:00:00 2001 From: Brian Camacho Date: Sat, 26 Oct 2024 15:02:57 -0400 Subject: [PATCH] add libcurl to deps, builds now --- src/libfetchers/git-utils.cc | 6 ++++-- src/libfetchers/git-utils.hh | 4 ---- src/libfetchers/local.mk | 2 +- src/libfetchers/meson.build | 3 +++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index 8139a05712e..f5983111657 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -328,6 +328,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this std::vector> getSubmodules(const Hash & rev, bool exportIgnore) override; + void smudgeLfs() override; + std::string resolveSubmoduleUrl(const std::string & url) override { git_buf buf = GIT_BUF_INIT; @@ -1103,8 +1105,8 @@ std::vector> GitRepoImpl::getSubmodules } void GitRepoImpl::smudgeLfs() { - const auto metadatas = lfs::parse_lfs_files(this->repo); - const auto [url, host, path] = lfs::get_lfs_endpoint_url(this->repo); + const auto metadatas = lfs::parse_lfs_files(&(*repo)); + const auto [url, host, path] = lfs::get_lfs_endpoint_url(&(*repo)); // TODO: handle public lfs repos without ssh? const auto token = lfs::get_lfs_api_token(host, path); auto urls = lfs::fetch_urls(url, token, metadatas); diff --git a/src/libfetchers/git-utils.hh b/src/libfetchers/git-utils.hh index c75270eb97f..4b7a7e733b8 100644 --- a/src/libfetchers/git-utils.hh +++ b/src/libfetchers/git-utils.hh @@ -74,10 +74,6 @@ struct GitRepo virtual std::string resolveSubmoduleUrl(const std::string & url) = 0; - virtual std::string resolveSubmoduleUrl( - const std::string & url, - const std::string & base) = 0; - virtual bool hasObject(const Hash & oid) = 0; virtual ref getAccessor(const Hash & rev, bool exportIgnore) = 0; diff --git a/src/libfetchers/local.mk b/src/libfetchers/local.mk index e229a099353..a3e6a3d7517 100644 --- a/src/libfetchers/local.mk +++ b/src/libfetchers/local.mk @@ -12,6 +12,6 @@ INCLUDE_libfetchers := -I $(d) libfetchers_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libstore) $(INCLUDE_libfetchers) -libfetchers_LDFLAGS += $(THREAD_LDFLAGS) $(LIBGIT2_LIBS) -larchive +libfetchers_LDFLAGS += $(THREAD_LDFLAGS) $(LIBGIT2_LIBS) $(LIBCURL_LIBS) -larchive libfetchers_LIBS = libutil libstore diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index 5a409ed7d61..2d8df4be978 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -34,6 +34,9 @@ deps_public += nlohmann_json libgit2 = dependency('libgit2') deps_private += libgit2 +curl = dependency('libcurl', 'curl') +deps_private += curl + add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead.