[DO-981] qt package (!15)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15
This commit is contained in:
51
recipes/xkeyboard-config/all/conanfile.py
Normal file
51
recipes/xkeyboard-config/all/conanfile.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.gnu import PkgConfig
|
||||
from conan.tools.system import package_manager
|
||||
from conan.errors import ConanInvalidConfiguration
|
||||
|
||||
required_conan_version = ">=1.50.0"
|
||||
|
||||
|
||||
class XkeyboardConfigConan(ConanFile):
|
||||
name = "xkeyboard-config"
|
||||
package_type = "application"
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
license = "MIT"
|
||||
homepage = "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/"
|
||||
description = "The non-arch keyboard configuration database for X Window."
|
||||
settings = "os", "compiler", "build_type" # no arch here, because the xkeyboard-config system package is arch independant
|
||||
topics = ("x11", "xorg", "keyboard")
|
||||
|
||||
def validate(self):
|
||||
if self.settings.os not in ["Linux", "FreeBSD"]:
|
||||
raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD")
|
||||
|
||||
def package_id(self):
|
||||
self.info.clear()
|
||||
|
||||
def system_requirements(self):
|
||||
apt = package_manager.Apt(self)
|
||||
apt.install(["xkb-data"], update=True, check=True)
|
||||
|
||||
yum = package_manager.Yum(self)
|
||||
yum.install(["xkeyboard-config-devel"], update=True, check=True)
|
||||
|
||||
dnf = package_manager.Dnf(self)
|
||||
dnf.install(["xkeyboard-config-devel"], update=True, check=True)
|
||||
|
||||
zypper = package_manager.Zypper(self)
|
||||
zypper.install(["xkeyboard-config"], update=True, check=True)
|
||||
|
||||
pacman = package_manager.PacMan(self)
|
||||
pacman.install(["xkeyboard-config"], update=True, check=True)
|
||||
|
||||
package_manager.Pkg(self).install(["xkeyboard-config"], update=True, check=True)
|
||||
|
||||
def package_info(self):
|
||||
pkg_config = PkgConfig(self, "xkeyboard-config")
|
||||
pkg_config.fill_cpp_info(
|
||||
self.cpp_info, is_system=self.settings.os != "FreeBSD")
|
||||
self.cpp_info.set_property("pkg_config_name", "xkeyboard-config")
|
||||
self.cpp_info.set_property("component_version", pkg_config.version)
|
||||
self.cpp_info.set_property("pkg_config_custom_content",
|
||||
"\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"]))
|
||||
@@ -0,0 +1 @@
|
||||
. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuildenv-release-x86_64.sh"
|
||||
@@ -0,0 +1,18 @@
|
||||
script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan"
|
||||
echo "echo Restoring environment" > "$script_folder/deactivate_conanbuildenv-release-x86_64.sh"
|
||||
for v in CXX CC CONAN_V2_MODE
|
||||
do
|
||||
is_defined="true"
|
||||
value=$(printenv $v) || is_defined="" || true
|
||||
if [ -n "$value" ] || [ -n "$is_defined" ]
|
||||
then
|
||||
echo export "$v='$value'" >> "$script_folder/deactivate_conanbuildenv-release-x86_64.sh"
|
||||
else
|
||||
echo unset $v >> "$script_folder/deactivate_conanbuildenv-release-x86_64.sh"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
export CXX="x86_64-linux-gnu-g++-12"
|
||||
export CC="x86_64-linux-gnu-gcc-12"
|
||||
export CONAN_V2_MODE="true"
|
||||
@@ -0,0 +1 @@
|
||||
. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrunenv-release-x86_64.sh"
|
||||
@@ -0,0 +1,14 @@
|
||||
script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan"
|
||||
echo "echo Restoring environment" > "$script_folder/deactivate_conanrunenv-release-x86_64.sh"
|
||||
for v in
|
||||
do
|
||||
is_defined="true"
|
||||
value=$(printenv $v) || is_defined="" || true
|
||||
if [ -n "$value" ] || [ -n "$is_defined" ]
|
||||
then
|
||||
echo export "$v='$value'" >> "$script_folder/deactivate_conanrunenv-release-x86_64.sh"
|
||||
else
|
||||
echo unset $v >> "$script_folder/deactivate_conanrunenv-release-x86_64.sh"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuildenv-release-x86_64.sh"
|
||||
@@ -0,0 +1,4 @@
|
||||
echo Restoring environment
|
||||
unset CXX
|
||||
unset CC
|
||||
unset CONAN_V2_MODE
|
||||
@@ -0,0 +1 @@
|
||||
. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanrunenv-release-x86_64.sh"
|
||||
@@ -0,0 +1,8 @@
|
||||
prefix=/home/aleksandr.vodyanov/.conan2/p/b/xkeybfb432262e432a/p
|
||||
bindir=${prefix}/bin
|
||||
xkb_base=/usr/share/X11/xkb
|
||||
datadir=/usr/share
|
||||
|
||||
Name: xkeyboard-config
|
||||
Description: Conan package: xkeyboard-config
|
||||
Version: system
|
||||
23
recipes/xkeyboard-config/all/test_package/conanfile.py
Normal file
23
recipes/xkeyboard-config/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.gnu import PkgConfigDeps
|
||||
from conan.tools.layout import basic_layout
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
generators = "VirtualBuildEnv", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
basic_layout(self)
|
||||
|
||||
def generate(self):
|
||||
pkg_config_deps = PkgConfigDeps(self)
|
||||
pkg_config_deps.generate()
|
||||
|
||||
def test(self):
|
||||
pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config")
|
||||
self.run(f"{pkg_config} --validate xkeyboard-config")
|
||||
Reference in New Issue
Block a user