diff --git a/recipes/innoextract/all/conandata.yml b/recipes/innoextract/all/conandata.yml index a280c970476d1..483273e3d6496 100644 --- a/recipes/innoextract/all/conandata.yml +++ b/recipes/innoextract/all/conandata.yml @@ -8,3 +8,7 @@ patches: "1.9.0": - patch_file: "patches/0001-cmake-fix-module.patch" - patch_file: "patches/0002-remove-custom-cmake-find-modules.patch" + - patch_file: "patches/0003-fix-boost-1_85-usage.patch" + patch_description: "Fix Boost 1.85 usage" + patch_type: "backport" + patch_source: "https://github.com/dscharrer/innoextract/pull/169" diff --git a/recipes/innoextract/all/conanfile.py b/recipes/innoextract/all/conanfile.py index c21ccf578684a..39a0b0164bd6a 100644 --- a/recipes/innoextract/all/conanfile.py +++ b/recipes/innoextract/all/conanfile.py @@ -1,9 +1,9 @@ -from conan import ConanFile -from conan.tools.files import get, rmdir, copy, apply_conandata_patches, export_conandata_patches -from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import VirtualBuildEnv import os +from conan import ConanFile, conan_version +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, rmdir, copy, apply_conandata_patches, export_conandata_patches, rm required_conan_version = ">=1.52.0" @@ -11,10 +11,11 @@ class InnoextractConan(ConanFile): name = "innoextract" description = "Extract contents of Inno Setup installers" - license = "LicenseRef-LICENSE" + license = "Zlib" topics = ("inno-setup", "decompression") homepage = "https://constexpr.org/innoextract" url = "https://github.com/conan-io/conan-center-index" + package_type = "application" settings = "os", "arch", "compiler", "build_type" def export_sources(self): @@ -24,17 +25,23 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0") - self.requires("xz_utils/5.2.5") + self.requires("boost/1.85.0") + self.requires("xz_utils/[>=5.4.5 <6]") self.requires("libiconv/1.17") + def validate(self): + # TODO: Remove guard after dropping Conan 1.x support + if conan_version > "2": + # This was not backported to Conan 1.x + from conan.tools.build import check_max_cppstd + # Uses auto_ptr + check_max_cppstd(self, "14") + def package_id(self): del self.info.settings.compiler - self.info.requires.clear() def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True, - destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): env = VirtualBuildEnv(self) @@ -51,14 +58,14 @@ def generate(self): def build(self): apply_conandata_patches(self) - os.remove(os.path.join(self.source_folder, 'cmake', 'FindLZMA.cmake')) - os.remove(os.path.join(self.source_folder, 'cmake', 'Findiconv.cmake')) + rm(self, "FindLZMA.cmake", os.path.join(self.source_folder, "cmake")) + rm(self, "Findiconv.cmake", os.path.join(self.source_folder, "cmake")) cmake = CMake(self) cmake.configure() cmake.build() def package(self): - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) @@ -66,6 +73,7 @@ def package(self): def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] + + # TODO: Remove after dropping Conan 1.x support bindir = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) diff --git a/recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch b/recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch new file mode 100644 index 0000000000000..c975532bd4744 --- /dev/null +++ b/recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch @@ -0,0 +1,24 @@ +From 264c2fe6b84f90f6290c670e5f676660ec7b2387 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= +Date: Thu, 28 Mar 2024 15:11:40 +0100 +Subject: [PATCH] Fix build with boost 1.85 + +As of boost 1.85-beta1, boost/filesystem/directory.hpp is no longer +implicitly included by boost/filesystem/operations.hpp. Include it +explicitly. +--- + src/stream/slice.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/stream/slice.cpp b/src/stream/slice.cpp +index 12468a38..f7ebe0e5 100644 +--- a/src/stream/slice.cpp ++++ b/src/stream/slice.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + + #include "util/console.hpp" \ No newline at end of file