[DO-973] harfbuzz package (!10)

Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech>
Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/10
This commit is contained in:
Aleksandr Vodyanov
2024-12-26 12:02:17 +03:00
parent 39afe6a1dd
commit c807f2514e
126 changed files with 6604 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
sources:
"2.40.2":
url: "https://nexus.avroid.tech/repository/all-raw-proxy-kernel_org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.2.tar.xz"
sha256: "d78b37a66f5922d70edf3bdfb01a6b33d34ed3c3cafd6628203b2a2b67c8e8b3"
"2.39.2":
url: "https://nexus.avroid.tech/repository/all-raw-proxy-kernel_org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.2.tar.xz"
sha256: "87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f"
"2.39":
url: "https://nexus.avroid.tech/repository/all-raw-proxy-kernel_org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.tar.xz"
sha256: "32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb"
"2.36.2":
url: "https://nexus.avroid.tech/repository/all-raw-proxy-kernel_org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.2.tar.xz"
sha256: "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f"
"2.36":
url: "https://nexus.avroid.tech/repository/all-raw-proxy-kernel_org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.tar.xz"
sha256: "9e4b1c67eb13b9b67feb32ae1dc0d50e08ce9e5d82e1cccd0ee771ad2fa9e0b1"

View File

@@ -0,0 +1,82 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import copy, get, rm, rmdir
from conan.tools.gnu import Autotools, AutotoolsToolchain
from conan.tools.layout import basic_layout
import os
required_conan_version = ">=1.53.0"
class LibmountConan(ConanFile):
name = "libmount"
description = (
"The libmount library is used to parse /etc/fstab, /etc/mtab and "
"/proc/self/mountinfo files, manage the mtab file, evaluate mount options, etc"
)
topics = ("mount", "linux", "util-linux")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
license = "LGPL-2.1-or-later"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}
def configure(self):
if self.options.shared:
del self.options.fPIC
self.settings.rm_safe("compiler.libcxx")
self.settings.rm_safe("compiler.cppstd")
def layout(self):
basic_layout(self, src_folder="src")
def validate(self):
if self.settings.os != "Linux":
raise ConanInvalidConfiguration(f"{self.ref} only supports Linux")
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = AutotoolsToolchain(self)
tc.configure_args.extend([
"--disable-all-programs",
"--enable-libmount",
"--enable-libblkid",
])
tc.generate()
def build(self):
autotools = Autotools(self)
autotools.configure()
autotools.make()
def package(self):
copy(self, "COPYING", src=os.path.join(self.source_folder, "libmount"), dst=os.path.join(self.package_folder, "licenses"))
copy(self, "COPYING.LGPL-2.1-or-later", src=os.path.join(self.source_folder, "Documentation", "licenses"), dst=os.path.join(self.package_folder, "licenses"))
autotools = Autotools(self)
autotools.install()
rmdir(self, os.path.join(self.package_folder, "sbin"))
rmdir(self, os.path.join(self.package_folder, "share"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "usr"))
rm(self, "*.la", os.path.join(self.package_folder, "lib"))
def package_info(self):
self.cpp_info.components["libblkid"].libs = ["blkid"]
self.cpp_info.components["libblkid"].set_property("pkg_config_name", "blkid")
self.cpp_info.components["libmount"].libs = ["mount"]
self.cpp_info.components["libmount"].system_libs = ["rt"]
self.cpp_info.components["libmount"].includedirs.append(os.path.join("include", "libmount"))
self.cpp_info.components["libmount"].set_property("pkg_config_name", "mount")
self.cpp_info.components["libmount"].requires = ["libblkid"]

View File

@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES C)
find_package(libmount REQUIRED CONFIG)
add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(${PROJECT_NAME} PRIVATE libmount::libmount)

View File

@@ -0,0 +1,9 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json"
]
}

View File

@@ -0,0 +1,26 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"
def layout(self):
cmake_layout(self)
def requirements(self):
self.requires(self.tested_reference_str)
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.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")

View File

@@ -0,0 +1,16 @@
#include <libmount/libmount.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
struct libmnt_context *ctx = mnt_new_context();
if (!ctx) {
printf("failed to initialize libmount\n");
return EXIT_FAILURE;
}
printf("path to fstab: %s", mnt_get_fstab_path());
mnt_free_context(ctx);
return EXIT_SUCCESS;
}

View File

@@ -0,0 +1,11 @@
versions:
"2.40.2":
folder: all
"2.39.2":
folder: all
"2.39":
folder: all
"2.36.2":
folder: all
"2.36":
folder: all