Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6713 from sgallagher/llhttp
- Loading branch information
Showing
23 changed files
with
12,212 additions
and
2,579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
ARG BASE=fedora:rawhide | ||
|
||
FROM ${BASE} AS stream | ||
RUN dnf -y distro-sync | ||
|
||
FROM stream AS yum | ||
RUN yum install -y \ | ||
which \ | ||
bzip2 \ | ||
git \ | ||
libarchive \ | ||
cmake \ | ||
gcc \ | ||
make \ | ||
openssl-devel \ | ||
openssh-server \ | ||
git-daemon \ | ||
java-1.8.0-openjdk-headless \ | ||
sudo \ | ||
python3 \ | ||
valgrind \ | ||
krb5-workstation \ | ||
krb5-libs \ | ||
krb5-devel \ | ||
pcre2-devel \ | ||
zlib-devel \ | ||
ninja-build \ | ||
llhttp-devel | ||
|
||
FROM yum AS libssh2 | ||
RUN cd /tmp && \ | ||
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \ | ||
cd libssh2-1.11.0 && \ | ||
./configure && \ | ||
make && \ | ||
make install && \ | ||
cd .. && \ | ||
rm -rf libssh2-1.11.0 | ||
|
||
FROM libssh2 AS adduser | ||
ARG UID="" | ||
ARG GID="" | ||
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \ | ||
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \ | ||
groupadd ${GROUP_ARG} libgit2 && \ | ||
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2 | ||
|
||
FROM adduser AS configure | ||
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig | ||
RUN mkdir /var/run/sshd | ||
RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local && \ | ||
ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# - Try to find llhttp | ||
# | ||
# Defines the following variables: | ||
# | ||
# LLHTTP_FOUND - system has llhttp | ||
# LLHTTP_INCLUDE_DIR - the llhttp include directory | ||
# LLHTTP_LIBRARIES - Link these to use llhttp | ||
# LLHTTP_VERSION_MAJOR - major version | ||
# LLHTTP_VERSION_MINOR - minor version | ||
# LLHTTP_VERSION_STRING - the version of llhttp found | ||
|
||
# Find the header and library | ||
find_path(LLHTTP_INCLUDE_DIR NAMES llhttp.h) | ||
find_library(LLHTTP_LIBRARY NAMES llhttp libllhttp) | ||
|
||
# Found the header, read version | ||
if(LLHTTP_INCLUDE_DIR AND EXISTS "${LLHTTP_INCLUDE_DIR}/llhttp.h") | ||
file(READ "${LLHTTP_INCLUDE_DIR}/llhttp.h" LLHTTP_H) | ||
if(LLHTTP_H) | ||
string(REGEX REPLACE ".*#define[\t ]+LLHTTP_VERSION_MAJOR[\t ]+([0-9]+).*" "\\1" LLHTTP_VERSION_MAJOR "${LLHTTP_H}") | ||
string(REGEX REPLACE ".*#define[\t ]+LLHTTP_VERSION_MINOR[\t ]+([0-9]+).*" "\\1" LLHTTP_VERSION_MINOR "${LLHTTP_H}") | ||
set(LLHTTP_VERSION_STRING "${LLHTTP_VERSION_MAJOR}.${LLHTTP_VERSION_MINOR}") | ||
endif() | ||
unset(LLHTTP_H) | ||
endif() | ||
|
||
# Handle the QUIETLY and REQUIRED arguments and set LLHTTP_FOUND | ||
# to TRUE if all listed variables are TRUE | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LLHTTP REQUIRED_VARS LLHTTP_INCLUDE_DIR LLHTTP_LIBRARY) | ||
|
||
# Hide advanced variables | ||
mark_as_advanced(LLHTTP_INCLUDE_DIR LLHTTP_LIBRARY) | ||
|
||
# Set standard variables | ||
if(LLHTTP_FOUND) | ||
set(LLHTTP_LIBRARIES ${LLHTTP_LIBRARY}) | ||
set(LLHTTP_INCLUDE_DIRS ${LLHTTP_INCLUDE_DIR}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
# Optional external dependency: http-parser | ||
if(USE_HTTP_PARSER STREQUAL "system") | ||
if(USE_HTTP_PARSER STREQUAL "http-parser") | ||
find_package(HTTPParser) | ||
|
||
if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) | ||
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) | ||
list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) | ||
list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") | ||
add_feature_info(http-parser ON "http-parser support (system)") | ||
set(GIT_HTTPPARSER_HTTPPARSER 1) | ||
add_feature_info(http-parser ON "using http-parser (system)") | ||
else() | ||
message(FATAL_ERROR "http-parser support was requested but not found") | ||
endif() | ||
elseif(USE_HTTP_PARSER STREQUAL "llhttp") | ||
find_package(LLHTTP) | ||
|
||
if(LLHTTP_FOUND AND LLHTTP_VERSION_MAJOR EQUAL 9) | ||
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${LLHTTP_INCLUDE_DIRS}) | ||
list(APPEND LIBGIT2_SYSTEM_LIBS ${LLHTTP_LIBRARIES}) | ||
list(APPEND LIBGIT2_PC_LIBS "-lllhttp") | ||
set(GIT_HTTPPARSER_LLHTTP 1) | ||
add_feature_info(http-parser ON "using llhttp (system)") | ||
else() | ||
message(FATAL_ERROR "llhttp support was requested but not found") | ||
endif() | ||
else() | ||
message(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.") | ||
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/http-parser" "${PROJECT_BINARY_DIR}/deps/http-parser") | ||
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/http-parser") | ||
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:http-parser>") | ||
add_feature_info(http-parser ON "http-parser support (bundled)") | ||
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/llhttp" "${PROJECT_BINARY_DIR}/deps/llhttp") | ||
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/llhttp") | ||
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:llhttp>") | ||
set(GIT_HTTPPARSER_BUILTIN 1) | ||
add_feature_info(http-parser ON "using bundled parser") | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.