Skip to content

Commit

Permalink
qcbor: add version 1.5 (#25891)
Browse files Browse the repository at this point in the history
  • Loading branch information
toge authored Nov 12, 2024
1 parent 1bbdf71 commit 6407249
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
7 changes: 7 additions & 0 deletions recipes/qcbor/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.5":
url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.5.tar.gz"
sha256: "fd71c2aa985575ea5e7df1540da54261f04af872fe4c4e76bfe56affc14dcd2a"
"1.4.1":
url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.4.1.tar.gz"
sha256: "c7ef031b60b23bf8ede47c66c9713982bba2608668b144280a65665bfcc94470"
Expand All @@ -15,6 +18,10 @@ sources:
url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.0.tar.gz"
sha256: "961a46eb5a599cc040bfce4f4fade4427e046f1748f37ba4ebbc097fb9cdf1d3"
patches:
"1.5":
- patch_file: "patches/1.5-0001-fix-cmake.patch"
patch_description: "disable fix fPIC and add installation"
patch_type: "conan"
"1.4.1":
- patch_file: "patches/1.4.1-0001-fix-cmake.patch"
patch_description: "disable fix fPIC and add installation"
Expand Down
13 changes: 8 additions & 5 deletions recipes/qcbor/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan import ConanFile
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, load, save
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, load, save, copy
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.scm import Version

Expand Down Expand Up @@ -74,10 +74,13 @@ def package(self):
cmake.install()
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))

# Extract the License/s from README.md to a file
tmp = load(self, os.path.join(self.source_folder, "inc", "qcbor", "qcbor.h"))
license_contents = re.search("( Copyright.*) =====", tmp, re.DOTALL)[1]
save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents)
if Version(self.version) >= "1.5":
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
else:
# Extract the License/s from README.md to a file
tmp = load(self, os.path.join(self.source_folder, "inc", "qcbor", "qcbor.h"))
license_contents = re.search("( Copyright.*) =====", tmp, re.DOTALL)[1]
save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents)

def package_info(self):
self.cpp_info.libs = ["qcbor"]
Expand Down
23 changes: 23 additions & 0 deletions recipes/qcbor/all/patches/1.5-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c7e081..6f4ea4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,7 @@ target_compile_definitions(qcbor
$<$<BOOL:${QCBOR_OPT_DISABLE_FLOAT_ALL}>:USEFULBUF_DISABLE_ALL_FLOAT>
)

-if (BUILD_SHARED_LIBS)
+if (0)
target_compile_options(qcbor PRIVATE -Os -fPIC)
endif()

@@ -90,6 +90,9 @@ set_target_properties(
include(GNUInstallDirs)
install(
TARGETS qcbor
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qcbor"
)

8 changes: 0 additions & 8 deletions recipes/qcbor/all/test_v1_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/qcbor/all/test_v1_package/conanfile.py

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/qcbor/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.5":
folder: all
"1.4.1":
folder: all
"1.3":
Expand Down

0 comments on commit 6407249

Please sign in to comment.