Skip to content

log4cplus: add v2.1.1, v1.2.2, drop old versions #21904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions recipes/log4cplus/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.1.1":
url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_1/log4cplus-2.1.1.tar.bz2"
sha256: "6597de782775e4e0fba8fdcad938c3709fd839a8084c4b6edfae3cc5046e2688"
"2.1.0":
url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_0/log4cplus-2.1.0.tar.bz2"
sha256: "a04945aca5fbc0487503c852befb9cdefbc3ae3fe614b08a905333f6df754387"
Expand All @@ -8,38 +11,28 @@ sources:
"2.0.7":
url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_7/log4cplus-2.0.7.tar.bz2"
sha256: "8fadbafee2ba4e558a0f78842613c9fb239c775d83f23340d091084c0e1b12ab"
"2.0.6":
url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_6/log4cplus-2.0.6.tar.bz2"
sha256: "1a963afd0f883d62de946b18927d238051fd47936e415eabeffe2b1397f16eca"
"2.0.5":
url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_5/log4cplus-2.0.5.tar.bz2"
sha256: "b38dbfc68ef6d771e4de7de0be3544bc51bd3f7d5b75c5f6500d10e23203eb15"
"2.0.4":
url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_4/log4cplus-2.0.4.tar.bz2"
sha256: "0c8a7b4cabff07032385f0c6d1a078d2a79c69b1c43b06991ca774fb85880252"

# v1 is required for the openvdb recipe
"1.2.2":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding a comment here at to the reason this is kept will avoid future maintenance to remove it again?

url: "https://github.com/log4cplus/log4cplus/releases/download/REL_1_2_2/log4cplus-1.2.2.tar.bz2"
sha256: "853efd919f9ca76c518c0944e6b0ced1174523a86b6db046ed4f23fe695167bd"
patches:
"2.1.0":
"2.1.1":
- patch_file: "patches/2.0.6-0001-fix-cmake.patch"
patch_description: "disable fPIC, move cmake_minimum_version to front"
patch_type: "conan"
"2.0.8":
"2.1.0":
- patch_file: "patches/2.0.6-0001-fix-cmake.patch"
patch_description: "disable fPIC, move cmake_minimum_version to front"
patch_type: "conan"
"2.0.7":
"2.0.8":
- patch_file: "patches/2.0.6-0001-fix-cmake.patch"
patch_description: "disable fPIC, move cmake_minimum_version to front"
patch_type: "conan"
"2.0.6":
"2.0.7":
- patch_file: "patches/2.0.6-0001-fix-cmake.patch"
patch_description: "disable fPIC, move cmake_minimum_version to front"
patch_type: "conan"
"2.0.5":
- patch_file: "patches/2.0.4-0001-fix-cmake.patch"
patch_description: "disable fPIC, move cmake_minimum_version to front"
patch_type: "conan"
"2.0.4":
- patch_file: "patches/2.0.4-0001-fix-cmake.patch"
patch_description: "disable fPIC, move cmake_minimum_version to front"
"1.2.2":
- patch_file: "patches/1.2.2-0001-fix-cmake.patch"
patch_description: "move cmake_minimum_version to front"
patch_type: "conan"
5 changes: 4 additions & 1 deletion recipes/log4cplus/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, collect_libs
from conan.tools.build import check_min_cppstd
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.scm import Version
import os
Expand Down Expand Up @@ -62,6 +63,8 @@ def requirements(self):
def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, 11)
if Version(self.version) < 2 and valid_min_cppstd(self, 17):
raise ConanInvalidConfiguration("log4cplus < 2.0.0 does not support C++17")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down
12 changes: 12 additions & 0 deletions recipes/log4cplus/all/patches/1.2.2-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -11,8 +11,8 @@
# Remove when CMake >= 2.8.4 is required
set (CMAKE_LEGACY_CYGWIN_WIN32 0)

+cmake_minimum_required (VERSION 3.15)
project (log4cplus)
-cmake_minimum_required (VERSION 2.8.12)

enable_language (CXX)
include(GNUInstallDirs)
21 changes: 0 additions & 21 deletions recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch

This file was deleted.

6 changes: 5 additions & 1 deletion recipes/log4cplus/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ project(test_package LANGUAGES CXX)

find_package(log4cplus REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
if(log4cplus_VERSION VERSION_GREATER_EQUAL 2)
add_executable(${PROJECT_NAME} test_package.cpp)
else()
add_executable(${PROJECT_NAME} test_package_v1.cpp)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE log4cplus::log4cplus)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
16 changes: 16 additions & 0 deletions recipes/log4cplus/all/test_package/test_package_v1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>
#include <log4cplus/configurator.h>

int main()
{
log4cplus::initialize();

log4cplus::BasicConfigurator config;
config.configure();

log4cplus::Logger logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("main"));
LOG4CPLUS_WARN(logger, LOG4CPLUS_TEXT("Hello, World!"));

return 0;
}
8 changes: 3 additions & 5 deletions recipes/log4cplus/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
versions:
"2.1.1":
folder: all
"2.1.0":
folder: all
"2.0.8":
folder: all
"2.0.7":
folder: all
"2.0.6":
folder: all
"2.0.5":
folder: all
"2.0.4":
"1.2.2":
folder: all