Skip to content

Commit

Permalink
log4cplus 2.1.2
Browse files Browse the repository at this point in the history
autobump: add log4cplus

Signed-off-by: Rui Chen <[email protected]>

log4cplus: update build and test

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Oct 25, 2024
1 parent c0bb11c commit d9be6bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,7 @@ lndir
localai
localstack
locust
log4cplus
log4cxx
logdy
logrotate
Expand Down
18 changes: 10 additions & 8 deletions Formula/l/log4cplus.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Log4cplus < Formula
desc "Logging Framework for C++"
homepage "https://sourceforge.net/p/log4cplus/wiki/Home/"
url "https://downloads.sourceforge.net/project/log4cplus/log4cplus-stable/2.1.1/log4cplus-2.1.1.tar.xz"
sha256 "a1d8e67a207f90a9dd4f82b28a1f3ac6dead5a80c2bed071277a9e865698a82b"
url "https://downloads.sourceforge.net/project/log4cplus/log4cplus-stable/2.1.2/log4cplus-2.1.2.tar.xz"
sha256 "fbdabb4ef734fe1cc62169b23f0b480cc39127ac7b09b810a9c1229490d67e9e"
license all_of: ["Apache-2.0", "BSD-2-Clause"]

livecheck do
Expand All @@ -21,16 +21,17 @@ class Log4cplus < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "fcece8684fc7a7537ede4ed961dbf7642d6fafe260210ece0ad155bf0621ee1b"
end

depends_on "pkg-config" => [:build, :test]

def install
ENV.cxx11
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "./configure", *std_configure_args.reject { |s| s["--disable-debug"] }
system "make", "install"
end

test do
# https://github.com/log4cplus/log4cplus/blob/65e4c3/docs/examples.md
(testpath/"test.cpp").write <<~EOS
(testpath/"test.cpp").write <<~CPP
#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>
#include <log4cplus/configurator.h>
Expand All @@ -47,9 +48,10 @@ def install
LOG4CPLUS_WARN(logger, LOG4CPLUS_TEXT("Hello, World!"));
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "-I#{include}", "-L#{lib}",
"test.cpp", "-o", "test", "-llog4cplus"
CPP

pkg_config_flags = shell_output("pkg-config --cflags --libs log4cplus").chomp.split
system ENV.cxx, "-std=c++11", "-o", "test", "test.cpp", *pkg_config_flags
assert_match "Hello, World!", shell_output("./test")
end
end

0 comments on commit d9be6bf

Please sign in to comment.