From 91bd2bfa6efeec38c9b7b256c995cd3f750b357e Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Sun, 27 Oct 2024 11:41:30 +0000 Subject: [PATCH 01/29] initial conan commit for dpp --- recipes/dpp/all/conandata.yml | 0 recipes/dpp/all/conanfile.py | 87 +++++++++++++++++++++++++++++++++++ recipes/dpp/config.yml | 3 ++ 3 files changed, 90 insertions(+) create mode 100644 recipes/dpp/all/conandata.yml create mode 100644 recipes/dpp/all/conanfile.py create mode 100644 recipes/dpp/config.yml diff --git a/recipes/dpp/all/conandata.yml b/recipes/dpp/all/conandata.yml new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py new file mode 100644 index 0000000000000..0c45bf906c724 --- /dev/null +++ b/recipes/dpp/all/conanfile.py @@ -0,0 +1,87 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.scm import Git +from conan.tools.files import download, unzip + +required_conan_version = ">=2.0" + +class DPPConan(ConanFile): + name = "dpp" + version = "10.0.34" + license = "Apache-2.0" + url = "https://github.com/brainboxdotcc/DPP" + description = "D++ is a lightweight and efficient library for Discord" + topics = ("discord") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": True, "fPIC": True} + + @property + def _min_cppstd(self): + return 17 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def requirements(self): + self.requires("nlohmann_json/3.11.2") + self.requires("openssl/3.1.2") + self.requires("zlib/1.3") + self.requires("opus/1.4") + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self) + + def export(self): + git = Git(self, self.recipe_folder) + git.coordinates_to_conandata() + + def source(self): + # This environment variable should only be set by D++ library developers to ensure that conan builds succeed + # without having to wait for release. It will check out the development branch where conanfile.py is being + # developed and tested. If you are NOT sure what this does, DO NOT SET IT. You won't get the D++ release + # you expect! + if 'DPP_CONAN_TESTING' in os.environ: + git = Git(self) + git.clone(url="https://github.com/brainboxdotcc/DPP.git", target=".") + git.checkout(commit="conan-the-librarian") + zip_name = "DPP.zip" + else: + download(self, f"https://github.com/brainboxdotcc/DPP/archive/refs/tags/v{self.version}.zip", zip_name) + unzip(self, zip_name, '.', False, None, True) + os.unlink(zip_name) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.cache_variables["CONAN_EXPORTED"] = True + tc.cache_variables["BUILD_VOICE_SUPPORT"] = True + tc.cache_variables["DPP_BUILD_TEST"] = False + tc.cache_variables["BUILD_SHARED_LIBS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["dpp"] + self.cpp_info.includedirs = ["include/dpp-10.0"] + self.cpp_info.libdirs = ["lib/dpp-10.0"] diff --git a/recipes/dpp/config.yml b/recipes/dpp/config.yml new file mode 100644 index 0000000000000..74f40185c179a --- /dev/null +++ b/recipes/dpp/config.yml @@ -0,0 +1,3 @@ +versions: + "10.0.34": + folder: all From 5356f800029f63888b6ab6c685b6e490b7396711 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Mon, 28 Oct 2024 13:16:20 +0000 Subject: [PATCH 02/29] fix --- recipes/dpp/all/conandata.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 recipes/dpp/all/conandata.yml diff --git a/recipes/dpp/all/conandata.yml b/recipes/dpp/all/conandata.yml deleted file mode 100644 index e69de29bb2d1d..0000000000000 From f532aa799b6a2f5178592406b44517f93263894f Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Mon, 28 Oct 2024 13:17:55 +0000 Subject: [PATCH 03/29] fix --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 0c45bf906c724..73b134b36818f 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -56,8 +56,8 @@ def source(self): git = Git(self) git.clone(url="https://github.com/brainboxdotcc/DPP.git", target=".") git.checkout(commit="conan-the-librarian") - zip_name = "DPP.zip" else: + zip_name = "DPP.zip" download(self, f"https://github.com/brainboxdotcc/DPP/archive/refs/tags/v{self.version}.zip", zip_name) unzip(self, zip_name, '.', False, None, True) os.unlink(zip_name) From a0bf74659ad86c688058517b2e0eb972b7cb729e Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 08:52:35 +0000 Subject: [PATCH 04/29] test package --- recipes/dpp/all/test_package/CMakeLists.txt | 8 ++++++ recipes/dpp/all/test_package/conanfile.py | 26 +++++++++++++++++++ recipes/dpp/all/test_package/test_package.cpp | 5 ++++ 3 files changed, 39 insertions(+) create mode 100644 recipes/dpp/all/test_package/CMakeLists.txt create mode 100644 recipes/dpp/all/test_package/conanfile.py create mode 100644 recipes/dpp/all/test_package/test_package.cpp diff --git a/recipes/dpp/all/test_package/CMakeLists.txt b/recipes/dpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6aad9088d01aa --- /dev/null +++ b/recipes/dpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) +find_package(dpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dpp::dpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/dpp/all/test_package/conanfile.py b/recipes/dpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/dpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dpp/all/test_package/test_package.cpp b/recipes/dpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..90606cfd59042 --- /dev/null +++ b/recipes/dpp/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + dpp::cluster test_cluster(""); +} From f4d52d902abad55fa9f99708ac8218aefff19d4a Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 17:44:19 +0000 Subject: [PATCH 05/29] fix: specify minimum cmake version --- recipes/dpp/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 73b134b36818f..a17c9d154c781 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -47,6 +47,9 @@ def export(self): git = Git(self, self.recipe_folder) git.coordinates_to_conandata() + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): # This environment variable should only be set by D++ library developers to ensure that conan builds succeed # without having to wait for release. It will check out the development branch where conanfile.py is being From 3118c5598c36daacd6c568aa0b8103822b727263 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 18:32:27 +0000 Subject: [PATCH 06/29] change to 1.6 --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index a17c9d154c781..936f5fb564cb8 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Git from conan.tools.files import download, unzip -required_conan_version = ">=2.0" +required_conan_version = ">=1.65" class DPPConan(ConanFile): name = "dpp" From 8a86dc9627421a00a7dc5449145eed3ce3ccc3a0 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 18:46:59 +0000 Subject: [PATCH 07/29] we dont support users messing with fPIC --- recipes/dpp/all/conanfile.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 936f5fb564cb8..df87785f1d16e 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Git from conan.tools.files import download, unzip -required_conan_version = ">=1.65" +required_conan_version = ">=2.0" class DPPConan(ConanFile): name = "dpp" @@ -15,8 +15,8 @@ class DPPConan(ConanFile): description = "D++ is a lightweight and efficient library for Discord" topics = ("discord") settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": True, "fPIC": True} + options = {"shared": [True, False]} + default_options = {"shared": True} @property def _min_cppstd(self): @@ -32,14 +32,6 @@ def requirements(self): self.requires("zlib/1.3") self.requires("opus/1.4") - def config_options(self): - if self.settings.os == "Windows": - self.options.rm_safe("fPIC") - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): cmake_layout(self) From 3b28c35657e7f805f265dc34028020f13621af91 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 18:48:42 +0000 Subject: [PATCH 08/29] homepage, url --- recipes/dpp/all/conanfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index df87785f1d16e..cb22e60a6c424 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -5,13 +5,14 @@ from conan.tools.scm import Git from conan.tools.files import download, unzip -required_conan_version = ">=2.0" +required_conan_version = ">=1.65" class DPPConan(ConanFile): name = "dpp" version = "10.0.34" license = "Apache-2.0" - url = "https://github.com/brainboxdotcc/DPP" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/brainboxdotcc/DPP" description = "D++ is a lightweight and efficient library for Discord" topics = ("discord") settings = "os", "compiler", "build_type", "arch" From 62e4083366307b2580d75bc0d918b2b493161ba1 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 18:53:28 +0000 Subject: [PATCH 09/29] package_type --- recipes/dpp/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index cb22e60a6c424..0b0b3a7e068f4 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -11,6 +11,7 @@ class DPPConan(ConanFile): name = "dpp" version = "10.0.34" license = "Apache-2.0" + package_type = "shared-library" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/brainboxdotcc/DPP" description = "D++ is a lightweight and efficient library for Discord" From a4599dfbfa41509877490a614811253220339413 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 19:02:44 +0000 Subject: [PATCH 10/29] conandata --- recipes/dpp/all/conandata.yml | 4 ++++ recipes/dpp/all/conanfile.py | 26 +++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 recipes/dpp/all/conandata.yml diff --git a/recipes/dpp/all/conandata.yml b/recipes/dpp/all/conandata.yml new file mode 100644 index 0000000000000..9fcde0e76043e --- /dev/null +++ b/recipes/dpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "10.0.34": + url: + - "https://github.com/brainboxdotcc/DPP/archive/refs/tags/v10.0.34.zip" diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 0b0b3a7e068f4..3dea2baee6689 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -9,7 +9,6 @@ class DPPConan(ConanFile): name = "dpp" - version = "10.0.34" license = "Apache-2.0" package_type = "shared-library" url = "https://github.com/conan-io/conan-center-index" @@ -45,20 +44,12 @@ def build_requirements(self): self.tool_requires("cmake/[>=3.16 <4]") def source(self): - # This environment variable should only be set by D++ library developers to ensure that conan builds succeed - # without having to wait for release. It will check out the development branch where conanfile.py is being - # developed and tested. If you are NOT sure what this does, DO NOT SET IT. You won't get the D++ release - # you expect! - if 'DPP_CONAN_TESTING' in os.environ: - git = Git(self) - git.clone(url="https://github.com/brainboxdotcc/DPP.git", target=".") - git.checkout(commit="conan-the-librarian") - else: - zip_name = "DPP.zip" - download(self, f"https://github.com/brainboxdotcc/DPP/archive/refs/tags/v{self.version}.zip", zip_name) - unzip(self, zip_name, '.', False, None, True) - os.unlink(zip_name) - + #zip_name = "DPP.zip" + #download(self, f"https://github.com/brainboxdotcc/DPP/archive/refs/tags/v{self.version}.zip", zip_name) + #unzip(self, zip_name, '.', False, None, True) + #os.unlink(zip_name) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): deps = CMakeDeps(self) deps.generate() @@ -82,3 +73,8 @@ def package_info(self): self.cpp_info.libs = ["dpp"] self.cpp_info.includedirs = ["include/dpp-10.0"] self.cpp_info.libdirs = ["lib/dpp-10.0"] + def package_info(self): + self.cpp_info.libs = ["package_lib"] + self.cpp_info.set_property("cmake_file_name", "dpp") + self.cpp_info.set_property("cmake_target_name", "dpp::dpp") + From 5b518bd9aba29d1c227e158eced613a198af5af5 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 19:06:16 +0000 Subject: [PATCH 11/29] add get --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 3dea2baee6689..d6cb58241fabf 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.scm import Git -from conan.tools.files import download, unzip +from conan.tools.files import download, unzip, get required_conan_version = ">=1.65" From 4bad8abe1221d43ce9671407326d7f4d6fe08701 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 19:32:36 +0000 Subject: [PATCH 12/29] Update recipes/dpp/all/conandata.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conandata.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/dpp/all/conandata.yml b/recipes/dpp/all/conandata.yml index 9fcde0e76043e..473b795664322 100644 --- a/recipes/dpp/all/conandata.yml +++ b/recipes/dpp/all/conandata.yml @@ -2,3 +2,4 @@ sources: "10.0.34": url: - "https://github.com/brainboxdotcc/DPP/archive/refs/tags/v10.0.34.zip" + sha256: "944dcaa19638ff88feceae2f543662675eb8aceb59458ad369edc28819e05054" From 2568ae86abff3557eadd4d12501d7a721bd8f3e0 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 19:33:01 +0000 Subject: [PATCH 13/29] Update recipes/dpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index d6cb58241fabf..d484d7bfce2b4 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -29,8 +29,8 @@ def validate(self): def requirements(self): self.requires("nlohmann_json/3.11.2") - self.requires("openssl/3.1.2") - self.requires("zlib/1.3") + self.requires("openssl/[>=1.1 <4]") + self.requires("zlib/[>=1.2.11 <2]") self.requires("opus/1.4") def layout(self): From 98fc0a7b8164ecf8fffe81c10622830eb5a82e9f Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 19:33:18 +0000 Subject: [PATCH 14/29] Update recipes/dpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index d484d7bfce2b4..e9f101e7c68e8 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -36,9 +36,6 @@ def requirements(self): def layout(self): cmake_layout(self) - def export(self): - git = Git(self, self.recipe_folder) - git.coordinates_to_conandata() def build_requirements(self): self.tool_requires("cmake/[>=3.16 <4]") From ed9edf7bc58f5e5eeca054b3eadafe5f93da2583 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 19:34:42 +0000 Subject: [PATCH 15/29] Update recipes/dpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index e9f101e7c68e8..fc493b936d761 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -34,7 +34,7 @@ def requirements(self): self.requires("opus/1.4") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def build_requirements(self): From ec07a809b3a8d63699c08e49eb544162302848a6 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 19:35:03 +0000 Subject: [PATCH 16/29] Update recipes/dpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index fc493b936d761..0ec19de8cfe8d 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -63,6 +63,7 @@ def build(self): cmake.build() def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() From 2fba9854bd305534a8c65973e73b368a81cf1b83 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 19:35:17 +0000 Subject: [PATCH 17/29] Update recipes/dpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 0ec19de8cfe8d..5b30dd07f0725 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Git from conan.tools.files import download, unzip, get -required_conan_version = ">=1.65" +required_conan_version = ">=1.54" class DPPConan(ConanFile): name = "dpp" From 561ff95439cb9b710258ba5ec654371d1da5a676 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 19:39:02 +0000 Subject: [PATCH 18/29] revised from feedback --- recipes/dpp/all/conanfile.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 5b30dd07f0725..08ef542df760c 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -16,8 +16,6 @@ class DPPConan(ConanFile): description = "D++ is a lightweight and efficient library for Discord" topics = ("discord") settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False]} - default_options = {"shared": True} @property def _min_cppstd(self): @@ -41,10 +39,6 @@ def build_requirements(self): self.tool_requires("cmake/[>=3.16 <4]") def source(self): - #zip_name = "DPP.zip" - #download(self, f"https://github.com/brainboxdotcc/DPP/archive/refs/tags/v{self.version}.zip", zip_name) - #unzip(self, zip_name, '.', False, None, True) - #os.unlink(zip_name) get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): @@ -71,8 +65,6 @@ def package_info(self): self.cpp_info.libs = ["dpp"] self.cpp_info.includedirs = ["include/dpp-10.0"] self.cpp_info.libdirs = ["lib/dpp-10.0"] - def package_info(self): - self.cpp_info.libs = ["package_lib"] self.cpp_info.set_property("cmake_file_name", "dpp") self.cpp_info.set_property("cmake_target_name", "dpp::dpp") From 639a1b5adbfac90d3ea628c4b13b46a72b349229 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 19:46:04 +0000 Subject: [PATCH 19/29] import copy --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 08ef542df760c..88695e545a69d 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.scm import Git -from conan.tools.files import download, unzip, get +from conan.tools.files import download, unzip, get, copy required_conan_version = ">=1.54" From 8ec6683b09c17171571ee6144d47ce967cfb46c4 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 19:46:39 +0000 Subject: [PATCH 20/29] remove unused imports --- recipes/dpp/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 88695e545a69d..1f1328c3b993f 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -2,8 +2,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps -from conan.tools.scm import Git -from conan.tools.files import download, unzip, get, copy +from conan.tools.files import get, copy required_conan_version = ">=1.54" From 6a158355deef7d90a98406b6fbf75d3c2cf37851 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Tue, 29 Oct 2024 21:25:05 +0000 Subject: [PATCH 21/29] Update recipes/dpp/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Abril Rincón Blanco --- recipes/dpp/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 1f1328c3b993f..b6470216ded88 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -62,8 +62,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["dpp"] - self.cpp_info.includedirs = ["include/dpp-10.0"] - self.cpp_info.libdirs = ["lib/dpp-10.0"] self.cpp_info.set_property("cmake_file_name", "dpp") self.cpp_info.set_property("cmake_target_name", "dpp::dpp") From 07575d6a557aba94389f0145f8a83dc4ad6c09ed Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 21:34:18 +0000 Subject: [PATCH 22/29] enforce minimum compiler --- recipes/dpp/all/conanfile.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index b6470216ded88..46121cdd8fe46 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -1,5 +1,6 @@ import os from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.files import get, copy @@ -20,9 +21,24 @@ class DPPConan(ConanFile): def _min_cppstd(self): return 17 + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "14", + "clang": "10", + "gcc": "8", + "msvc": "191", + "Visual Studio": "16", + } + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def requirements(self): self.requires("nlohmann_json/3.11.2") From 5672fa85e2d436161abc726aacb49286d8dc8c32 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 21:37:21 +0000 Subject: [PATCH 23/29] workaround issue with AVX not working on neon --- recipes/dpp/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 46121cdd8fe46..360c6a2604f75 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -64,6 +64,7 @@ def generate(self): tc.cache_variables["BUILD_VOICE_SUPPORT"] = True tc.cache_variables["DPP_BUILD_TEST"] = False tc.cache_variables["BUILD_SHARED_LIBS"] = True + tc.cache_variables["AVX_TYPE"] = "AVX0" tc.generate() def build(self): From 3f129d9a71c48ca0fed7875d46025f6e0cb4ecc8 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 21:41:50 +0000 Subject: [PATCH 24/29] import Version --- recipes/dpp/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 360c6a2604f75..8aa87ee9273d2 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.files import get, copy +from conan.tools.scm import Version required_conan_version = ">=1.54" From a75bb5013a1b138fe3b7e8b80a057ba496e3893c Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 22:10:19 +0000 Subject: [PATCH 25/29] rm the pkgconfig and cmake find module after install --- recipes/dpp/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 8aa87ee9273d2..0c613ab0d6be7 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -3,7 +3,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps -from conan.tools.files import get, copy +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version required_conan_version = ">=1.54" @@ -77,6 +77,8 @@ def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.libs = ["dpp"] From ec9be85231c1fc66be47a79e0acdc5bf81a770cf Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 29 Oct 2024 23:16:29 +0000 Subject: [PATCH 26/29] on windows, we need the includedirs and subdirs for the lib to be found --- recipes/dpp/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 0c613ab0d6be7..7f1c7380cc0c5 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -84,4 +84,7 @@ def package_info(self): self.cpp_info.libs = ["dpp"] self.cpp_info.set_property("cmake_file_name", "dpp") self.cpp_info.set_property("cmake_target_name", "dpp::dpp") - + # On windows only, the headers and libs go into dpp-10.0 subdirectories. + if self.settings.os == "Windows": + self.cpp_info.includedirs = ["include/dpp-10.0"] + self.cpp_info.libdirs = ["lib/dpp-10.0"] From 45a753f6dc22e49d64873bf719b9f91d65a14457 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Wed, 30 Oct 2024 10:23:51 +0000 Subject: [PATCH 27/29] Update recipes/dpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/dpp/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index 7f1c7380cc0c5..f66af6c400e93 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -61,6 +61,8 @@ def generate(self): deps = CMakeDeps(self) deps.generate() tc = CMakeToolchain(self) + tc.cache_variables["DPP_NO_VCPKG"] = True + tc.cache_variables["DPP_USE_EXTERNAL_JSON"] = True tc.cache_variables["CONAN_EXPORTED"] = True tc.cache_variables["BUILD_VOICE_SUPPORT"] = True tc.cache_variables["DPP_BUILD_TEST"] = False From 8cb2999a78b871927c71e698ba427c3f43170d00 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Wed, 30 Oct 2024 10:24:06 +0000 Subject: [PATCH 28/29] Update recipes/dpp/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/dpp/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index f66af6c400e93..b47f00e90f99c 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -90,3 +90,6 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.includedirs = ["include/dpp-10.0"] self.cpp_info.libdirs = ["lib/dpp-10.0"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + self.cpp_info.defines = ["DPP_USE_EXTERNAL_JSON"] From 70740ce5d6fe2fe3305d32c1b9114ccb12b7ac4d Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Wed, 30 Oct 2024 12:00:59 +0000 Subject: [PATCH 29/29] transitive headers for nlohmann (fixes: 2.x) Co-authored-by: Uilian Ries --- recipes/dpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py index b47f00e90f99c..742a484eeee40 100644 --- a/recipes/dpp/all/conanfile.py +++ b/recipes/dpp/all/conanfile.py @@ -42,7 +42,7 @@ def validate(self): ) def requirements(self): - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.2", transitive_libs=True, transitive_headers=True) self.requires("openssl/[>=1.1 <4]") self.requires("zlib/[>=1.2.11 <2]") self.requires("opus/1.4")