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

xmlsec: fix url of tarballs + bump dependencies #17062

Merged
merged 10 commits into from
Apr 28, 2023
6 changes: 3 additions & 3 deletions recipes/xmlsec/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
sources:
"1.2.32":
url: "http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.32.tar.gz"
url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.32.tar.gz"
SpaceIm marked this conversation as resolved.
Show resolved Hide resolved
sha256: "e383702853236004e5b08e424b8afe9b53fe9f31aaa7a5382f39d9533eb7c043"
"1.2.31":
url: "http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.31.tar.gz"
url: "http://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.31.tar.gz"
sha256: "9b10bc52cc31e4f76162e3975e50db26b71ab49c571d810b311ca626be5a0b26"
"1.2.30":
url: "http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.30.tar.gz"
url: "http://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.30.tar.gz"
sha256: "2d84360b03042178def1d9ff538acacaed2b3a27411db7b2874f1612ed71abc8"
14 changes: 11 additions & 3 deletions recipes/xmlsec/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("libxml2/2.10.3")
self.requires("libxml2/2.10.4", transitive_headers=True)
if self.options.with_openssl:
self.requires("openssl/1.1.1s")
self.requires("openssl/3.1.0", transitive_headers=True)
if self.options.with_xslt:
self.requires("libxslt/1.1.34")

Expand Down Expand Up @@ -140,7 +140,15 @@ def build(self):
crypto_engines = []
if self.options.with_openssl:
ov = Version(self.dependencies["openssl"].ref.version)
crypto_engines.append(f"openssl={ov.major}{ov.minor}0")
if ov.major >= "3":
if Version(self.version) < "1.2.35":
# configure.js doesn't understand openssl=300 before xmlsec 1.2.35,
# For these xmlsec versions, setting 110 even for OpenSSL 3.x should be compatible
crypto_engines.append("openssl=110")
else:
crypto_engines.append("openssl=300")
else:
crypto_engines.append(f"openssl={ov.major}{ov.minor}0")

yes_no = lambda v: "yes" if v else "no"
args = [
Expand Down
9 changes: 8 additions & 1 deletion recipes/xmlsec/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES C)

find_package(xmlsec REQUIRED CONFIG)
find_package(LibXml2 REQUIRED MODULE)
if(XMLSEC_WITH_XSLT)
find_package(LibXslt REQUIRED MODULE)
endif()

add_executable(${PROJECT_NAME} sign1.c)
target_link_libraries(${PROJECT_NAME} PRIVATE xmlsec::xmlsec)
target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2 xmlsec::xmlsec)
if(XMLSEC_WITH_XSLT)
target_link_libraries(${PROJECT_NAME} PRIVATE LibXslt::LibXslt)
endif()
10 changes: 8 additions & 2 deletions recipes/xmlsec/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
generators = "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)
self.requires("libxml2/2.10.4")
Copy link
Contributor

Choose a reason for hiding this comment

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

IT would have been nice to have dc5da99 here since it's out of the norm


def generate(self):
tc = CMakeToolchain(self)
tc.variables["XMLSEC_WITH_XSLT"] = self.dependencies["xmlsec"].options.with_xslt
tc.generate()

def build(self):
cmake = CMake(self)
Expand Down
3 changes: 2 additions & 1 deletion recipes/xmlsec/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"
generators = "cmake", "cmake_find_package", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.definitions["XMLSEC_WITH_XSLT"] = self.options["xmlsec"].with_xslt
cmake.configure()
cmake.build()

Expand Down