Skip to content

Commit

Permalink
(conan-io#24623) icu: add version 75.1
Browse files Browse the repository at this point in the history
* icu: add version 75.1

* require C++17 in 75.1

* remove debug print

* icu: remove old versions

---------

Co-authored-by: Luis Caro Campos <[email protected]>
  • Loading branch information
toge and jcar87 authored Jul 24, 2024
1 parent 4f3d305 commit 91f01b1
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 215 deletions.
35 changes: 5 additions & 30 deletions recipes/icu/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"75.1":
url: "https://github.com/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-src.tgz"
sha256: "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef"
"74.2":
url: "https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-src.tgz"
sha256: "68db082212a96d6f53e35d60f47d38b962e9f9d207a74cfac78029ae8ff5e08c"
Expand All @@ -11,22 +14,9 @@ sources:
"73.1":
url: "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz"
sha256: "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45"
"72.1":
url: "https://github.com/unicode-org/icu/releases/download/release-72-1/icu4c-72_1-src.tgz"
sha256: "a2d2d38217092a7ed56635e34467f92f976b370e20182ad325edea6681a71d68"
"71.1":
url: "https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.tgz"
sha256: "67a7e6e51f61faf1306b6935333e13b2c48abd8da6d2f46ce6adca24b1e21ebf"
"70.1":
url: "https://github.com/unicode-org/icu/releases/download/release-70-1/icu4c-70_1-src.tgz"
sha256: "8d205428c17bf13bb535300669ed28b338a157b1c01ae66d31d0d3e2d47c3fd5"
"69.1":
url: "https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz"
sha256: "4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745"
"68.2":
url: "https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz"
sha256: "c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625"
patches:
"75.1":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"74.2":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"74.1":
Expand All @@ -35,18 +25,3 @@ patches:
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"73.1":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"72.1":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"71.1":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
- patch_file: "patches/0001-71.1-fix-undef-strict-ansi.patch"
- patch_file: "patches/0001-71.1-fix-emscripten.patch"
patch_description: "Add config file for wasm-emscripten platform"
patch_type: "portability"
patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1"
"70.1":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"69.1":
- patch_file: "patches/0001-69.1-fix-mingw.patch"
"68.2":
- patch_file: "patches/0001-67.1-fix-mingw.patch"
29 changes: 27 additions & 2 deletions recipes/icu/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import is_apple_os
from conan.tools.build import cross_building, stdcpp_library
from conan.tools.build import cross_building, stdcpp_library, check_min_cppstd
from conan.tools.env import Environment, VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save
from conan.tools.gnu import Autotools, AutotoolsToolchain
Expand Down Expand Up @@ -46,6 +46,20 @@ class ICUConan(ConanFile):
"with_extras": False,
}

@property
def _min_cppstd(self):
return 17

@property
def _compilers_minimum_version(self):
return {
"gcc": "8",
"clang": "7",
"apple-clang": "12",
"Visual Studio": "16",
"msvc": "192",
}

@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings)
Expand Down Expand Up @@ -76,6 +90,14 @@ def validate(self):
if self.options.dat_package_file:
if not os.path.exists(str(self.options.dat_package_file)):
raise ConanInvalidConfiguration("Non-existent dat_package_file specified")
if Version(self.version) >= "75.1":
if self.settings.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."
)

def layout(self):
basic_layout(self, src_folder="src")
Expand Down Expand Up @@ -155,7 +177,10 @@ def generate(self):
if is_msvc(self):
env = Environment()
env.define("CC", "cl -nologo")
env.define("CXX", "cl -nologo")
if Version(self.version) < "75.1":
env.define("CXX", "cl -nologo")
else:
env.define("CXX", "cl -nologo -std:c++17")
if cross_building(self):
env.define("icu_cv_host_frag", "mh-msys-msvc")
env.vars(self).save_script("conanbuild_icu_msvc")
Expand Down
37 changes: 0 additions & 37 deletions recipes/icu/all/patches/0001-67.1-fix-mingw.patch

This file was deleted.

117 changes: 0 additions & 117 deletions recipes/icu/all/patches/0001-71.1-fix-emscripten.patch

This file was deleted.

18 changes: 0 additions & 18 deletions recipes/icu/all/patches/0001-71.1-fix-undef-strict-ansi.patch

This file was deleted.

6 changes: 5 additions & 1 deletion recipes/icu/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ find_package(ICU REQUIRED uc)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ICU::uc)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
if(ICU_VERSION VERSION_LESS "75.1")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
endif()
12 changes: 2 additions & 10 deletions recipes/icu/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"75.1":
folder: all
"74.2":
folder: all
"74.1":
Expand All @@ -7,13 +9,3 @@ versions:
folder: all
"73.1":
folder: all
"72.1":
folder: all
"71.1":
folder: all
"70.1":
folder: all
"69.1":
folder: all
"68.2":
folder: all

0 comments on commit 91f01b1

Please sign in to comment.