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

innoextract: add package_type, bump deps #25382

Open
wants to merge 5 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
4 changes: 4 additions & 0 deletions recipes/innoextract/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
"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"

Check warning on line 13 in recipes/innoextract/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. found arbitrary text in patch_type: backport ^ (line: 13)
patch_source: "https://github.com/dscharrer/innoextract/pull/169"
36 changes: 22 additions & 14 deletions recipes/innoextract/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
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"


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):
Expand All @@ -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]")
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
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)
Expand All @@ -51,21 +58,22 @@ 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"))

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)
24 changes: 24 additions & 0 deletions recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 264c2fe6b84f90f6290c670e5f676660ec7b2387 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@lindev.ch>
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 <boost/cstdint.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/directory.hpp>
#include <boost/range/size.hpp>

#include "util/console.hpp"
Loading