Skip to content

Commit

Permalink
(#7417) bump libxlsxwriter to 1.1.3
Browse files Browse the repository at this point in the history
* move patch file to  patches/{version}.

* bump libxlsxwriter to 1.1.3

* use get_safe when get "fmemopen" value.

* remove .pc files

* Remove trailing spaces

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* Use latest patch version

Co-authored-by: Uilian Ries <uilianries@gmail.com>

Co-authored-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
toge and uilianries authored Sep 28, 2021
1 parent 87884e7 commit 8a322c8
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 6 deletions.
8 changes: 7 additions & 1 deletion recipes/libxlsxwriter/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
sources:
"1.1.3":
url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.3.tar.gz"
sha256: "bd7a3d38c6a8ef5e31d07a61fded23ac00d29d758417ca42db89da60bf796d78"
"1.0.0":
url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.0.0.tar.gz"
sha256: "8b353379333c323d14a9d265cd2491d3a6c0032c8d6ec2141f10b82ab66a087c"
patches:
"1.1.3":
- base_path: "source_subfolder"
patch_file: "patches/1.1.3/001-patch-cmake-conan-targets.patch"
"1.0.0":
- base_path: "source_subfolder"
patch_file: "patches/001-patch-cmake-conan-targets.patch"
patch_file: "patches/1.0.0/001-patch-cmake-conan-targets.patch"
34 changes: 29 additions & 5 deletions recipes/libxlsxwriter/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from conans import ConanFile, CMake, tools

from conans.errors import ConanInvalidConfiguration

class LibxlsxwriterConan(ConanFile):
name = "libxlsxwriter"
Expand All @@ -12,11 +12,19 @@ class LibxlsxwriterConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False]
"fPIC": [True, False],
"tmpfile": [True, False],
"md5": [False, "openwall", "openssl"],
"fmemopen": [True, False],
"dtoa": [True, False],
}
default_options = {
"shared": False,
"fPIC": True
"fPIC": True,
"tmpfile": False,
"md5": "openwall",
"fmemopen": False,
"dtoa": False,
}
exports_sources = ["CMakeLists.txt", "patches/*"]
generators = "cmake"
Expand All @@ -30,16 +38,24 @@ def _source_subfolder(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
if self.settings.os != "Linux":
del self.options.fmemopen

def configure(self):
if self.options.shared:
del self.options.fPIC
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd

def validate(self):
if tools.Version(self.version) <= "1.0.5" and self.options.md5 == "openssl":
raise ConanInvalidConfiguration("{0}:md5=openssl is not suppported in {0}/{1}".format(self.name, self.version))

def requirements(self):
self.requires("minizip/1.2.11")
self.requires("zlib/1.2.11")
if self.options.md5 == "openssl":
self.requires("openssl/1.1.1l")

def source(self):
tools.get(**self.conan_data["sources"][self.version])
Expand All @@ -58,6 +74,15 @@ def _configure_cmake(self):
self._cmake.definitions["BUILD_EXAMPLES"] = False
self._cmake.definitions["USE_STATIC_MSVC_RUNTIME"] = (self.settings.os == "Windows" and "MT" in str(self.settings.compiler.runtime))
self._cmake.definitions["USE_SYSTEM_MINIZIP"] = True
self._cmake.definitions["USE_STANDARD_TMPFILE"] = self.options.tmpfile

if self.options.md5 == False:
self._cmake.definitions["USE_NO_MD5"] = True
elif self.options.md5 == "openssl":
self._cmake.definitions["USE_OPENSSL_MD5"] = True

self._cmake.definitions["USE_FMEMOPEN"] = self.options.get_safe("fmemopen", False)
self._cmake.definitions["USE_DTOA_LIBRARY"] = self.options.dtoa

self._cmake.configure()
return self._cmake
Expand All @@ -71,8 +96,7 @@ def package(self):
cmake = self._configure_cmake()
cmake.install()
self.copy("License.txt", src=self._source_subfolder, dst="licenses")

tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pc")

def package_info(self):
self.cpp_info.libs = ["xlsxwriter"]

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt
index 66505b5..d63cc96 100644
--- a/a/CMakeLists.txt
+++ b/b/CMakeLists.txt
@@ -213,16 +213,16 @@ configure_file(dev/release/pkg-config.txt xlsxwriter.pc @ONLY)
# INCLUDES
# --------
enable_language(CXX)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+#list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# ZLIB
find_package(ZLIB REQUIRED "1.0")
-list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
+#list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
message("zlib version: " ${ZLIB_VERSION})

# MINIZIP
if (USE_SYSTEM_MINIZIP)
- find_package(MINIZIP REQUIRED "1.0")
+# find_package(MINIZIP REQUIRED "1.0")
list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS})
endif()

@@ -259,7 +259,7 @@ if(NOT USE_OPENSSL_MD5 AND NOT USE_NO_MD5)
endif()

if(USE_OPENSSL_MD5)
- find_package(OpenSSL REQUIRED)
+# find_package(OpenSSL REQUIRED)
if(OpenSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
message(STATUS "OpenSSL version: ${OPENSSL_VERSION}")
@@ -278,7 +278,8 @@ target_sources(${PROJECT_NAME}
PRIVATE ${LXW_SOURCES}
PUBLIC ${LXW_HEADERS}
)
-target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES} ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY})
+#target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES} ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY})
+target_link_libraries(${PROJECT_NAME} LINK_PUBLIC CONAN_PKG::zlib CONAN_PKG::minizip)
target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS})

# /utf-8 needs VS2015 Update 2 or above.
2 changes: 2 additions & 0 deletions recipes/libxlsxwriter/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"1.1.3":
folder: "all"
"1.0.0":
folder: "all"

0 comments on commit 8a322c8

Please sign in to comment.