aboutsummaryrefslogtreecommitdiff
path: root/conanfile.py
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-05-17 17:58:38 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-05-17 17:58:38 +0200
commit577fc0845718ed8ad5bebf02a277c0579a817f77 (patch)
tree3d1cdc53c426a0ba60a7996619a7b787850bb3b3 /conanfile.py
parentde5bf7ca3b7a2bf6be35b86486b00dc6a071b950 (diff)
downloadwanda-577fc0845718ed8ad5bebf02a277c0579a817f77.tar.xz
wanda-577fc0845718ed8ad5bebf02a277c0579a817f77.zip
wanda: restructure source layoutHEADdevelop
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py117
1 files changed, 25 insertions, 92 deletions
diff --git a/conanfile.py b/conanfile.py
index ef5d671..262fd55 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -7,25 +7,26 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
class Wanda(ConanFile):
name = "wanda"
- version = "1.0.0"
+ version = "2.0.0"
url = "https://github.com/fmorgner/wanda"
license = "BSD 3-clause"
- description = "A wallpaper changer for the GNOME"
- package_type = "library"
- scm = {
- "type": "git",
- "url": "auto",
- "revision": "auto",
- }
- generators = ("CMakeDeps",)
+ description = "A simple wallpaper changer for Linux desktops"
+ test_requires = ("catch2/[>=3.4]",)
+ tool_requires = (
+ "cmake/[>=3.27]",
+ "ninja/[>=1.12]",
+ )
options = {
- "nolibs": [True, False],
"shared": [True, False],
}
default_options = {
- "nolibs": False,
"shared": False,
+ "boost/*:asio_no_deprecated": True,
+ "boost/*:header_only": True,
+ "boost/*:system_no_deprecated": True,
+ "spdlog/*:header_only": True,
}
+ generators = ("CMakeDeps",)
settings = (
"os",
"arch",
@@ -33,24 +34,6 @@ class Wanda(ConanFile):
"build_type",
)
exports_sources = ("source/*",)
- test_requires = ("catch2/[>=3.4]",)
- tool_requires = (
- "cmake/[>=3.27]",
- "ninja/[>=1.12]",
- )
-
- def requirements(self):
- self.requires("boost/[~1.85]", transitive_headers=not self.options.nolibs, options={
- "asio_no_deprecated": True,
- "system_no_deprecated": True,
- "header_only": True,
- })
- self.requires("libjpeg-turbo/[~3.0]")
- self.requires("libpng/[~1.6]")
- self.requires("lyra/[~1.6]")
- self.requires("spdlog/[~1.14]", transitive_headers=not self.options.nolibs, options={
- "header_only": True,
- })
def build(self):
cmake = CMake(self)
@@ -58,17 +41,12 @@ class Wanda(ConanFile):
cmake.build()
cmake.test(env="CTEST_OUTPUT_ON_FAILURE=1")
- def configure(self):
- if self.options.nolibs:
- self.package_type = "application"
-
def generate(self):
toolchain = CMakeToolchain(self)
toolchain.variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = True
toolchain.variables["WANDA_DESCRIPTION"] = self.description
toolchain.variables["WANDA_HOMEPAGE_URL"] = self.url
toolchain.variables["WANDA_VERSION"] = self.version
- toolchain.variables["WANDA_APPLICATIONS_ONLY"] = self.options.nolibs
toolchain.generate()
def layout(self):
@@ -79,66 +57,21 @@ class Wanda(ConanFile):
cmake.install()
def package_info(self):
- self.runenv_info.prepend_path("PATH", os.path.join(self.package_folder, "bin"))
-
- if self.options.nolibs:
- return
-
- self.cpp_info.components["control"].libs = ["wanda-control"]
- self.cpp_info.components["control"].requires = [
- "meta",
- "proto",
- "std_ext",
- "system",
- # requires
- "boost::headers",
- "spdlog::spdlog",
- ]
-
- self.cpp_info.components["meta"].libs = []
-
- self.cpp_info.components["proto"].libs = ["wanda-proto"]
- self.cpp_info.components["proto"].requires = ["spdlog::spdlog",]
-
- self.cpp_info.components["std_ext"].libs = []
-
- self.cpp_info.components["system"].libs = ["wanda-system"]
- self.cpp_info.components["system"].requires = [
- "meta",
- "std_ext",
- # requires
- "boost::headers",
- "libjpeg-turbo::jpeg",
- "libpng::libpng",
- "spdlog::spdlog",
- ]
-
- self.cpp_info.components["wandac"].libs = []
- self.cpp_info.components["wandac"].requires = [
- "control",
- "proto",
- "system",
- # requires
- "lyra::lyra",
- "spdlog::spdlog",
- ]
- self.cpp_info.components["wandac"].bindirs = [
- os.path.join(self.package_folder, "bin")
+ self.cpp_info.libs = ["wanda"]
+ self.cpp_info.system_libs = [
+ "gio-2.0",
+ "glib-2.0",
+ "gobject-2.0",
+ "magic",
]
+ self.runenv_info.prepend_path("PATH", os.path.join(self.package_folder, "bin"))
- self.cpp_info.components["wandad"].libs = []
- self.cpp_info.components["wandad"].requires = [
- "control",
- "proto",
- "std_ext",
- "system",
- # requires
- "lyra::lyra",
- "spdlog::spdlog",
- ]
- self.cpp_info.components["wandad"].bindirs = [
- os.path.join(self.package_folder, "bin")
- ]
+ def requirements(self):
+ self.requires("boost/[~1.85]", transitive_headers=True)
+ self.requires("libjpeg-turbo/[~3.0]", transitive_libs=True)
+ self.requires("libpng/[~1.6]", transitive_libs=True)
+ self.requires("lyra/[~1.6]", transitive_libs=True)
+ self.requires("spdlog/[~1.14]", transitive_headers=True)
def validate(self):
check_min_cppstd(self, "20")