Skip to content

Commit

Permalink
Add dbus only to Linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Tereius committed Aug 8, 2024
1 parent 7001a62 commit 091db13
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from conan.tools.cmake import CMake, CMakeToolchain
from conan.tools.files import patch, get
from conan.tools.env import VirtualBuildEnv
from conan.tools.system.package_manager import Apt
import json

required_conan_version = ">=2.0"
Expand Down Expand Up @@ -36,9 +37,7 @@ class QtKeychainConan(ConanFile):
default_options = {"shared": True,
"fPIC": True,
"qt/*:qtbase": True,
"qt/*:dbus": True,
"qt/*:qttools": True,
"qt/*:qtdbus": True,
"qt/*:qttranslations": True}

def validate(self):
Expand All @@ -49,9 +48,17 @@ def validate(self):
if str(self.settings.arch) not in valid_arch:
raise ConanInvalidConfiguration(f"{self.name} {self.version} is only supported for the following architectures on {self.settings.os}: {valid_arch}")

def system_requirements(self):
if self.settings.os == "Linux":
apt = Apt(self)
pack_names = [""]
apt.install(pack_names, update=True)

def configure(self):
if self.settings.os == "Linux":
self.options["qt"].dbus = True

def source(self):
#git = Git(self)
#git.run("clone https://github.com/frankosterfeld/qtkeychain.git --branch=%s --depth 1 --single-branch --no-tags --recurse-submodules --shallow-submodules --progress --jobs %u keychain" % (self.version, build_jobs(self)))
get(self, "https://github.com/frankosterfeld/qtkeychain/archive/refs/tags/%s.tar.gz" % self.version, destination="keychain", strip_root=True)
patch(self, base_path="keychain", patch_file="patches/android_so_names.patch")

Expand Down

0 comments on commit 091db13

Please sign in to comment.