Skip to content

Commit

Permalink
patch for plugin script
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirtz committed Nov 16, 2021
1 parent 06017c1 commit 5a21dec
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 38 deletions.
4 changes: 4 additions & 0 deletions recipes/aws-sdk-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ patches:
"1.9.100":
- base_path: source_subfolder
patch_file: patches/1.9.100-0001-disable-sort-links.patch
- base_path: source_subfolder
patch_file: patches/1.9.100-0002-aws-plugin-conf.patch
"1.8.130":
- base_path: source_subfolder
patch_file: patches/1.8.130-0001-disable-sort-links.patch
Expand All @@ -18,3 +20,5 @@ patches:
patch_file: patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch
- base_path: source_subfolder
patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch
- base_path: source_subfolder
patch_file: patches/1.8.130-0005-aws-plugin-conf.patch
40 changes: 2 additions & 38 deletions recipes/aws-sdk-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def _create_project_cmake_module(self):
"cmake/compiler_settings.cmake",
"cmake/initialize_project_version.cmake",
"cmake/utilities.cmake",
"cmake/sdk_plugin_conf.cmake",
"toolchains/cmakeProjectConfig.cmake",
"toolchains/pkg-config.pc.in",
"aws-cpp-sdk-core/include/aws/core/VersionConfig.h"
Expand All @@ -424,43 +425,6 @@ def _create_project_cmake_module(self):
rename(self, os.path.join("toolchains", "cmakeProjectConfig.cmake"), os.path.join("toolchains", "cmakeProjectConf.cmake"))
tools.replace_in_file(os.path.join("cmake", "utilities.cmake"), "cmakeProjectConfig.cmake", "cmakeProjectConf.cmake")

# create a cmake module to load the files above
contents = textwrap.dedent("""
get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
set(SIMPLE_INSTALL TRUE)
if (CMAKE_INSTALL_BINDIR)
set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}")
endif()
if (CMAKE_INSTALL_LIBDIR)
set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}")
endif()
if (CMAKE_INSTALL_INCLUDEDIR)
set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}")
endif()
if(BUILD_SHARED_LIBS)
set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}")
else()
set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}")
endif()
if(DEFINED CMAKE_CXX_STANDARD)
set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD})
else()
set(STANDARD_DEFAULT "11")
endif()
set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.")
include(CMakePackageConfigHelpers)
include(initialize_project_version)
include(utilities)
include(compiler_settings)
""")
tools.save(os.path.join(self.package_folder, self._res_folder, "cmake", "add_project.cmake"), content=contents)

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
Expand Down Expand Up @@ -539,4 +503,4 @@ def package_info(self):
self.cpp_info.components["plugin_scripts"].builddirs.extend([
os.path.join(self._res_folder, "cmake"),
os.path.join(self._res_folder, "toolchains")])
self.cpp_info.components["plugin_scripts"].build_modules.append(os.path.join(self._res_folder, "cmake", "add_project.cmake"))
self.cpp_info.components["plugin_scripts"].build_modules.append(os.path.join(self._res_folder, "cmake", "sdk_plugin_conf.cmake"))
44 changes: 44 additions & 0 deletions recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
commit 1179cb040d6b9292d30eb7d444298cd286f9f574
Author: dvirtz <dvirtz@gmail.com>
Date: Tue Nov 16 21:38:45 2021 +0200

add a file to configure SDK plugins

diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake
new file mode 100644
index 0000000000..474ead75bd
--- /dev/null
+++ b/cmake/sdk_plugin_conf.cmake
@@ -0,0 +1,32 @@
+get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
+set(SIMPLE_INSTALL TRUE)
+
+if (CMAKE_INSTALL_BINDIR)
+ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}")
+endif()
+
+if (CMAKE_INSTALL_LIBDIR)
+ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}")
+endif()
+
+if (CMAKE_INSTALL_INCLUDEDIR)
+ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}")
+endif()
+
+if(BUILD_SHARED_LIBS)
+ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}")
+else()
+ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}")
+endif()
+
+if(DEFINED CMAKE_CXX_STANDARD)
+ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD})
+else()
+ set(STANDARD_DEFAULT "11")
+endif()
+set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.")
+
+include(CMakePackageConfigHelpers)
+include(initialize_project_version)
+include(utilities)
+include(compiler_settings)
44 changes: 44 additions & 0 deletions recipes/aws-sdk-cpp/all/patches/1.9.100-0002-aws-plugin-conf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
commit 1179cb040d6b9292d30eb7d444298cd286f9f574
Author: dvirtz <dvirtz@gmail.com>
Date: Tue Nov 16 21:38:45 2021 +0200

add a file to configure SDK plugins

diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake
new file mode 100644
index 0000000000..474ead75bd
--- /dev/null
+++ b/cmake/sdk_plugin_conf.cmake
@@ -0,0 +1,32 @@
+get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
+set(SIMPLE_INSTALL TRUE)
+
+if (CMAKE_INSTALL_BINDIR)
+ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}")
+endif()
+
+if (CMAKE_INSTALL_LIBDIR)
+ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}")
+endif()
+
+if (CMAKE_INSTALL_INCLUDEDIR)
+ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}")
+endif()
+
+if(BUILD_SHARED_LIBS)
+ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}")
+else()
+ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}")
+endif()
+
+if(DEFINED CMAKE_CXX_STANDARD)
+ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD})
+else()
+ set(STANDARD_DEFAULT "11")
+endif()
+set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.")
+
+include(CMakePackageConfigHelpers)
+include(initialize_project_version)
+include(utilities)
+include(compiler_settings)

0 comments on commit 5a21dec

Please sign in to comment.