Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new package: dpp 10.0.34 #25745

Merged
merged 29 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
91bd2bf
initial conan commit for dpp
braindigitalis Oct 27, 2024
5356f80
fix
braindigitalis Oct 28, 2024
f532aa7
fix
braindigitalis Oct 28, 2024
a0bf746
test package
braindigitalis Oct 29, 2024
f4d52d9
fix: specify minimum cmake version
braindigitalis Oct 29, 2024
3118c55
change to 1.6
braindigitalis Oct 29, 2024
8a86dc9
we dont support users messing with fPIC
braindigitalis Oct 29, 2024
3b28c35
homepage, url
braindigitalis Oct 29, 2024
62e4083
package_type
braindigitalis Oct 29, 2024
a4599df
conandata
braindigitalis Oct 29, 2024
5b518bd
add get
braindigitalis Oct 29, 2024
4bad8ab
Update recipes/dpp/all/conandata.yml
braindigitalis Oct 29, 2024
2568ae8
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 29, 2024
98fc0a7
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 29, 2024
ed9edf7
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 29, 2024
ec07a80
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 29, 2024
2fba985
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 29, 2024
561ff95
revised from feedback
braindigitalis Oct 29, 2024
639a1b5
import copy
braindigitalis Oct 29, 2024
8ec6683
remove unused imports
braindigitalis Oct 29, 2024
6a15835
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 29, 2024
07575d6
enforce minimum compiler
braindigitalis Oct 29, 2024
5672fa8
workaround issue with AVX not working on neon
braindigitalis Oct 29, 2024
3f129d9
import Version
braindigitalis Oct 29, 2024
a75bb50
rm the pkgconfig and cmake find module after install
braindigitalis Oct 29, 2024
ec9be85
on windows, we need the includedirs and subdirs for the lib to be found
braindigitalis Oct 29, 2024
45a753f
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 30, 2024
8cb2999
Update recipes/dpp/all/conanfile.py
braindigitalis Oct 30, 2024
70740ce
transitive headers for nlohmann (fixes: 2.x)
braindigitalis Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions recipes/dpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sources:
"10.0.34":
url:
- "https://github.com/brainboxdotcc/DPP/archive/refs/tags/v10.0.34.zip"
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
sha256: "944dcaa19638ff88feceae2f543662675eb8aceb59458ad369edc28819e05054"
95 changes: 95 additions & 0 deletions recipes/dpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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, rmdir
from conan.tools.scm import Version

required_conan_version = ">=1.54"

class DPPConan(ConanFile):
name = "dpp"
license = "Apache-2.0"
package_type = "shared-library"
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
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"

@property
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", transitive_libs=True, transitive_headers=True)
self.requires("openssl/[>=1.1 <4]")
self.requires("zlib/[>=1.2.11 <2]")
self.requires("opus/1.4")

def layout(self):
cmake_layout(self, src_folder="src")


def build_requirements(self):
self.tool_requires("cmake/[>=3.16 <4]")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
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
tc.cache_variables["BUILD_SHARED_LIBS"] = True
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
tc.cache_variables["AVX_TYPE"] = "AVX0"
uilianries marked this conversation as resolved.
Show resolved Hide resolved
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
cmake.install()
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
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"]
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"]
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
elif self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs = ["pthread"]
self.cpp_info.defines = ["DPP_USE_EXTERNAL_JSON"]
8 changes: 8 additions & 0 deletions recipes/dpp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
26 changes: 26 additions & 0 deletions recipes/dpp/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -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")
5 changes: 5 additions & 0 deletions recipes/dpp/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <dpp/dpp.h>

int main() {
dpp::cluster test_cluster("");
}
3 changes: 3 additions & 0 deletions recipes/dpp/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"10.0.34":
folder: all