Add log4cxx example to CI (#762)

Co-authored-by: UebelAndre <github@uebelandre.com>
This commit is contained in:
jheaff1 2021-08-18 14:00:17 +01:00 committed by GitHub
parent 3f61e246a3
commit 776f199f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 126 additions and 1 deletions

View File

@ -15,6 +15,7 @@ test_suite(
"//libjpeg_turbo:libjpeg_turbo_build_test", "//libjpeg_turbo:libjpeg_turbo_build_test",
"//libpng:test_libpng", "//libpng:test_libpng",
"//libssh2:libssh2_build_test", "//libssh2:libssh2_build_test",
"//log4cxx:log4cxx_build_test",
"//openssl:openssl_test_suite", "//openssl:openssl_test_suite",
"//pcre:pcre_build_test", "//pcre:pcre_build_test",
"//python:python_tests", "//python:python_tests",
@ -28,7 +29,7 @@ test_suite(
tags = ["manual"], tags = ["manual"],
tests = [ tests = [
"//apr:apr_build_test", "//apr:apr_build_test",
# Copying files to RBE does not preserve timestamps, invoking autotools which is not new enough to build apr_util # Copying files to RBE does not preserve timestamps, invoking autotools which is not new enough to build apr_util and its dependants
# "//apr_util:apr_util_build_test", # "//apr_util:apr_util_build_test",
# Missing a new enough m4 to build # Missing a new enough m4 to build
# "//bison:bison_build_test", # "//bison:bison_build_test",
@ -65,6 +66,7 @@ test_suite(
"//libjpeg_turbo:libjpeg_turbo_build_test", "//libjpeg_turbo:libjpeg_turbo_build_test",
"//libpng:test_libpng", "//libpng:test_libpng",
"//libssh2:libssh2_build_test", "//libssh2:libssh2_build_test",
"//log4cxx:log4cxx_build_test",
"//openssl:openssl_test_suite", "//openssl:openssl_test_suite",
"//pcre:pcre_build_test", "//pcre:pcre_build_test",
"//python:python_tests", "//python:python_tests",

View File

@ -0,0 +1,20 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
exports_files(
[
"BUILD.log4cxx.bazel",
"consoloe.cpp.patch",
"inputstreamreader.cpp.patch",
"simpledateformat.h.patch",
"socketoutputstream.cpp.patch",
],
visibility = ["//visibility:public"],
)
build_test(
name = "log4cxx_build_test",
targets = [
"@log4cxx//:log4cxx",
],
visibility = ["//:__pkg__"],
)

View File

@ -0,0 +1,31 @@
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
)
configure_make(
name = "log4cxx",
configure_options = [
"--disable-shared",
"--with-apr=$EXT_BUILD_DEPS/apr",
"--with-apr-util=$EXT_BUILD_DEPS/apr_util",
],
env = select({
"@platforms//os:macos": {
"AR": "",
"CXXFLAGS": "-Wno-c++11-narrowing",
},
"//conditions:default": {
"CXXFLAGS": "-Wno-narrowing",
},
}),
lib_source = ":all_srcs",
out_static_libs = ["liblog4cxx.a"],
visibility = ["//visibility:public"],
deps = [
"@apr",
"@apr_util",
],
)

View File

@ -0,0 +1,10 @@
--- src/examples/cpp/console.cpp 2008-03-31 23:34:09.000000000 +0100
+++ src/examples/cpp/console.cpp 2008-03-31 23:34:09.000000000 +0100
@@ -22,6 +22,7 @@
#include <log4cxx/logmanager.h>
#include <iostream>
#include <locale.h>
+#include <cstring>
using namespace log4cxx;
using namespace log4cxx::helpers;

View File

@ -0,0 +1,11 @@
--- src/main/cpp/inputstreamreader.cpp 2008-03-31 23:34:09.000000000 +0100
+++ src/main/cpp/inputstreamreader.cpp 2008-03-31 23:34:09.000000000 +0100
@@ -20,6 +20,8 @@
#include <log4cxx/helpers/exception.h>
#include <log4cxx/helpers/pool.h>
#include <log4cxx/helpers/bytebuffer.h>
+#include <cstdio>
+#include <cstring>
using namespace log4cxx;
using namespace log4cxx::helpers;

View File

@ -0,0 +1,25 @@
"""A module defining the third party dependency apr"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def log4cxx_repositories():
maybe(
http_archive,
name = "log4cxx",
build_file = Label("//log4cxx:BUILD.log4cxx.bazel"),
sha256 = "0de0396220a9566a580166e66b39674cb40efd2176f52ad2c65486c99c920c8c",
strip_prefix = "apache-log4cxx-0.10.0",
patches = [
# See https://issues.apache.org/jira/browse/LOGCXX-360
Label("//log4cxx:console.cpp.patch"),
Label("//log4cxx:inputstreamreader.cpp.patch"),
Label("//log4cxx:socketoutputstream.cpp.patch"),
# Required for building on MacOS
Label("//log4cxx:simpledateformat.h.patch"),
],
urls = [
"https://archive.apache.org/dist/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz",
],
)

View File

@ -0,0 +1,14 @@
--- src/main/include/log4cxx/helpers/simpledateformat.h 2008-03-31 23:34:26.000000000 +0100
+++ src/main/include/log4cxx/helpers/simpledateformat.h 2008-03-31 23:34:26.000000000 +0100
@@ -27,10 +27,9 @@
#include <log4cxx/helpers/dateformat.h>
#include <vector>
+#include <locale>
#include <time.h>
-namespace std { class locale; }
-
namespace log4cxx
{
namespace helpers

View File

@ -0,0 +1,10 @@
--- src/main/cpp/socketoutputstream.cpp 2008-03-31 23:34:09.000000000 +0100
+++ src/main/cpp/socketoutputstream.cpp 2008-03-31 23:34:09.000000000 +0100
@@ -19,6 +19,7 @@
#include <log4cxx/helpers/socketoutputstream.h>
#include <log4cxx/helpers/socket.h>
#include <log4cxx/helpers/bytebuffer.h>
+#include <cstring>
using namespace log4cxx;
using namespace log4cxx::helpers;

View File

@ -14,6 +14,7 @@ load("//libgit2:libgit2_repositories.bzl", "libgit2_repositories")
load("//libjpeg_turbo:libjpeg_turbo_repositories.bzl", "libjpeg_turbo_repositories") load("//libjpeg_turbo:libjpeg_turbo_repositories.bzl", "libjpeg_turbo_repositories")
load("//libpng:libpng_repositories.bzl", "libpng_repositories") load("//libpng:libpng_repositories.bzl", "libpng_repositories")
load("//libssh2:libssh2_repositories.bzl", "libssh2_repositories") load("//libssh2:libssh2_repositories.bzl", "libssh2_repositories")
load("//log4cxx:log4cxx_repositories.bzl", "log4cxx_repositories")
load("//openssl:openssl_repositories.bzl", "openssl_repositories") load("//openssl:openssl_repositories.bzl", "openssl_repositories")
load("//pcre:pcre_repositories.bzl", "pcre_repositories") load("//pcre:pcre_repositories.bzl", "pcre_repositories")
load("//python:python_repositories.bzl", "python_repositories") load("//python:python_repositories.bzl", "python_repositories")
@ -36,6 +37,7 @@ def repositories():
libjpeg_turbo_repositories() libjpeg_turbo_repositories()
libpng_repositories() libpng_repositories()
libssh2_repositories() libssh2_repositories()
log4cxx_repositories()
openssl_repositories() openssl_repositories()
pcre_repositories() pcre_repositories()
python_repositories() python_repositories()