Skip to content

Commit

Permalink
(#21645) xmlsec: bump
Browse files Browse the repository at this point in the history
* xmlsec: bump

* Bump/xmlsec/all (#54)

* xmlsec/all: bump deps

Generated and committed by [Conan Center Bump Deps](https://github.com/ericLemanissier/conan-center-index-bump-deps)
Find more updatable recipes in the [GitHub Pages](https://ericLemanissier.github.io/conan-center-index-bump-deps/)

* rebump

* unbump libxml2

* simplify test package

* remove 1.3.2

* Update conanfile.py

* Update conanfile.py
  • Loading branch information
ericLemanissier authored Dec 14, 2023
1 parent 8ecce87 commit 177f0e3
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 270 deletions.
3 changes: 3 additions & 0 deletions recipes/xmlsec/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.2.38":
url: "https://github.com/lsh123/xmlsec/releases/download/xmlsec-1_2_38/xmlsec1-1.2.38.tar.gz"
sha256: "9de8cf8d7d2e288a9cef205cc6cb93c926a67dadfaf44aaff76ed63c28ce9902"
"1.2.33":
url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.33.tar.gz"
sha256: "26041d35a20a245ed5a2fb9ee075f10825664d274220cb5190340fa87a4d0931"
Expand Down
11 changes: 7 additions & 4 deletions recipes/xmlsec/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def build_requirements(self):
if not is_msvc(self):
self.tool_requires("libtool/2.4.7")
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/2.1.0")
if self._settings_build.os == "Windows":
self.win_bash = True
if not self.conf.get("tools.microsoft.bash:path", check_type=str):
Expand Down Expand Up @@ -158,11 +158,13 @@ def build(self):
f"static={yes_no(not self.options.shared)}",
"include=\"{}\"".format(";".join(deps_includedirs)),
"lib=\"{}\"".format(";".join(deps_libdirs)),
"with-dl=no",
"with-dl={}".format(yes_no(Version(self.version) >= "1.2.35" and self.options.shared)),
f"xslt={yes_no(self.options.with_xslt)}",
"iconv=no",
"crypto={}".format(",".join(crypto_engines)),
]
if Version(self.version) >= "1.2.35":
args.append("pedantic=no")

with chdir(self, os.path.join(self.source_folder, "win32")):
self.run(f"cscript configure.js {' '.join(args)}")
Expand Down Expand Up @@ -199,8 +201,9 @@ def package(self):
if not self.options.shared:
rm(self, "*.dll", os.path.join(self.package_folder, "bin"))
rm(self, "*.pdb", os.path.join(self.package_folder, "bin"))
os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec-openssl_a.lib" if self.options.shared else "libxmlsec-openssl.lib"))
os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec_a.lib" if self.options.shared else "libxmlsec.lib"))
if Version(self.version) < "1.2.35":
os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec-openssl_a.lib" if self.options.shared else "libxmlsec-openssl.lib"))
os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec_a.lib" if self.options.shared else "libxmlsec.lib"))
else:
autotools = Autotools(self)
autotools.install()
Expand Down
11 changes: 2 additions & 9 deletions recipes/xmlsec/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ 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 LibXml2::LibXml2 xmlsec::xmlsec)
if(XMLSEC_WITH_XSLT)
target_link_libraries(${PROJECT_NAME} PRIVATE LibXslt::LibXslt)
endif()
add_executable(${PROJECT_NAME} main.c)
target_link_libraries(${PROJECT_NAME} PRIVATE xmlsec::xmlsec)
14 changes: 3 additions & 11 deletions recipes/xmlsec/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.cmake import CMake, cmake_layout
import os


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

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)
self.requires("libxml2/2.11.5")

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 All @@ -29,6 +23,4 @@ def build(self):
def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
xml_file = os.path.join(self.source_folder, "sign1-tmpl.xml")
pem_file = os.path.join(self.source_folder, "rsakey.pem")
self.run(f"{bin_path} {xml_file} {pem_file}", env="conanrun")
self.run(bin_path, env="conanrun")
28 changes: 28 additions & 0 deletions recipes/xmlsec/all/test_package/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <stdlib.h>


#include <xmlsec/xmlsec.h>


int main(int argc, char **argv) {
/* Init xmlsec library */
if(xmlSecInit() < 0) {
fprintf(stderr, "Error: xmlsec initialization failed.\n");
return(-1);
}

/* Check loaded library version */
if(xmlSecCheckVersion() != 1) {
fprintf(stderr, "Error: loaded xmlsec library version is not compatible.\n");
return(-1);
}

if(xmlSecCheckVersionExact() != 1) {
fprintf(stderr, "Error: loaded xmlsec library version is not exact.\n");
return(-1);
}

/* Shutdown xmlsec library */
xmlSecShutdown();
return(0);
}
9 changes: 0 additions & 9 deletions recipes/xmlsec/all/test_package/rsakey.pem

This file was deleted.

26 changes: 0 additions & 26 deletions recipes/xmlsec/all/test_package/sign1-tmpl.xml

This file was deleted.

211 changes: 0 additions & 211 deletions recipes/xmlsec/all/test_package/sign1.c

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/xmlsec/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.2.38":
folder: all
"1.2.33":
folder: all
"1.2.32":
Expand Down

0 comments on commit 177f0e3

Please sign in to comment.