Skip to content
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

mailio: add version 0.24.0 #25955

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions recipes/mailio/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.24.0":
url: "https://github.com/karastojko/mailio/archive/refs/tags/0.24.0.tar.gz"
sha256: "c14f0022a2c5874785e877ab97289dd956633368fecc558529fe43cd3a3494d3"
"0.23.0":
url: "https://github.com/karastojko/mailio/archive/refs/tags/0.23.0.tar.gz"
sha256: "9fc3f1f803a85170c2081cbbef2e301473a400683fc1dffefa2d6707598206a5"
Expand All @@ -12,6 +15,13 @@ sources:
url: "https://github.com/karastojko/mailio/archive/refs/tags/0.20.0.tar.gz"
sha256: "073d6b1ff891444b54a01c2a3f17074fd612f9e2e14d9ebd61863c70737b1882"
patches:
"0.24.0":
- patch_file: "patches/0.24.0-adapt-cmakelists.patch"
patch_description: "fix install path"
patch_type: "conan"
- patch_file: "patches/0.24.0-0002-backport-missing-include.patch"
patch_description: "Add missing vector include"
patch_type: "backport"
"0.23.0":
- patch_file: "patches/0.23.0-adapt-cmakelists.patch"
patch_description: "fix install path"
Expand Down
41 changes: 7 additions & 34 deletions recipes/mailio/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from conan.tools.scm import Version
import os

required_conan_version = ">=1.53.0"
required_conan_version = ">=2.0.9"

class MailioConan(ConanFile):
name = "mailio"
Expand All @@ -27,61 +27,35 @@ class MailioConan(ConanFile):
"shared": False,
}
short_paths = True

@property
def _min_cppstd(self):
return "17"

@property
def _compilers_minimum_version(self):
return {
"gcc": "8.3",
"clang": "6",
"Visual Studio": "15",
"msvc": "191",
"apple-clang": "10",
}
implements = ["auto_shared_fpic"]

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("boost/1.82.0", transitive_headers=True, transitive_libs=True)
self.requires("boost/1.86.0", transitive_headers=True, transitive_libs=True)
self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True)

def validate(self):
if self.settings.get_safe("compiler.cppstd"):
check_min_cppstd(self, self._min_cppstd)

minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)
check_min_cppstd(self, 17)

def build_requirements(self):
self.tool_requires("cmake/[>=3.16.3 <4]")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
apply_conandata_patches(self)

def generate(self):
env = VirtualBuildEnv(self)
env.generate()

tc = CMakeToolchain(self)
tc.variables["MAILIO_BUILD_SHARED_LIBRARY"] = self.options.shared
if Version(self.version) < "0.24.0":
tc.variables["MAILIO_BUILD_SHARED_LIBRARY"] = self.options.shared
tc.variables["MAILIO_BUILD_DOCUMENTATION"] = False
tc.variables["MAILIO_BUILD_EXAMPLES"] = False
if Version(self.version) >= "0.22.0":
Expand All @@ -92,7 +66,6 @@ def generate(self):
deps.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/include/mailio/percent.hpp b/include/mailio/percent.hpp
index 166ee3b..4bf0d46 100644
--- a/include/mailio/percent.hpp
+++ b/include/mailio/percent.hpp
@@ -14,6 +14,7 @@ copy at http://www.freebsd.org/copyright/freebsd-license.html.
#pragma once

#include <string>
+#include <vector>
#include "codec.hpp"
#include "export.hpp"

13 changes: 13 additions & 0 deletions recipes/mailio/all/patches/0.24.0-adapt-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30d4e0d..747cfab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,7 +144,7 @@ configure_file(mailio.pc.in ${CMAKE_BINARY_DIR}/mailio.pc IMMEDIATE @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp)
-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME})
+install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME})

# generate the export header for exporting symbols
# this is needed to generate a shared library.
8 changes: 0 additions & 8 deletions recipes/mailio/all/test_v1_package/CMakeLists.txt

This file was deleted.

18 changes: 0 additions & 18 deletions recipes/mailio/all/test_v1_package/conanfile.py

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/mailio/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.24.0":
folder: all
"0.23.0":
folder: all
"0.22.0":
Expand Down