From c807f2514ec54f7cde1097fda87b5b2278d28015 Mon Sep 17 00:00:00 2001 From: Aleksandr Vodyanov Date: Thu, 26 Dec 2024 12:02:17 +0300 Subject: [PATCH] [DO-973] harfbuzz package (!10) Co-authored-by: aleksandr.vodyanov Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/10 --- recipes/flex/all/conandata.yml | 10 + recipes/flex/all/conanfile.py | 99 ++++ .../all/patches/darwin-newer-versions.patch | 13 + recipes/flex/all/test_package/CMakeLists.txt | 9 + .../all/test_package/CMakeUserPresets.json | 9 + recipes/flex/all/test_package/basic_nr.l | 89 +++ recipes/flex/all/test_package/basic_nr.txt | 6 + recipes/flex/all/test_package/conanfile.py | 50 ++ recipes/flex/config.yml | 3 + recipes/glib/all/conandata.yml | 33 ++ recipes/glib/all/conanfile.py | 299 ++++++++++ .../dont-use-python-packaging-2.81.0.patch | 148 +++++ .../glib/all/patches/libintl-discovery.patch | 49 ++ .../all/patches/remove-distutils-2.77.0.patch | 51 ++ .../glib/all/patches/remove-distutils.patch | 51 ++ recipes/glib/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/glib/all/test_package/conanfile.py | 28 + recipes/glib/all/test_package/test_package.c | 26 + recipes/glib/config.yml | 9 + recipes/harfbuzz/all/conandata.yml | 31 ++ recipes/harfbuzz/all/conanfile.py | 226 ++++++++ .../0000-fix-freetype-lookup-5.1.0.patch | 72 +++ .../harfbuzz/all/test_package/CMakeLists.txt | 8 + .../all/test_package/CMakeUserPresets.json | 10 + .../harfbuzz/all/test_package/conanfile.py | 27 + .../harfbuzz/all/test_package/test_package.c | 9 + .../all/test_v1_package/CMakeLists.txt | 8 + .../harfbuzz/all/test_v1_package/conanfile.py | 18 + recipes/harfbuzz/config.yml | 17 + recipes/libelf/all/CMakeLists.txt | 31 ++ recipes/libelf/all/conandata.yml | 4 + recipes/libelf/all/conanfile.py | 119 ++++ .../libelf/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/libelf/all/test_package/conanfile.py | 26 + .../libelf/all/test_package/test_package.c | 114 ++++ recipes/libelf/config.yml | 3 + recipes/libffi/all/conandata.yml | 30 ++ recipes/libffi/all/conanfile.py | 169 ++++++ .../patches/0002-3.3-fix-libtool-path.patch | 20 + .../patches/0002-3.4.3-fix-libtool-path.patch | 20 + .../patches/0002-3.4.6-fix-libtool-path.patch | 20 + .../0004-3.3-fix-complex-type-msvc.patch | 56 ++ .../0004-3.4.6-fix-complex-type-msvc.patch | 56 ++ ...raries-to-arch-dependent-directories.patch | 11 + ...raries-to-arch-dependent-directories.patch | 13 + .../0006-3.3-library-no-version-suffix.patch | 11 + ...0006-3.4.4-library-no-version-suffix.patch | 13 + ...0006-3.4.6-library-no-version-suffix.patch | 13 + ...-forward-declare-open_temp_exec_file.patch | 30 ++ .../libffi/all/test_package/CMakeLists.txt | 8 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/libffi/all/test_package/conanfile.py | 37 ++ .../libffi/all/test_package/test_package.c | 99 ++++ .../libffi/all/test_v1_package/CMakeLists.txt | 11 + .../libffi/all/test_v1_package/conanfile.py | 17 + recipes/libffi/config.yml | 7 + recipes/libgettext/all/conandata.yml | 25 + recipes/libgettext/all/conanfile.py | 239 ++++++++ ...001-build-Fix-build-errors-with-MSVC.patch | 362 +++++++++++++ ...emmove-is-intrinsic-function-on-MSVC.patch | 72 +++ ...eported-by-Gabor-Z.-Papp-gzp-papp.hu.patch | 29 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 9 + .../libgettext/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.c | 8 + recipes/libgettext/config.yml | 7 + recipes/libmount/all/conandata.yml | 16 + recipes/libmount/all/conanfile.py | 82 +++ .../libmount/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 9 + .../libmount/all/test_package/conanfile.py | 26 + .../libmount/all/test_package/test_package.c | 16 + recipes/libmount/config.yml | 11 + recipes/libselinux/all/conandata.yml | 64 +++ recipes/libselinux/all/conanfile.py | 139 +++++ .../all/patches/0001-fix-fno-common-2.9.patch | 507 +++++++++++++++++ .../all/patches/0001-fix-fno-common-3.0.patch | 510 ++++++++++++++++++ .../0002-remove-cil_mem_error_handler.patch | 45 ++ .../all/patches/0003-fix-link-pcre.patch | 11 + .../0003-fix-missing-include-3.6.patch | 10 + ...-Makefile-fix-reallocarray-detection.patch | 48 ++ ...inux-libsepol-Add-CFLAGS-and-LDFLAGS.patch | 61 +++ .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 9 + .../libselinux/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 11 + recipes/libselinux/config.yml | 15 + recipes/m4/all/conandata.yml | 23 + recipes/m4/all/conanfile.py | 135 +++++ ...adjust-to-glibc-2.28-libio.h-removal.patch | 170 ++++++ ...e-more-paranoid-about-libio.h-change.patch | 156 ++++++ .../all/patches/1.4.18-0004-fix-checks.patch | 35 ++ ...4.18-0005-vasnprintf-Fix-for-MSVC-14.patch | 124 +++++ ...8-0006-manywarnings-update-for-gcc-7.patch | 50 ++ ...-0007-vasnprintf-port-to-macos-10.13.patch | 47 ++ ....4.18-0008-open-files-in-binary-mode.patch | 15 + ....18-0009-disable-hardening-in-source.patch | 16 + ....18-0010-c-stack-stop-using-SIGSTKSZ.patch | 106 ++++ ....4.19-0001-open-files-in-binary-mode.patch | 15 + .../m4/all/patches/1.4.19-0002-ar-lib.patch | 276 ++++++++++ .../1.4.19-0003-msvc-debug-assertion.patch | 31 ++ ....19-0004-disable-hardening-in-source.patch | 16 + recipes/m4/all/test_package/conanbuild.sh | 1 + .../conanbuildenv-release-x86_64.sh | 20 + recipes/m4/all/test_package/conanfile.py | 14 + recipes/m4/all/test_package/conanrun.sh | 1 + .../conanrunenv-release-x86_64.sh | 14 + .../all/test_package/deactivate_conanbuild.sh | 1 + ...deactivate_conanbuildenv-release-x86_64.sh | 6 + .../all/test_package/deactivate_conanrun.sh | 1 + recipes/m4/config.yml | 5 + recipes/pcre2/all/conandata.yml | 76 +++ recipes/pcre2/all/conanfile.py | 221 ++++++++ .../all/patches/0001-fix-cmake-1.32.patch | 17 + .../all/patches/0001-fix-cmake-1.33.patch | 14 + .../all/patches/0001-fix-cmake-1.35.patch | 14 + .../all/patches/0001-fix-cmake-1.36.patch | 14 + .../all/patches/0001-fix-cmake-1.39.patch | 15 + .../all/patches/0002-fix-cmake-c-std.patch | 52 ++ recipes/pcre2/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/pcre2/all/test_package/conanfile.py | 26 + recipes/pcre2/all/test_package/test_package.c | 34 ++ recipes/pcre2/config.yml | 21 + 126 files changed, 6604 insertions(+) create mode 100644 recipes/flex/all/conandata.yml create mode 100644 recipes/flex/all/conanfile.py create mode 100644 recipes/flex/all/patches/darwin-newer-versions.patch create mode 100644 recipes/flex/all/test_package/CMakeLists.txt create mode 100644 recipes/flex/all/test_package/CMakeUserPresets.json create mode 100644 recipes/flex/all/test_package/basic_nr.l create mode 100644 recipes/flex/all/test_package/basic_nr.txt create mode 100644 recipes/flex/all/test_package/conanfile.py create mode 100644 recipes/flex/config.yml create mode 100644 recipes/glib/all/conandata.yml create mode 100644 recipes/glib/all/conanfile.py create mode 100644 recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch create mode 100644 recipes/glib/all/patches/libintl-discovery.patch create mode 100644 recipes/glib/all/patches/remove-distutils-2.77.0.patch create mode 100644 recipes/glib/all/patches/remove-distutils.patch create mode 100644 recipes/glib/all/test_package/CMakeLists.txt create mode 100644 recipes/glib/all/test_package/CMakeUserPresets.json create mode 100644 recipes/glib/all/test_package/conanfile.py create mode 100644 recipes/glib/all/test_package/test_package.c create mode 100644 recipes/glib/config.yml create mode 100644 recipes/harfbuzz/all/conandata.yml create mode 100644 recipes/harfbuzz/all/conanfile.py create mode 100644 recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch create mode 100644 recipes/harfbuzz/all/test_package/CMakeLists.txt create mode 100644 recipes/harfbuzz/all/test_package/CMakeUserPresets.json create mode 100644 recipes/harfbuzz/all/test_package/conanfile.py create mode 100644 recipes/harfbuzz/all/test_package/test_package.c create mode 100644 recipes/harfbuzz/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/harfbuzz/all/test_v1_package/conanfile.py create mode 100644 recipes/harfbuzz/config.yml create mode 100644 recipes/libelf/all/CMakeLists.txt create mode 100644 recipes/libelf/all/conandata.yml create mode 100644 recipes/libelf/all/conanfile.py create mode 100644 recipes/libelf/all/test_package/CMakeLists.txt create mode 100644 recipes/libelf/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libelf/all/test_package/conanfile.py create mode 100644 recipes/libelf/all/test_package/test_package.c create mode 100644 recipes/libelf/config.yml create mode 100644 recipes/libffi/all/conandata.yml create mode 100644 recipes/libffi/all/conanfile.py create mode 100644 recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch create mode 100644 recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch create mode 100644 recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0006-3.4.4-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch create mode 100644 recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch create mode 100644 recipes/libffi/all/test_package/CMakeLists.txt create mode 100644 recipes/libffi/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libffi/all/test_package/conanfile.py create mode 100644 recipes/libffi/all/test_package/test_package.c create mode 100644 recipes/libffi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libffi/all/test_v1_package/conanfile.py create mode 100644 recipes/libffi/config.yml create mode 100644 recipes/libgettext/all/conandata.yml create mode 100644 recipes/libgettext/all/conanfile.py create mode 100644 recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch create mode 100644 recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch create mode 100644 recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch create mode 100644 recipes/libgettext/all/test_package/CMakeLists.txt create mode 100644 recipes/libgettext/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libgettext/all/test_package/conanfile.py create mode 100644 recipes/libgettext/all/test_package/test_package.c create mode 100644 recipes/libgettext/config.yml create mode 100644 recipes/libmount/all/conandata.yml create mode 100644 recipes/libmount/all/conanfile.py create mode 100644 recipes/libmount/all/test_package/CMakeLists.txt create mode 100644 recipes/libmount/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libmount/all/test_package/conanfile.py create mode 100644 recipes/libmount/all/test_package/test_package.c create mode 100644 recipes/libmount/config.yml create mode 100644 recipes/libselinux/all/conandata.yml create mode 100644 recipes/libselinux/all/conanfile.py create mode 100644 recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch create mode 100644 recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch create mode 100644 recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch create mode 100644 recipes/libselinux/all/patches/0003-fix-link-pcre.patch create mode 100644 recipes/libselinux/all/patches/0003-fix-missing-include-3.6.patch create mode 100644 recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch create mode 100644 recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch create mode 100644 recipes/libselinux/all/test_package/CMakeLists.txt create mode 100644 recipes/libselinux/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libselinux/all/test_package/conanfile.py create mode 100644 recipes/libselinux/all/test_package/test_package.c create mode 100644 recipes/libselinux/config.yml create mode 100644 recipes/m4/all/conandata.yml create mode 100644 recipes/m4/all/conanfile.py create mode 100644 recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch create mode 100644 recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch create mode 100644 recipes/m4/all/patches/1.4.18-0004-fix-checks.patch create mode 100644 recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch create mode 100644 recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch create mode 100644 recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch create mode 100644 recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch create mode 100644 recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch create mode 100644 recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch create mode 100644 recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch create mode 100644 recipes/m4/all/patches/1.4.19-0002-ar-lib.patch create mode 100644 recipes/m4/all/patches/1.4.19-0003-msvc-debug-assertion.patch create mode 100644 recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch create mode 100644 recipes/m4/all/test_package/conanbuild.sh create mode 100644 recipes/m4/all/test_package/conanbuildenv-release-x86_64.sh create mode 100644 recipes/m4/all/test_package/conanfile.py create mode 100644 recipes/m4/all/test_package/conanrun.sh create mode 100644 recipes/m4/all/test_package/conanrunenv-release-x86_64.sh create mode 100644 recipes/m4/all/test_package/deactivate_conanbuild.sh create mode 100644 recipes/m4/all/test_package/deactivate_conanbuildenv-release-x86_64.sh create mode 100644 recipes/m4/all/test_package/deactivate_conanrun.sh create mode 100644 recipes/m4/config.yml create mode 100644 recipes/pcre2/all/conandata.yml create mode 100644 recipes/pcre2/all/conanfile.py create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch create mode 100644 recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch create mode 100644 recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch create mode 100644 recipes/pcre2/all/test_package/CMakeLists.txt create mode 100644 recipes/pcre2/all/test_package/CMakeUserPresets.json create mode 100644 recipes/pcre2/all/test_package/conanfile.py create mode 100644 recipes/pcre2/all/test_package/test_package.c create mode 100644 recipes/pcre2/config.yml diff --git a/recipes/flex/all/conandata.yml b/recipes/flex/all/conandata.yml new file mode 100644 index 0000000..7c728d2 --- /dev/null +++ b/recipes/flex/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.6.4": + sha256: "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995" + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz" +patches: + "2.6.4": + - patch_file: patches/darwin-newer-versions.patch + patch_description: "missing linker flags skipped due to a problem in configure." + patch_source: "https://github.com/westes/flex/issues/509" + patch_type: "portability" diff --git a/recipes/flex/all/conanfile.py b/recipes/flex/all/conanfile.py new file mode 100644 index 0000000..1a19a7b --- /dev/null +++ b/recipes/flex/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.files import get, rmdir, copy, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import AutotoolsToolchain, Autotools + +required_conan_version = ">=1.53.0" + + +class FlexConan(ConanFile): + name = "flex" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/westes/flex" + description = "Flex, the fast lexical analyzer generator" + topics = ("lex", "lexer", "lexical analyzer generator") + license = "BSD-2-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + # Flex requires M4 to be compiled. If consumer does not have M4 + # installed, Conan will need to know that Flex requires it. + self.requires("m4/1.4.19") + + def build_requirements(self): + self.tool_requires("m4/1.4.19") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires(f"{self.name}/{self.version}") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Flex package is not compatible with Windows. " + "Consider using winflexbison instead.") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def generate(self): + at = AutotoolsToolchain(self) + at.configure_args.extend([ + "--disable-nls", + "--disable-bootstrap", + "HELP2MAN=/bin/true", + "M4=m4", + # https://github.com/westes/flex/issues/247 + "ac_cv_func_malloc_0_nonnull=yes", "ac_cv_func_realloc_0_nonnull=yes", + # https://github.com/easybuilders/easybuild-easyconfigs/pull/5792 + "ac_cv_func_reallocarray=no", + ]) + at.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["fl"] + self.cpp_info.system_libs = ["m"] + # Avoid CMakeDeps messing with Conan targets + self.cpp_info.set_property("cmake_find_mode", "none") + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + lex_path = os.path.join(bindir, "flex").replace("\\", "/") + self.output.info("Setting LEX environment variable: {}".format(lex_path)) + self.env_info.LEX = lex_path diff --git a/recipes/flex/all/patches/darwin-newer-versions.patch b/recipes/flex/all/patches/darwin-newer-versions.patch new file mode 100644 index 0000000..d0a7b83 --- /dev/null +++ b/recipes/flex/all/patches/darwin-newer-versions.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index d88c47c..827c01a 100755 +--- a/configure ++++ b/configure +@@ -6842,7 +6842,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- 10.*) ++ *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; diff --git a/recipes/flex/all/test_package/CMakeLists.txt b/recipes/flex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..1c6f9d4 --- /dev/null +++ b/recipes/flex/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(FLEX REQUIRED) +flex_target(flex_scanner basic_nr.l ${PROJECT_BINARY_DIR}/basic_nr.cpp) + +add_executable(${PROJECT_NAME} basic_nr.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${FLEX_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLEX_LIBRARIES}) diff --git a/recipes/flex/all/test_package/CMakeUserPresets.json b/recipes/flex/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/flex/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/flex/all/test_package/basic_nr.l b/recipes/flex/all/test_package/basic_nr.l new file mode 100644 index 0000000..71fa5d6 --- /dev/null +++ b/recipes/flex/all/test_package/basic_nr.l @@ -0,0 +1,89 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +%option C++ noyywrap + +%{ +int mylineno = 0; +%} + +string \"[^\n"]+\" + +ws [ \t]+ + +alpha [A-Za-z] +dig [0-9] +name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* +num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? +num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? +number {num1}|{num2} + +%% + +{ws} /* skip blanks and tabs */ + +"/*" { + int c; + + while((c = yyinput()) != 0) + { + if(c == '\n') + ++mylineno; + + else if(c == '*') + { + if((c = yyinput()) == '/') + break; + else + unput(c); + } + } + } + +{number} std::cout << "number " << YYText() << '\n'; + +\n mylineno++; + +{name} std::cout << "name " << YYText() << '\n'; + +{string} std::cout << "string " << YYText() << '\n'; + +%% + +extern "C" { + int yylex() {return 0;} +} + +#include + +int main( int argc, const char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + std::ifstream ifs(argv[1]); + FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); + while(lexer->yylex() != 0) + ; + return 0; +} diff --git a/recipes/flex/all/test_package/basic_nr.txt b/recipes/flex/all/test_package/basic_nr.txt new file mode 100644 index 0000000..3dca798 --- /dev/null +++ b/recipes/flex/all/test_package/basic_nr.txt @@ -0,0 +1,6 @@ +/* this is a multi line comment +still in the comment +and done */ +foo = "bar" +num = 43 +setting = false diff --git a/recipes/flex/all/test_package/conanfile.py b/recipes/flex/all/test_package/conanfile.py new file mode 100644 index 0000000..4270466 --- /dev/null +++ b/recipes/flex/all/test_package/conanfile.py @@ -0,0 +1,50 @@ +import os +import re +from io import StringIO + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv", "CMakeDeps" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def _assert_expected_version(self): + + def tested_reference_version(): + tokens = re.split('[@#]', self.tested_reference_str) + return tokens[0].split("/", 1)[1] + + output = StringIO() + self.run("flex --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + expected_version = tested_reference_version() + self.output.info("Expected version: {}".format(expected_version)) + assert_flex_version = "flex {}".format(expected_version) + assert(assert_flex_version in output_str) + + def build(self): + # Let's check flex version installed + self._assert_expected_version() + 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") + txt_file = os.path.join(self.source_folder, "basic_nr.txt") + self.run(f"{bin_path} {txt_file}", env="conanrun") diff --git a/recipes/flex/config.yml b/recipes/flex/config.yml new file mode 100644 index 0000000..1d8c5a5 --- /dev/null +++ b/recipes/flex/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.4": + folder: all diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml new file mode 100644 index 0000000..19c544b --- /dev/null +++ b/recipes/glib/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "2.81.0": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/glib/2.81/glib-2.81.0.tar.xz" + sha256: "1665188ed9cc941c0a189dc6295e6859872523d1bfc84a5a84732a7ae87b02e4" + "2.78.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/glib/2.78/glib-2.78.3.tar.xz" + sha256: "609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21" + "2.77.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/glib/2.77/glib-2.77.3.tar.xz" + sha256: "1753f963bb680b28a83d6e2095f63d0d4b94244675bcd2603850b2ebc1ac6a61" + "2.76.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/glib/2.76/glib-2.76.3.tar.xz" + sha256: "c0be444e403d7c3184d1f394f89f0b644710b5e9331b54fa4e8b5037813ad32a" +patches: + "2.81.0": + - patch_file: "patches/dont-use-python-packaging-2.81.0.patch" + patch_type: bugfix + patch_description: replace package.version.Version by internal code + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + "2.78.3": + - patch_file: "patches/remove-distutils-2.77.0.patch" + patch_type: bugfix + patch_description: remove distutils + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4133 + "2.76.3": + - patch_file: "patches/libintl-discovery.patch" + patch_type: bugfix + patch_description: fix libintl discovery + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + - patch_file: "patches/remove-distutils.patch" + patch_type: bugfix + patch_description: remove distutils + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4133 diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py new file mode 100644 index 0000000..2881e1c --- /dev/null +++ b/recipes/glib/all/conanfile.py @@ -0,0 +1,299 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc +import os +import shutil + + +required_conan_version = ">=2.0" + + +class GLibConan(ConanFile): + name = "glib" + description = ( + "Low-level core library that forms the basis for projects such as GTK+ and GNOME. " + "It provides data structure handling for C, portability wrappers, and interfaces " + "for such runtime functionality as an event loop, threads, dynamic loading, and an object system." + ) + topics = "gio", "gmodule", "gnome", "gobject", "gtk" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.gnome.org/GNOME/glib" + license = "LGPL-2.1-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_elf": [True, False], + "with_selinux": [True, False], + "with_mount": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_elf": True, + "with_mount": True, + "with_selinux": True, + } + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux": + del self.options.with_mount + del self.options.with_selinux + if is_msvc(self): + del self.options.with_elf + + if self.settings.os == "Neutrino": + del self.options.with_elf + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libffi/3.4.4") + self.requires("pcre2/[>=10.42]") + if self.options.get_safe("with_elf"): + self.requires("libelf/0.8.13") + if self.options.get_safe("with_mount"): + self.requires("libmount/2.39.2") + if self.options.get_safe("with_selinux"): + self.requires("libselinux/3.6") + if self.settings.os != "Linux": + # for Linux, gettext is provided by libc + self.requires("libgettext/0.22", transitive_headers=True, transitive_libs=True) + + if is_apple_os(self): + self.requires("libiconv/1.17") + + def build_requirements(self): +# self.tool_requires("meson/[>=1.2.3 <2]") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = MesonToolchain(self) + + tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" + tc.project_options["libmount"] = "enabled" if self.options.get_safe("with_mount") else "disabled" + if self.settings.os == "FreeBSD" or self.settings.os == "Neutrino": + tc.project_options["xattr"] = "false" + tc.project_options["tests"] = "false" + tc.project_options["libelf"] = "enabled" if self.options.get_safe("with_elf") else "disabled" + + if self.settings.os == "Neutrino": + tc.cross_build["host"]["system"] = "qnx" + tc.c_link_args.append("-lm") + tc.c_link_args.append("-lsocket") + + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), + "subdir('fuzzing')", + "#subdir('fuzzing')", + ) # https://gitlab.gnome.org/GNOME/glib/-/issues/2152 + if self.settings.os != "Linux" and self.settings.os != "Neutrino": + # allow to find gettext + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), + "libintl = dependency('intl', required: false", + "libintl = dependency('libgettext', method : 'pkg-config', required : false", + ) + + replace_in_file(self, + os.path.join( + self.source_folder, + "gio", + "gdbus-2.0", + "codegen", + "gdbus-codegen.in", + ), + "'share'", + "'res'", + ) + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="LGPL-2.1-or-later.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "libexec")) + shutil.move( + os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res"), + ) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.components["glib-2.0"].set_property("pkg_config_name", "glib-2.0") + self.cpp_info.components["glib-2.0"].libs = ["glib-2.0"] + self.cpp_info.components["glib-2.0"].includedirs += [ + os.path.join("include", "glib-2.0"), + os.path.join("lib", "glib-2.0", "include") + ] + self.cpp_info.components["glib-2.0"].resdirs = ["res"] + + self.cpp_info.components["gmodule-no-export-2.0"].set_property("pkg_config_name", "gmodule-no-export-2.0") + self.cpp_info.components["gmodule-no-export-2.0"].libs = ["gmodule-2.0"] + self.cpp_info.components["gmodule-no-export-2.0"].resdirs = ["res"] + self.cpp_info.components["gmodule-no-export-2.0"].requires.append("glib-2.0") + + self.cpp_info.components["gmodule-export-2.0"].set_property("pkg_config_name", "gmodule-export-2.0") + self.cpp_info.components["gmodule-export-2.0"].requires += ["gmodule-no-export-2.0", "glib-2.0"] + + self.cpp_info.components["gmodule-2.0"].set_property("pkg_config_name", "gmodule-2.0") + self.cpp_info.components["gmodule-2.0"].requires += ["gmodule-no-export-2.0", "glib-2.0"] + + self.cpp_info.components["gobject-2.0"].set_property("pkg_config_name", "gobject-2.0") + self.cpp_info.components["gobject-2.0"].libs = ["gobject-2.0"] + self.cpp_info.components["gobject-2.0"].resdirs = ["res"] + self.cpp_info.components["gobject-2.0"].requires += ["glib-2.0", "libffi::libffi"] + + self.cpp_info.components["gthread-2.0"].set_property("pkg_config_name", "gthread-2.0") + self.cpp_info.components["gthread-2.0"].libs = ["gthread-2.0"] + self.cpp_info.components["gthread-2.0"].resdirs = ["res"] + self.cpp_info.components["gthread-2.0"].requires.append("glib-2.0") + + self.cpp_info.components["gio-2.0"].set_property("pkg_config_name", "gio-2.0") + self.cpp_info.components["gio-2.0"].libs = ["gio-2.0"] + self.cpp_info.components["gio-2.0"].resdirs = ["res"] + self.cpp_info.components["gio-2.0"].requires += ["glib-2.0", "gobject-2.0", "gmodule-2.0", "zlib::zlib"] + + self.cpp_info.components["gresource"].set_property("pkg_config_name", "gresource") + self.cpp_info.components["gresource"].libs = [] # this is actually an executable + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["glib-2.0"].system_libs.append("pthread") + self.cpp_info.components["gmodule-no-export-2.0"].system_libs.append("pthread") + self.cpp_info.components["gmodule-no-export-2.0"].system_libs.append("dl") + self.cpp_info.components["gmodule-export-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["gmodule-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["gthread-2.0"].system_libs.append("pthread") + self.cpp_info.components["gio-2.0"].system_libs.append("dl") + + if self.settings.os == "Neutrino": + self.cpp_info.components["gmodule-export-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["gmodule-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["glib-2.0"].system_libs.append("m") + self.cpp_info.components["glib-2.0"].system_libs.append("socket") + self.cpp_info.components["gmodule-no-export-2.0"].system_libs.append("c") + self.cpp_info.components["gio-2.0"].system_libs.append("c") + self.cpp_info.components["gio-2.0"].system_libs.append("socket") + + if self.settings.os == "Windows": + self.cpp_info.components["glib-2.0"].system_libs += ["ws2_32", "ole32", "shell32", "user32", "advapi32"] + self.cpp_info.components["gio-2.0"].system_libs.extend(["iphlpapi", "dnsapi", "shlwapi"]) + self.cpp_info.components["gio-windows-2.0"].set_property("pkg_config_name", "gio-windows-2.0") + self.cpp_info.components["gio-windows-2.0"].requires = ["gobject-2.0", "gmodule-no-export-2.0", "gio-2.0"] + self.cpp_info.components["gio-windows-2.0"].includedirs = [os.path.join("include", "gio-win32-2.0")] + else: + self.cpp_info.components["gio-unix-2.0"].set_property("pkg_config_name", "gio-unix-2.0") + self.cpp_info.components["gio-unix-2.0"].requires += ["gobject-2.0", "gio-2.0"] + self.cpp_info.components["gio-unix-2.0"].includedirs = [os.path.join("include", "gio-unix-2.0")] + + if self.settings.os == "Macos": + self.cpp_info.components["glib-2.0"].system_libs.append("resolv") + self.cpp_info.components["glib-2.0"].frameworks += ["Foundation", "CoreServices", "CoreFoundation"] + self.cpp_info.components["gio-2.0"].frameworks.append("AppKit") + + if is_apple_os(self): + self.cpp_info.components["glib-2.0"].requires.append("libiconv::libiconv") + + self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") + + if self.settings.os == "Linux": + self.cpp_info.components["gio-2.0"].system_libs.append("resolv") + else: + self.cpp_info.components["glib-2.0"].requires.append("libgettext::libgettext") + + if self.options.get_safe("with_mount"): + self.cpp_info.components["gio-2.0"].requires.append("libmount::libmount") + + if self.options.get_safe("with_selinux"): + self.cpp_info.components["gio-2.0"].requires.append("libselinux::libselinux") + + if self.options.get_safe("with_elf"): + self.cpp_info.components["gresource"].requires.append("libelf::libelf") # this is actually an executable + + self.env_info.GLIB_COMPILE_SCHEMAS = os.path.join(self.package_folder, "bin", "glib-compile-schemas") + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + + pkgconfig_variables = { + 'datadir': '${prefix}/res', + 'schemasdir': '${datadir}/glib-2.0/schemas', + 'bindir': '${prefix}/bin', + # Can't use libdir here as it is libdir1 when using the PkgConfigDeps generator. + 'giomoduledir': '${prefix}/lib/gio/modules', + 'gio': '${bindir}/gio', + 'gio_querymodules': '${bindir}/gio-querymodules', + 'glib_compile_schemas': '${bindir}/glib-compile-schemas', + 'glib_compile_resources': '${bindir}/glib-compile-resources', + 'gdbus': '${bindir}/gdbus', + 'gdbus_codegen': '${bindir}/gdbus-codegen', + 'gresource': '${bindir}/gresource', + 'gsettings': '${bindir}/gsettings' + } + self.cpp_info.components["gio-2.0"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) + + pkgconfig_variables = { + 'bindir': '${prefix}/bin', + 'glib_genmarshal': '${bindir}/glib-genmarshal', + 'gobject_query': '${bindir}/gobject-query', + 'glib_mkenums': '${bindir}/glib-mkenums' + } + self.cpp_info.components["glib-2.0"].set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch b/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch new file mode 100644 index 0000000..a97c9a7 --- /dev/null +++ b/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch @@ -0,0 +1,148 @@ +diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in +index 9c409e6..1913b6d 100755 +--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in ++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # GDBus - GLib D-Bus Library + # +diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build +index 67ea9f2..2ee1fc8 100644 +--- a/gio/gdbus-2.0/codegen/meson.build ++++ b/gio/gdbus-2.0/codegen/meson.build +@@ -31,7 +31,7 @@ gdbus_codegen_conf = configuration_data() + gdbus_codegen_conf.set('VERSION', glib_version) + gdbus_codegen_conf.set('MAJOR_VERSION', major_version) + gdbus_codegen_conf.set('MINOR_VERSION', minor_version) +-gdbus_codegen_conf.set('PYTHON', python.full_path()) ++gdbus_codegen_conf.set('PYTHON', python_name) + gdbus_codegen_conf.set('DATADIR', glib_datadir) + + # Install gdbus-codegen executable +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 6399945..86024d7 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -21,10 +21,9 @@ + # + # Author: David Zeuthen + +-import packaging.version + import os + import sys +- ++import re + + # pylint: disable=too-few-public-methods + class Color: +@@ -161,11 +160,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (packaging.version.Version(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] +diff --git a/glib/gtester-report.in b/glib/gtester-report.in +index 0745d53..b8291d2 100644 +--- a/glib/gtester-report.in ++++ b/glib/gtester-report.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#! /usr/bin/env @PYTHON@ + # GLib Testing Framework Utility -*- Mode: python; -*- + # Copyright (C) 2007 Imendio AB + # Authors: Tim Janik +diff --git a/glib/meson.build b/glib/meson.build +index b2dd569..5c29bb7 100644 +--- a/glib/meson.build ++++ b/glib/meson.build +@@ -502,7 +502,7 @@ endif + + report_conf = configuration_data() + report_conf.set('GLIB_VERSION', glib_version) +-report_conf.set('PYTHON', python.full_path()) ++report_conf.set('PYTHON', python_name) + configure_file( + input: 'gtester-report.in', + output: 'gtester-report', +diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in +index 0578b74..aa5af43 100755 +--- a/gobject/glib-genmarshal.in ++++ b/gobject/glib-genmarshal.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # pylint: disable=too-many-lines, missing-docstring, invalid-name + +diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in +index 7e794e9..e10b910 100755 +--- a/gobject/glib-mkenums.in ++++ b/gobject/glib-mkenums.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # If the code below looks horrible and unpythonic, do not panic. + # +diff --git a/gobject/meson.build b/gobject/meson.build +index 78b732b..2129aaf 100644 +--- a/gobject/meson.build ++++ b/gobject/meson.build +@@ -87,7 +87,7 @@ python_tools = [ + + python_tools_conf = configuration_data() + python_tools_conf.set('VERSION', glib_version) +-python_tools_conf.set('PYTHON', python.full_path()) ++python_tools_conf.set('PYTHON', python_name) + + foreach tool: python_tools + tool_bin = configure_file( +diff --git a/meson.build b/meson.build +index bcc2887..6cca73d 100644 +--- a/meson.build ++++ b/meson.build +@@ -2457,7 +2457,9 @@ endif + + glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) + +-python = import('python').find_installation(modules: ['packaging']) ++python = import('python').find_installation() ++# used for '#!/usr/bin/env ' ++python_name = 'python3' + + python_version = python.language_version() + python_version_req = '>=3.7' diff --git a/recipes/glib/all/patches/libintl-discovery.patch b/recipes/glib/all/patches/libintl-discovery.patch new file mode 100644 index 0000000..17083da --- /dev/null +++ b/recipes/glib/all/patches/libintl-discovery.patch @@ -0,0 +1,49 @@ +From 32249a22fc39319651e7c23442d37ec837f05764 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Thu, 8 Sep 2022 02:36:33 +0530 +Subject: [PATCH] meson: Fix detection of a system-provided proxy-libintl + +proxy-libintl defines ngettext() as a define in the header that points +to the actual symbol in the library which is g_libintl_ngettext(). +Same with bind_textdomain_codeset(). +--- + meson.build | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 0cbc9689f5..de0bee5a39 100644 +--- a/meson.build ++++ b/meson.build +@@ -2089,6 +2089,7 @@ libz_dep = dependency('zlib') + # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible + # implementations. This could be extended if issues are found in some platforms. + libintl_deps = [] ++libintl_prefix = '#include ' + libintl = dependency('intl', required: false, allow_fallback: false) + if libintl.found() + # libintl supports different threading APIs, which may not +@@ -2100,11 +2101,11 @@ if libintl.found() + # + # Meson's builtin dependency lookup as of 0.60.0 doesn't check for + # pthread, so we do this manually here. +- if cc.has_function('ngettext', dependencies : libintl) ++ if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix) + libintl_deps += [libintl] + else + libintl_pthread = cc.find_library('pthread', required : false) +- if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread]) ++ if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix) + libintl_deps += [libintl, libintl_pthread] + else + libintl = disabler() +@@ -2113,7 +2114,7 @@ if libintl.found() + endif + + if libintl.found() +- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps) ++ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix) + else + libintl = dependency('intl', allow_fallback: true) + assert(libintl.type_name() == 'internal') +-- +GitLab diff --git a/recipes/glib/all/patches/remove-distutils-2.77.0.patch b/recipes/glib/all/patches/remove-distutils-2.77.0.patch new file mode 100644 index 0000000..ba054b9 --- /dev/null +++ b/recipes/glib/all/patches/remove-distutils-2.77.0.patch @@ -0,0 +1,51 @@ +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 0204610..f8d758c 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -19,7 +19,7 @@ + # + # Author: David Zeuthen + +-import distutils.version ++import re + import os + import sys + +@@ -159,11 +159,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (distutils.version.LooseVersion(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] diff --git a/recipes/glib/all/patches/remove-distutils.patch b/recipes/glib/all/patches/remove-distutils.patch new file mode 100644 index 0000000..3096261 --- /dev/null +++ b/recipes/glib/all/patches/remove-distutils.patch @@ -0,0 +1,51 @@ +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 95559d3..2b7a176 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -19,7 +19,7 @@ + # + # Author: David Zeuthen + +-import distutils.version ++import re + import os + import sys + +@@ -155,11 +155,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (distutils.version.LooseVersion(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] diff --git a/recipes/glib/all/test_package/CMakeLists.txt b/recipes/glib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..c2e2b58 --- /dev/null +++ b/recipes/glib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(glib CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glib::glib-2.0 glib::gio-2.0 glib::gmodule-2.0 glib::gobject-2.0 glib::gthread-2.0) diff --git a/recipes/glib/all/test_package/CMakeUserPresets.json b/recipes/glib/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/glib/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/glib/all/test_package/conanfile.py b/recipes/glib/all/test_package/conanfile.py new file mode 100644 index 0000000..686967e --- /dev/null +++ b/recipes/glib/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +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", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + 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") + if self.settings.os != "Windows": + self.run("gdbus-codegen -h", env="conanrun") diff --git a/recipes/glib/all/test_package/test_package.c b/recipes/glib/all/test_package/test_package.c new file mode 100644 index 0000000..c75317a --- /dev/null +++ b/recipes/glib/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +#include "glib.h" +#include "gmodule.h" +#include "gio/gio.h" + + +int main() { + printf("glib %d.%d.%d\n", glib_major_version, glib_minor_version, glib_micro_version); + printf("glib interface age: %d\n", glib_interface_age); + printf("glib binary age: %d\n", glib_binary_age); + + GQueue *queue = g_queue_new(); + g_queue_free(queue); + + printf("glib module supported: %s\n", g_module_supported() ? "true" : "false"); + + GMutex m; + g_mutex_init(&m); + g_mutex_clear(&m); + + printf("type name for char: %s\n", g_type_name(G_TYPE_CHAR)); + + return EXIT_SUCCESS; +} diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml new file mode 100644 index 0000000..178cce9 --- /dev/null +++ b/recipes/glib/config.yml @@ -0,0 +1,9 @@ +versions: + "2.81.0": + folder: all + "2.78.3": + folder: all + "2.77.3": + folder: all + "2.76.3": + folder: all diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml new file mode 100644 index 0000000..772d593 --- /dev/null +++ b/recipes/harfbuzz/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "8.3.0": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/8.3.0/harfbuzz-8.3.0.tar.xz" + sha256: "109501eaeb8bde3eadb25fab4164e993fbace29c3d775bcaa1c1e58e2f15f847" + "8.2.2": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/8.2.2/harfbuzz-8.2.2.tar.xz" + sha256: "e433ad85fbdf57f680be29479b3f964577379aaf319f557eb76569f0ecbc90f3" + "8.2.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/8.2.1/harfbuzz-8.2.1.tar.xz" + sha256: "0fec78f98c9c8faf228957a201c8846f809452c20f8445eb092a1ba6f22dbea5" + "8.1.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/8.1.1/harfbuzz-8.1.1.tar.xz" + sha256: "0305ad702e11906a5fc0c1ba11c270b7f64a8f5390d676aacfd71db129d6565f" + "8.0.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/8.0.1/harfbuzz-8.0.1.tar.xz" + sha256: "c1ce780acd385569f25b9a29603d1d5bc71e6940e55bfdd4f7266fad50e42620" + "7.3.0": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/7.3.0/harfbuzz-7.3.0.tar.xz" + sha256: "20770789749ac9ba846df33983dbda22db836c70d9f5d050cb9aa5347094a8fb" + "6.0.0": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/6.0.0/harfbuzz-6.0.0.tar.xz" + sha256: "1d1010a1751d076d5291e433c138502a794d679a7498d1268ee21e2d4a140eb4" + "5.1.0": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/releases/download/5.1.0/harfbuzz-5.1.0.tar.xz" + sha256: "2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05" +patches: + "5.1.0": + - patch_file: "patches/0000-fix-freetype-lookup-5.1.0.patch" + patch_type: "portability" + patch_description: "fix fretype and icu dependency lookup" + patch_source: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/harfbuzz/harfbuzz/pull/3811" diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py new file mode 100644 index 0000000..76728b1 --- /dev/null +++ b/recipes/harfbuzz/all/conanfile.py @@ -0,0 +1,226 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import can_run, stdcpp_library +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, replace_in_file +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" + + +class HarfbuzzConan(ConanFile): + name = "harfbuzz" + description = "HarfBuzz is an OpenType text shaping engine." + topics = ("opentype", "text", "engine") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://harfbuzz.github.io/" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_freetype": [True, False], + "with_icu": [True, False], + "with_glib": [True, False], + "with_gdi": [True, False], + "with_uniscribe": [True, False], + "with_directwrite": [True, False], + "with_subset": [True, False], + "with_coretext": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_freetype": True, + "with_icu": False, + "with_glib": True, + "with_gdi": True, + "with_uniscribe": True, + "with_directwrite": False, + "with_subset": False, + "with_coretext": True, + } + + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.with_gdi + del self.options.with_uniscribe + del self.options.with_directwrite + if not is_apple_os(self): + del self.options.with_coretext + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.shared and self.options.with_glib: + wildcard = "" if Version(conan_version) < "2.0.0" else "/*" + self.options[f"glib{wildcard}"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_freetype: + self.requires("freetype/2.13.2") + if self.options.with_icu: + self.requires("icu/74.1") + if self.options.with_glib: + self.requires("glib/2.78.3") + + def validate(self): + if self.options.shared and self.options.with_glib and not self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration("New versions of harfbuzz require at least gcc 7") + + if self.options.with_glib and self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + + def build_requirements(self): +# self.tool_requires("meson/1.4.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.1.0]") + if self.options.with_glib: + self.tool_requires("glib/") + if self.settings.os == "Macos": + # Ensure that the gettext we use at build time is compatible + # with the libiconv that is transitively exposed by glib + self.tool_requires("gettext/0.21") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + def is_enabled(value): + return "enabled" if value else "disabled" + + def meson_backend_and_flags(): + def is_vs_2017(): + version = Version(self.settings.compiler.version) + return version == "15" or version == "191" + + if is_msvc(self) and is_vs_2017() and self.settings.build_type == "Debug": + # Mitigate https://learn.microsoft.com/en-us/cpp/build/reference/zf?view=msvc-170 + return "vs", ["/bigobj"] + return "ninja", [] + + VirtualBuildEnv(self).generate() + + # Avoid conflicts with libiconv + # see: https://github.com/conan-io/conan-center-index/pull/17046#issuecomment-1554629094 + if self._settings_build.os == "Macos": + env = Environment() + env.define_path("DYLD_FALLBACK_LIBRARY_PATH", "$DYLD_LIBRARY_PATH") + env.define_path("DYLD_LIBRARY_PATH", "") + env.vars(self, scope="build").save_script("conanbuild_macos_runtimepath") + + PkgConfigDeps(self).generate() + + backend, cxxflags = meson_backend_and_flags() + tc = MesonToolchain(self, backend=backend) + tc.project_options["auto_features"] = "disabled" + tc.project_options.update({ + "glib": is_enabled(self.options.with_glib), + "icu": is_enabled(self.options.with_icu), + "freetype": is_enabled(self.options.with_freetype), + "gdi": is_enabled(self.options.get_safe("with_gdi")), + "coretext": is_enabled(self.options.get_safe("with_coretext")), + "directwrite": is_enabled(self.options.get_safe("with_directwrite")), + "gobject": is_enabled(can_run(self) and self.options.with_glib), + "introspection": is_enabled(False), + "tests": "disabled", + "docs": "disabled", + "benchmark": "disabled", + "icu_builtin": "false" + }) + tc.cpp_args += cxxflags + tc.generate() + + def build(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('util')", "") + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "harfbuzz") + self.cpp_info.set_property("cmake_target_name", "harfbuzz::harfbuzz") + self.cpp_info.set_property("pkg_config_name", "harfbuzz") + if self.options.with_icu: + self.cpp_info.libs.append("harfbuzz-icu") + if self.options.with_subset: + self.cpp_info.libs.append("harfbuzz-subset") + self.cpp_info.libs.append("harfbuzz") + self.cpp_info.includedirs.append(os.path.join("include", "harfbuzz")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.system_libs.append("user32") + if self.options.with_gdi or self.options.with_uniscribe: + self.cpp_info.system_libs.append("gdi32") + if self.options.with_uniscribe or self.options.with_directwrite: + self.cpp_info.system_libs.append("rpcrt4") + if self.options.with_uniscribe: + self.cpp_info.system_libs.append("usp10") + if self.options.with_directwrite: + self.cpp_info.system_libs.append("dwrite") + if is_apple_os(self) and self.options.get_safe("with_coretext", False): + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("ApplicationServices") + else: + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch new file mode 100644 index 0000000..f3992bf --- /dev/null +++ b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-5.1.0.patch @@ -0,0 +1,72 @@ +diff --git a/meson.build b/meson.build +index df4443fb2..b8b143948 100644 +--- a/meson.build ++++ b/meson.build +@@ -21,7 +21,7 @@ pkgmod = import('pkgconfig') + cpp = meson.get_compiler('cpp') + null_dep = dependency('', required: false) + +-if cpp.get_id() == 'msvc' ++if cpp.get_argument_syntax() == 'msvc' + # Ignore several spurious warnings for things HarfBuzz does very commonly. + # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it + # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once +@@ -83,25 +83,39 @@ check_funcs = [ + + m_dep = cpp.find_library('m', required: false) + +-# https://github.com/harfbuzz/harfbuzz/pull/2498 +-freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2', +- required: get_option('freetype'), +- default_options: ['harfbuzz=disabled']) ++ ++# Try pkgconfig name ++freetype_dep = dependency('freetype2', required: false) ++if not freetype_dep.found() ++ # Try cmake name ++ freetype_dep = dependency('freetype', required: false) ++endif ++if not freetype_dep.found() ++ # Subproject fallback, `allow_fallback: true` means the fallback will be ++ # tried even if the freetype option is set to `auto`. ++ freetype_dep = dependency('freetype2', ++ required: get_option('freetype'), ++ default_options: ['harfbuzz=disabled'], ++ allow_fallback: true) ++endif + + glib_dep = dependency('glib-2.0', required: get_option('glib')) + gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) + graphite2_dep = dependency('graphite2', required: get_option('graphite2')) + graphite_dep = dependency('graphite2', required: get_option('graphite')) + +-if cpp.get_argument_syntax() == 'msvc' ++# Try pkgconfig name ++icu_dep = dependency('icu-uc', required: false) ++if not icu_dep.found() ++ # Try cmake name + icu_dep = dependency('ICU', +- required: get_option('icu'), ++ required: false, + components: 'uc', + method: 'cmake') +-else +- icu_dep = dependency('icu-uc', +- required: get_option('icu'), +- method: 'pkg-config') ++endif ++if not icu_dep.found() ++ # Subproject fallback if icu option is enabled ++ icu_dep = dependency('icu-uc', required: get_option('icu')) + endif + + if icu_dep.found() and icu_dep.type_name() == 'pkgconfig' +@@ -118,7 +132,7 @@ if not get_option('cairo').disabled() + cairo_ft_dep = dependency('cairo-ft', required: false) + + if (not cairo_dep.found() and +- cpp.get_id() == 'msvc' and ++ cpp.get_argument_syntax() == 'msvc' and + cpp.has_header('cairo.h')) + cairo_dep = cpp.find_library('cairo', required: false) + if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face', diff --git a/recipes/harfbuzz/all/test_package/CMakeLists.txt b/recipes/harfbuzz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..297728d --- /dev/null +++ b/recipes/harfbuzz/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(harfbuzz REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE harfbuzz::harfbuzz) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/harfbuzz/all/test_package/CMakeUserPresets.json b/recipes/harfbuzz/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/harfbuzz/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/harfbuzz/all/test_package/conanfile.py b/recipes/harfbuzz/all/test_package/conanfile.py new file mode 100644 index 0000000..ca91882 --- /dev/null +++ b/recipes/harfbuzz/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +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", "compiler", "build_type", "arch" + test_type = "explicit" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + 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") diff --git a/recipes/harfbuzz/all/test_package/test_package.c b/recipes/harfbuzz/all/test_package/test_package.c new file mode 100644 index 0000000..0bd42e5 --- /dev/null +++ b/recipes/harfbuzz/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() { + const char *version = hb_version_string(); + printf("harfbuzz version: %s\n", version); + return 0; +} diff --git a/recipes/harfbuzz/all/test_v1_package/CMakeLists.txt b/recipes/harfbuzz/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/recipes/harfbuzz/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/harfbuzz/all/test_v1_package/conanfile.py b/recipes/harfbuzz/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..994065a --- /dev/null +++ b/recipes/harfbuzz/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml new file mode 100644 index 0000000..d5a1a8b --- /dev/null +++ b/recipes/harfbuzz/config.yml @@ -0,0 +1,17 @@ +versions: + "8.3.0": + folder: all + "8.2.2": + folder: all + "8.2.1": + folder: all + "8.1.1": + folder: all + "8.0.1": + folder: all + "7.3.0": + folder: all + "6.0.0": + folder: all + "5.1.0": + folder: all diff --git a/recipes/libelf/all/CMakeLists.txt b/recipes/libelf/all/CMakeLists.txt new file mode 100644 index 0000000..f27f218 --- /dev/null +++ b/recipes/libelf/all/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.4) +project(elf LANGUAGES C) + +if(EXISTS "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32") + file(RENAME "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32" "${LIBELF_SRC_DIR}/lib/sys_elf.h") + file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/lib/config.h") +endif() + +file(GLOB_RECURSE SOURCES "${LIBELF_SRC_DIR}/lib/*.c") +file(GLOB_RECURSE HEADERS "${LIBELF_SRC_DIR}/lib/*.h") + +add_library(${PROJECT_NAME} ${SOURCES}) +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${LIBELF_SRC_DIR}/lib") +target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1 HAVE_CONFIG_H=1) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelf +) + +install(FILES "${LIBELF_SRC_DIR}/lib/libelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/gelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/nlist.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/libelf/all/conandata.yml b/recipes/libelf/all/conandata.yml new file mode 100644 index 0000000..2bff730 --- /dev/null +++ b/recipes/libelf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.13": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-fossies_org/linux/misc/old/libelf-0.8.13.tar.gz" + sha256: "591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d" diff --git a/recipes/libelf/all/conanfile.py b/recipes/libelf/all/conanfile.py new file mode 100644 index 0000000..4d90c56 --- /dev/null +++ b/recipes/libelf/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path +import os + +required_conan_version = ">=1.54.0" + + +class LibelfConan(ConanFile): + name = "libelf" + description = "ELF object file access library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://directory.fsf.org/wiki/Libelf" + license = "LGPL-2.0" + topics = ("elf", "fsf", "libelf", "object-file") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.os not in ["Linux", "FreeBSD", "Windows"]: + self.options.rm_safe("shared") + self.package_type = "static-library" + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self.settings.os != "Windows": +# self.tool_requires("autoconf/2.71") +# self.tool_requires("gnu-config/cci.20210814") + if self.settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["LIBELF_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + # it's required, libelf doesnt seem to understand DESTDIR + f"--prefix={unix_path(self, self.package_folder)}", + ]) + tc.generate() + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + else: + replace_in_file(self, os.path.join(self.source_folder, "lib", "Makefile.in"), + "$(LINK_SHLIB)", + "$(LINK_SHLIB) $(LDFLAGS)") + # libelf sources contains really outdated 'config.sub' and + # 'config.guess' files. It not allows to build libelf for armv8 arch. + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "locale")) + if self.options.get_safe("shared"): + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libelf") + self.cpp_info.libs = ["elf"] + self.cpp_info.includedirs.append(os.path.join("include", "libelf")) diff --git a/recipes/libelf/all/test_package/CMakeLists.txt b/recipes/libelf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..715677f --- /dev/null +++ b/recipes/libelf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libelf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libelf::libelf) diff --git a/recipes/libelf/all/test_package/CMakeUserPresets.json b/recipes/libelf/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/libelf/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libelf/all/test_package/conanfile.py b/recipes/libelf/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/recipes/libelf/all/test_package/conanfile.py @@ -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") diff --git a/recipes/libelf/all/test_package/test_package.c b/recipes/libelf/all/test_package/test_package.c new file mode 100644 index 0000000..2cf36fd --- /dev/null +++ b/recipes/libelf/all/test_package/test_package.c @@ -0,0 +1,114 @@ +#include +#include + +#include +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "libelf.h" + +int main(int argc , char **argv) { + int fd; + Elf *e; + const char *k; + Elf_Kind ek; + + if (elf_version(EV_CURRENT) == EV_NONE) { + printf("ELF library initialization failed: %s\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + +#ifdef _WIN32 + return EXIT_SUCCESS; +#endif + +#ifdef _MSVC_VER + if ((fd = _open(argv[0], _O_RDONLY , 0)) < 0) { +#else + if ((fd = open(argv[0], O_RDONLY , 0)) < 0) { +#endif + printf("open %s failed\n", argv [0]); + return EXIT_FAILURE; + } + + if(ELF_C_NULL != 0) + { + printf("ELF_C_NULL has wrong value: %d\n", ELF_C_NULL); + return EXIT_FAILURE; + } + if(ELF_C_READ != 1) + { + printf("ELF_C_READ has wrong value: %d\n", ELF_C_READ); + return EXIT_FAILURE; + } + if(ELF_C_WRITE != 2) + { + printf("ELF_C_WRITE has wrong value: %d\n", ELF_C_WRITE); + return EXIT_FAILURE; + } + if(ELF_C_CLR != 3) + { + printf("ELF_C_CLR has wrong value: %d\n", ELF_C_CLR); + return EXIT_FAILURE; + } + if(ELF_C_SET != 4) + { + printf("ELF_C_SET has wrong value: %d\n", ELF_C_SET); + return EXIT_FAILURE; + } + if(ELF_C_FDDONE != 5) + { + printf("ELF_C_FDDONE has wrong value: %d\n", ELF_C_FDDONE); + return EXIT_FAILURE; + } + if(ELF_C_FDREAD != 6) + { + printf("ELF_C_FDREAD has wrong value: %d\n", ELF_C_FDREAD); + return EXIT_FAILURE; + } + if(ELF_C_RDWR != 7) + { + printf("ELF_C_RDWR has wrong value: %d\n", ELF_C_RDWR); + return EXIT_FAILURE; + } + if(ELF_C_NUM != 8) + { + printf("ELF_C_NUM has wrong value: %d\n", ELF_C_NUM); + return EXIT_FAILURE; + } + + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + printf("elf_begin () failed: %s.\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + + ek = elf_kind(e); + + switch (ek) { + case ELF_K_AR: + k = "ar(1) archive"; + break; + case ELF_K_ELF: + k = "elf object"; + break; + case ELF_K_NONE: + k = "data"; + break; + default: + k = "unrecognized"; + } + + printf("%s: %s\n", argv[0], k); + elf_end(e); + +#ifdef _MSVC_VER + _close(fd); +#else + close(fd); +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/libelf/config.yml b/recipes/libelf/config.yml new file mode 100644 index 0000000..f55c7c3 --- /dev/null +++ b/recipes/libelf/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.13": + folder: all diff --git a/recipes/libffi/all/conandata.yml b/recipes/libffi/all/conandata.yml new file mode 100644 index 0000000..ed5c7dc --- /dev/null +++ b/recipes/libffi/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "3.4.6": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz" + sha256: "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e" + "3.4.4": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz" + sha256: "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676" + "3.3": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz" + sha256: "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056" +patches: + "3.4.6": + - patch_file: "patches/0002-3.4.6-fix-libtool-path.patch" + - patch_file: "patches/0004-3.4.6-fix-complex-type-msvc.patch" + - patch_file: "patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.4.6-library-no-version-suffix.patch" + "3.4.4": + - patch_file: "patches/0002-3.4.3-fix-libtool-path.patch" + - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" + - patch_file: "patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.4.4-library-no-version-suffix.patch" + - patch_file: "patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch" + patch_type: "portability" + patch_source: "https://github.com/libffi/libffi/pull/764" + patch_description: "Forward declare the open_temp_exec_file function which is required by the C99 standard" + "3.3": + - patch_file: "patches/0002-3.3-fix-libtool-path.patch" + - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" + - patch_file: "patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.3-library-no-version-suffix.patch" diff --git a/recipes/libffi/all/conanfile.py b/recipes/libffi/all/conanfile.py new file mode 100644 index 0000000..cc062fc --- /dev/null +++ b/recipes/libffi/all/conanfile.py @@ -0,0 +1,169 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime, msvc_runtime_flag, unix_path +from conan.tools.scm import Version +import glob +import os +import shutil + +required_conan_version = ">=1.57.0" + + +class LibffiConan(ConanFile): + name = "libffi" + description = "A portable, high level programming interface to various calling conventions" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceware.org/libffi/" + topics = ("runtime", "foreign-function-interface", "runtime-library") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + # TODO: Remove for Conan v2 + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + if is_apple_os(self) and self.settings.arch == "armv8" and Version(self.version) < "3.4.0": + raise ConanInvalidConfiguration(f"{self.ref} does not support Apple ARM CPUs") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--enable-debug={yes_no(self.settings.build_type == 'Debug')}", + "--enable-builddir=no", + "--enable-docs=no", + ]) + + if self._settings_build.compiler == "apple-clang": + tc.configure_args.append("--disable-multi-os-directory") + + if self.options.shared: + tc.extra_defines.append("FFI_BUILDING_DLL") + if Version(self.version) < "3.4.6": + tc.extra_defines.append("FFI_BUILDING") + elif not self.options.shared: + tc.extra_defines.append("FFI_STATIC_BUILD") + + env = tc.environment() + if self._settings_build.os == "Windows" and (is_msvc(self) or self.settings.compiler == "clang"): + build = "{}-{}-{}".format( + "x86_64" if self._settings_build.arch == "x86_64" else "i686", + "pc" if self._settings_build.arch == "x86" else "win64", + "mingw64") + host = "{}-{}-{}".format( + "x86_64" if self.settings.arch == "x86_64" else "i686", + "pc" if self.settings.arch == "x86" else "win64", + "mingw64") + tc.update_configure_args({ + "--build": build, + "--host": host + }) + + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + # https://github.com/conan-io/conan/issues/6514 + tc.extra_cflags.append("-FS") + + if is_msvc_static_runtime(self): + tc.extra_defines.append("USE_STATIC_RTL") + if "d" in msvc_runtime_flag(self): + tc.extra_defines.append("USE_DEBUG_RTL") + + architecture_flag = "" + if is_msvc(self): + if self.settings.arch == "x86_64": + architecture_flag = "-m64" + elif self.settings.arch == "x86": + architecture_flag = "-m32" + elif self.settings.compiler == "clang": + architecture_flag = "-clang-cl" + + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "msvcc.sh")) + if architecture_flag: + compile_wrapper = f"{compile_wrapper} {architecture_flag}" + + ar_wrapper = unix_path(self, self.dependencies.build["automake"].conf_info.get("user.automake:lib-wrapper")) + env.define("CC", f"{compile_wrapper}") + env.define("CXX", f"{compile_wrapper}") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.define("CXXCPP", "cl -nologo -EP") + env.define("CPP", "cl -nologo -EP") + env.define("LIBTOOL", unix_path(self, os.path.join(self.source_folder, "ltmain.sh"))) + env.define("INSTALL", unix_path(self, os.path.join(self.source_folder, "install-sh"))) + tc.generate(env=env) + + def build(self): + apply_conandata_patches(self) + + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) # Need to specify the `DESTDIR` as a Unix path, aware of the subsystem + fix_apple_shared_install_name(self) + mkdir(self, os.path.join(self.package_folder, "bin")) + for dll in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): + shutil.move(dll, os.path.join(self.package_folder, "bin")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["{}ffi".format("lib" if is_msvc(self) else "")] + self.cpp_info.set_property("pkg_config_name", "libffi") + if not self.options.shared: + static_define = "FFI_STATIC_BUILD" if Version(self.version) >= "3.4.6" else "FFI_BUILDING" + self.cpp_info.defines = [static_define] diff --git a/recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch new file mode 100644 index 0000000..dc7d92d --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.3-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -8964,7 +8964,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -9057,7 +9057,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=libtool.sh + can_build_shared=yes + + # All known linkers require a '.a' archive for static linking (except MSVC, diff --git a/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch new file mode 100644 index 0000000..f7d0c10 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -9940,7 +9940,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -10032,7 +10032,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=libtool.sh + can_build_shared=yes + + # All known linkers require a '.a' archive for static linking (except MSVC and diff --git a/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch new file mode 100644 index 0000000..e557baa --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -9882,7 +9882,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -9974,7 +9974,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=libtool.sh + can_build_shared=yes + + # All known linkers require a '.a' archive for static linking (except MSVC and diff --git a/recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch b/recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch new file mode 100644 index 0000000..009281c --- /dev/null +++ b/recipes/libffi/all/patches/0004-3.3-fix-complex-type-msvc.patch @@ -0,0 +1,56 @@ +--- src/types.c ++++ src/types.c +@@ -31,6 +31,8 @@ + #include + #include + ++#include ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id, maybe_const)\ +@@ -45,17 +47,17 @@ + id, NULL \ + } + +-#define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ ++#define FFI_COMPLEX_TYPEDEF(name, complex_type, maybe_const) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffi_type_##name), NULL \ + }; \ + struct struct_align_complex_##name { \ + char c; \ +- _Complex type x; \ ++ complex_type x; \ + }; \ + FFI_EXTERN \ + maybe_const ffi_type ffi_type_complex_##name = { \ +- sizeof(_Complex type), \ ++ sizeof(complex_type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ +@@ -99,10 +101,20 @@ + FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); + #endif + ++#ifdef _MSC_VER ++# define FLOAT_COMPLEX _C_float_complex ++# define DOUBLE_COMPLEX _C_double_complex ++# define LDOUBLE_COMPLEX _C_ldouble_complex ++#else ++# define FLOAT_COMPLEX float _Complex ++# define DOUBLE_COMPLEX double _Complex ++# define LDOUBLE_COMPLEX long double _Complex ++#endif ++ + #ifdef FFI_TARGET_HAS_COMPLEX_TYPE +-FFI_COMPLEX_TYPEDEF(float, float, const); +-FFI_COMPLEX_TYPEDEF(double, double, const); ++FFI_COMPLEX_TYPEDEF(float, FLOAT_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(double, DOUBLE_COMPLEX, const); + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +-FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); ++FFI_COMPLEX_TYPEDEF(longdouble, LDOUBLE_COMPLEX, FFI_LDBL_CONST); + #endif + #endif diff --git a/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch b/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch new file mode 100644 index 0000000..4779afe --- /dev/null +++ b/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch @@ -0,0 +1,56 @@ +diff --git a/src/types.c b/src/types.c +index c1c27f3..d5d52bb 100644 +--- a/src/types.c ++++ b/src/types.c +@@ -31,6 +31,8 @@ + #include + #include + ++#include ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id, maybe_const)\ +@@ -45,17 +47,17 @@ maybe_const ffi_type ffi_type_##name = { \ + id, NULL \ + } + +-#define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ ++#define FFI_COMPLEX_TYPEDEF(name, complex_type, maybe_const) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffi_type_##name), NULL \ + }; \ + struct struct_align_complex_##name { \ + char c; \ +- _Complex type x; \ ++ complex_type x; \ + }; \ + FFI_EXTERN \ + maybe_const ffi_type ffi_type_complex_##name = { \ +- sizeof(_Complex type), \ ++ sizeof(complex_type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ +@@ -99,8 +101,18 @@ const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; + FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); + #endif + ++#ifdef _MSC_VER ++# define FLOAT_COMPLEX _C_float_complex ++# define DOUBLE_COMPLEX _C_double_complex ++# define LDOUBLE_COMPLEX _C_ldouble_complex ++#else ++# define FLOAT_COMPLEX float _Complex ++# define DOUBLE_COMPLEX double _Complex ++# define LDOUBLE_COMPLEX long double _Complex ++#endif ++ + #ifdef FFI_TARGET_HAS_COMPLEX_TYPE +-FFI_COMPLEX_TYPEDEF(float, float, const); +-FFI_COMPLEX_TYPEDEF(double, double, const); +-FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); ++FFI_COMPLEX_TYPEDEF(float, FLOAT_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(double, DOUBLE_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(longdouble, LDOUBLE_COMPLEX, FFI_LDBL_CONST); + #endif diff --git a/recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch new file mode 100644 index 0000000..009a32d --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.3-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -510,7 +510,7 @@ + target_os = @target_os@ + target_vendor = @target_vendor@ + toolexecdir = @toolexecdir@ +-toolexeclibdir = @toolexeclibdir@ ++toolexeclibdir = @libdir@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch new file mode 100644 index 0000000..b97912c --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 86eb4a5..450200a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -521,7 +521,7 @@ target_os = @target_os@ + target_vendor = @target_vendor@ + tmake_file = @tmake_file@ + toolexecdir = @toolexecdir@ +-toolexeclibdir = @toolexeclibdir@ ++toolexeclibdir = @libdir@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch new file mode 100644 index 0000000..520542d --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.3-library-no-version-suffix.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -613,7 +613,7 @@ + @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = + @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun +-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` ++libffi_version_info = -avoid-version + libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) + libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0006-3.4.4-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.4-library-no-version-suffix.patch new file mode 100644 index 0000000..3e7be9c --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.4-library-no-version-suffix.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 450200a..abcee85 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -616,7 +616,7 @@ AM_CFLAGS = $(am__append_3) + @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = + @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun +-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` ++libffi_version_info = -avoid-version + libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) + libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch new file mode 100644 index 0000000..726e8c1 --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 450200a..abcee85 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -618,7 +618,7 @@ AM_CFLAGS = $(am__append_3) + @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = + @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun +-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` ++libffi_version_info = -avoid-version + libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) + libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch b/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch new file mode 100644 index 0000000..a2e9d8e --- /dev/null +++ b/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch @@ -0,0 +1,30 @@ +diff --git a/include/ffi_common.h b/include/ffi_common.h +index 2bd31b0..c53a794 100644 +--- a/include/ffi_common.h ++++ b/include/ffi_common.h +@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; + static trampoline. */ + int ffi_tramp_is_present (void *closure) FFI_HIDDEN; + ++/* Return a file descriptor of a temporary zero-sized file in a ++ writable and executable filesystem. */ ++int open_temp_exec_file(void) FFI_HIDDEN; ++ + /* Extended cif, used in callback from assembly routine */ + typedef struct + { +diff --git a/src/tramp.c b/src/tramp.c +index b9d273a..c3f4c99 100644 +--- a/src/tramp.c ++++ b/src/tramp.c +@@ -39,6 +39,10 @@ + #ifdef __linux__ + #define _GNU_SOURCE 1 + #endif ++ ++#include ++#include ++ + #include + #include + #include diff --git a/recipes/libffi/all/test_package/CMakeLists.txt b/recipes/libffi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..80fe708 --- /dev/null +++ b/recipes/libffi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES C) + +find_package(libffi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libffi::libffi) diff --git a/recipes/libffi/all/test_package/CMakeUserPresets.json b/recipes/libffi/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/libffi/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libffi/all/test_package/conanfile.py b/recipes/libffi/all/test_package/conanfile.py new file mode 100644 index 0000000..2d63639 --- /dev/null +++ b/recipes/libffi/all/test_package/conanfile.py @@ -0,0 +1,37 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualRunEnv +from conan.tools.microsoft import msvc_runtime_flag +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + tc = CMakeToolchain(self) + if "d" in msvc_runtime_flag(self): + tc.preprocessor_definitions["DISABLE_FFI_CALL"] = 1 + tc.generate() + virtual_run_env = VirtualRunEnv(self) + virtual_run_env.generate() + + 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") diff --git a/recipes/libffi/all/test_package/test_package.c b/recipes/libffi/all/test_package/test_package.c new file mode 100644 index 0000000..ec8d848 --- /dev/null +++ b/recipes/libffi/all/test_package/test_package.c @@ -0,0 +1,99 @@ +#if defined(_MSC_VER) +#pragma runtime_checks("s", off) +#endif + +#include + +#include +#include +#include + +unsigned print_uint(unsigned arg) { + printf("print_int(%u)\n", arg); + return 3 * arg; +} + +typedef struct { + FILE *stream; +} puts_binding_userdata; + +void puts_binding(ffi_cif *cif, void *ret, void** args, void *userdata) +{ + fputs(*(char **)args[0], ((puts_binding_userdata *)userdata)->stream); + *((unsigned*)ret) = 1337; +} + +int main() +{ + { + ffi_type *argtypes[1] = {&ffi_type_uint32}; + ffi_cif cif; + ffi_status status = FFI_BAD_ABI; + status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint32, argtypes); + if (status != FFI_OK) + { + puts("1 ffi_prep_cif FAILED.\n\n"); + return EXIT_FAILURE; + } + #ifndef DISABLE_FFI_CALL + // this fails on msvc debug runtime because of https://github.com/libffi/libffi/issues/456 + unsigned rvalue = 0; + unsigned arg1 = 13; + const unsigned expected_ret = 3 * arg1; + void *args[] = {(void*)(&arg1)}; + ffi_call(&cif, FFI_FN(&print_uint), (void *) &rvalue, args); + printf("ffi_call returns %d (should be %d)\n", rvalue, expected_ret); + if (rvalue != expected_ret) { + printf("ffi_call FAILED. Expected %d, but got %d.\n", expected_ret, rvalue); + return EXIT_FAILURE; + } + #endif + return EXIT_SUCCESS; + } + { + #ifdef FFI_CLOSURES + ffi_type *argtypes[1] = {&ffi_type_uint}; + ffi_cif cif; + ffi_status status = FFI_BAD_ABI; + status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint32, argtypes); + if (status != FFI_OK) + { + puts("2 ffi_prep_cif FAILED.\n\n"); + return EXIT_FAILURE; + } + unsigned (*bound_puts)(const char *) = NULL; + ffi_closure *closure = NULL; + closure = (ffi_closure *) ffi_closure_alloc(sizeof(ffi_closure), (void **)&bound_puts); + if (closure == NULL) { + puts("ffi_closure_alloc FAILED\n"); + return EXIT_FAILURE; + } + + puts_binding_userdata userdata; + userdata.stream = stdout; + status = ffi_prep_closure_loc(closure, &cif, puts_binding, + &userdata, (void *) bound_puts); + if (status != FFI_OK) { + puts("ffi_prep_closure_loc FAILED\n"); + return EXIT_FAILURE; + } + puts("Start calling bound_put():"); + bound_puts("Hello"); + bound_puts(" "); + bound_puts("World"); + unsigned rc = bound_puts("\n"); + printf("bounds_puts returned %d.\n", rc); + if (rc != 1337) { + puts("bounds_put returned wrong number."); + return EXIT_FAILURE; + } + + ffi_closure_free(closure); + #endif + } + return EXIT_SUCCESS; +} + +#if defined(_MSC_VER) +#pragma runtime_checks("s", restore) +#endif diff --git a/recipes/libffi/all/test_v1_package/CMakeLists.txt b/recipes/libffi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..5b6f863 --- /dev/null +++ b/recipes/libffi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() +if(CONAN_SETTINGS_COMPILER_RUNTIME MATCHES ".*d") + add_compile_definitions(DISABLE_FFI_CALL) +endif() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libffi/all/test_v1_package/conanfile.py b/recipes/libffi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..d4128b0 --- /dev/null +++ b/recipes/libffi/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libffi/config.yml b/recipes/libffi/config.yml new file mode 100644 index 0000000..e6382ec --- /dev/null +++ b/recipes/libffi/config.yml @@ -0,0 +1,7 @@ +versions: + "3.4.6": + folder: "all" + "3.4.4": + folder: "all" + "3.3": + folder: "all" diff --git a/recipes/libgettext/all/conandata.yml b/recipes/libgettext/all/conandata.yml new file mode 100644 index 0000000..4b127d2 --- /dev/null +++ b/recipes/libgettext/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "0.22": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/pub/gnu/gettext/gettext-0.22.tar.gz" + sha256: "49f089be11b490170bbf09ed2f51e5f5177f55be4cc66504a5861820e0fb06ab" + "0.21": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/pub/gnu/gettext/gettext-0.21.tar.gz" + sha256: "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12" + "0.20.1": + sha256: "66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c" + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/pub/gnu/gettext/gettext-0.20.1.tar.gz" +patches: + "0.21": + - patch_file: "patches/0002-memmove-is-intrinsic-function-on-MSVC.patch" + patch_description: "memmove is intrinsic function on MSVC" + patch_type: "portability" + "0.20.1": + - patch_file: "patches/0001-build-Fix-build-errors-with-MSVC.patch" + patch_description: "Fix build errors with MSVC" + patch_type: "portability" + - patch_file: "patches/0002-memmove-is-intrinsic-function-on-MSVC.patch" + patch_description: "memmove is intrinsic function on MSVC" + patch_type: "portability" + - patch_file: "patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch" + patch_description: "fix preloadable libintl for static build" + patch_type: "portability" diff --git a/recipes/libgettext/all/conanfile.py b/recipes/libgettext/all/conanfile.py new file mode 100644 index 0000000..9532952 --- /dev/null +++ b/recipes/libgettext/all/conanfile.py @@ -0,0 +1,239 @@ +import glob +import os + +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv, Environment +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rename +) +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class GetTextConan(ConanFile): + name = "libgettext" + description = "An internationalization and localization system for multilingual programs" + topics = ("gettext", "intl", "libintl", "i18n") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/gettext" + # Some parts of the project are GPL-3.0-or-later and some are LGPL-2.1-or-later. + # At this time, only libintl is packaged, which is licensed under the LGPL-2.1-or-later. + # If you modify this package to include other portions of the library, please configure the license accordingly. + # The licensing of the project is documented here: https://www.gnu.org/software/gettext/manual/gettext.html#Licenses + license = "LGPL-2.1-or-later" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threads": ["posix", "solaris", "pth", "windows", "disabled"], + } + default_options = { + "shared": False, + "fPIC": True, + # Handle default value for `threads` in `config_options` method + } + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _gettext_folder(self): + return "gettext-tools" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + self.options.threads = {"Solaris": "solaris", "Windows": "windows"}.get(str(self.settings.os), "posix") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self) or self._is_clang_cl: + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + if not cross_building(self): + VirtualRunEnv(self).generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args += [ + "HELP2MAN=/bin/true", + "EMACS=no", + "--disable-nls", + "--disable-dependency-tracking", + "--enable-relocatable", + "--disable-c++", + "--disable-java", + "--disable-csharp", + "--disable-libasprintf", + "--disable-curses", + "--disable-threads" if self.options.threads == "disabled" else ("--enable-threads=" + str(self.options.threads)), + f"--with-libiconv-prefix={unix_path(self, self.dependencies['libiconv'].package_folder)}", + ] + if is_msvc(self) or self._is_clang_cl: + target = None + if self.settings.arch == "x86_64": + target = "x86_64-w64-mingw32" + elif self.settings.arch == "x86": + target = "i686-w64-mingw32" + + if target is not None: + tc.configure_args += [f"--host={target}", f"--build={target}"] + + if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags += ["-FS"] + + if self.settings.build_type == "Debug": + # Skip checking for the 'n' printf format directly + # in msvc, as it is known to not be available due to security concerns. + # Skipping it avoids a GUI prompt during ./configure for a debug build + # See https://github.com/conan-io/conan-center-index/issues/23698 + tc.configure_args.extend([ + 'gl_cv_func_printf_directive_n=no' + ]) + tc.make_args += ["-C", "intl"] + env = tc.environment() + if is_msvc(self) or self._is_clang_cl: + def programs(): + rc = None + if self.settings.arch == "x86_64": + rc = "windres --target=pe-x86-64" + elif self.settings.arch == "x86": + rc = "windres --target=pe-i386" + if self._is_clang_cl: + return os.environ.get("CC", "clang-cl"), os.environ.get("AR", "llvm-lib"), os.environ.get("LD", "lld-link"), rc + if is_msvc(self): + return "cl -nologo", "lib", "link", rc + + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + cc, ar, link, rc = programs() + env.define("CC", f"{compile_wrapper} {cc}") + env.define("CXX", f"{compile_wrapper} {cc}") + env.define("LD", link) + env.define("AR", f"{ar_wrapper} {ar}") + env.define("NM", "dumpbin -symbols") + env.define("RANLIB", ":") + env.define("STRIP", ":") + if rc is not None: + env.define("RC", rc) + env.define("WINDRES", rc) + tc.generate(env) + + if is_msvc(self) or self._is_clang_cl: + # Custom AutotoolsDeps for cl like compilers + # workaround for https://github.com/conan-io/conan/issues/12784 + includedirs = [] + defines = [] + libs = [] + libdirs = [] + linkflags = [] + cxxflags = [] + cflags = [] + for dependency in self.dependencies.values(): + deps_cpp_info = dependency.cpp_info.aggregated_components() + includedirs.extend(deps_cpp_info.includedirs) + defines.extend(deps_cpp_info.defines) + libs.extend(deps_cpp_info.libs + deps_cpp_info.system_libs) + libdirs.extend(deps_cpp_info.libdirs) + linkflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + cxxflags.extend(deps_cpp_info.cxxflags) + cflags.extend(deps_cpp_info.cflags) + + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in includedirs] + [f"-D{d}" for d in defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in libdirs] + linkflags) + env.append("CXXFLAGS", cxxflags) + env.append("CFLAGS", cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure("gettext-runtime") + autotools.make() + + def package(self): + dest_lib_dir = os.path.join(self.package_folder, "lib") + dest_runtime_dir = os.path.join(self.package_folder, "bin") + dest_include_dir = os.path.join(self.package_folder, "include") + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*gnuintl*.dll", self.build_folder, dest_runtime_dir, keep_path=False) + copy(self, "*gnuintl*.lib", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*gnuintl*.a", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*gnuintl*.so*", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*gnuintl*.dylib", self.build_folder, dest_lib_dir, keep_path=False) + copy(self, "*libgnuintl.h", self.build_folder, dest_include_dir, keep_path=False) + rename(self, os.path.join(dest_include_dir, "libgnuintl.h"), os.path.join(dest_include_dir, "libintl.h")) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Intl") + self.cpp_info.set_property("cmake_target_name", "Intl::Intl") + self.cpp_info.libs = ["gnuintl"] + if is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") + + self.cpp_info.names["cmake_find_package"] = "Intl" + self.cpp_info.names["cmake_find_package_multi"] = "Intl" + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch b/recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch new file mode 100644 index 0000000..194989a --- /dev/null +++ b/recipes/libgettext/all/patches/0001-build-Fix-build-errors-with-MSVC.patch @@ -0,0 +1,362 @@ +From b33dca8eecdc1eb30bb3747df563faabf729f001 Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Thu, 4 Jul 2019 16:27:33 +0200 +Subject: [PATCH 1/2] build: Fix build errors with MSVC. + +* gettext-tools/libgettextpo/exported.sh.in: Remove one level of eval. +* gettext-tools/libgettextpo/Makefile.am (config.h): Redirect compiler output to +stderr. Remove symbols that contain an '@'. +* libtextstyle/lib/Makefile.am (config.h): Likewise. + +build: Fix build error with MSVC. + +* gettext-runtime/intl/export.h (LIBINTL_DLL_EXPORTED): Define differently for +MSVC. + +build: Fix build error with MSVC. + +* gettext-runtime/intl/Makefile.am (INTL_WINDOWS_LIBS): New variable. +(OTHER_LDFLAGS): Add it. + +build: Fix build errors with MSVC. + +* gettext-tools/src/lang-table.h (language_table, language_variant_table): +Declare with C linkage. +* gettext-tools/src/read-po.h (input_format_po): Likewise. +* gettext-tools/src/read-properties.h (input_format_properties): Likewise. +* gettext-tools/src/read-stringtable.h (input_format_stringtable): Likewise. +* gettext-tools/src/write-properties.h (output_format_properties): Likewise. +* gettext-tools/src/write-stringtable.h (output_format_stringtable): Likewise. + +intl: Don't export the glwthread* symbols from libintl on native Windows. + +* gettext-runtime/intl/Makefile.am (OTHER_LDFLAGS): Add an -export-symbols-regex +option. +--- + gettext-runtime/intl/Makefile.in | 10 +++++++++- + gettext-runtime/intl/export.h | 2 ++ + gettext-tools/intl/Makefile.in | 10 +++++++++- + gettext-tools/libgettextpo/Makefile.in | 4 ++-- + gettext-tools/libgettextpo/exported.sh.in | 5 ++--- + gettext-tools/src/lang-table.h | 14 +++++++++++++- + gettext-tools/src/read-po.h | 14 +++++++++++++- + gettext-tools/src/read-properties.h | 14 +++++++++++++- + gettext-tools/src/read-stringtable.h | 14 +++++++++++++- + gettext-tools/src/write-properties.h | 14 +++++++++++++- + gettext-tools/src/write-stringtable.h | 14 +++++++++++++- + libtextstyle/lib/Makefile.in | 4 ++-- + 12 files changed, 104 insertions(+), 15 deletions(-) + +diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in +index fe59cd4aa..10aaa89fe 100644 +--- a/gettext-runtime/intl/Makefile.in ++++ b/gettext-runtime/intl/Makefile.in +@@ -1416,6 +1416,11 @@ libintl_la_DEPENDENCIES = $(WOE32_LIBADD) + libgnuintl_la_LIBADD = $(WOE32_LIBADD) + libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD) + ++# langprefs.c (_nl_language_preferences_win32_95) uses functions from ++# advapi32.dll. ++@WOE32_TRUE@INTL_WINDOWS_LIBS = -ladvapi32 ++@WOE32_FALSE@INTL_WINDOWS_LIBS = ++ + # Libtool's library version information for libintl. + # Before making a gettext release, you must change this according to the + # libtool documentation, section "Library interface versions". +@@ -1424,8 +1429,11 @@ LTV_REVISION = 6 + LTV_AGE = 1 + + # How to build libintl.la and libgnuintl.la. ++# Limit the exported symbols: Don't export glwthread* (from gnulib modules). + OTHER_LDFLAGS = \ +- @LTLIBICONV@ @INTL_MACOSX_LIBS@ @LTLIBTHREAD@ -no-undefined \ ++ @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \ ++ -no-undefined \ ++ -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) + +diff --git a/gettext-runtime/intl/export.h b/gettext-runtime/intl/export.h +index b5c47ad5b..10253e338 100644 +--- a/gettext-runtime/intl/export.h ++++ b/gettext-runtime/intl/export.h +@@ -1,6 +1,8 @@ + + #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL + #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBINTL ++#define LIBINTL_DLL_EXPORTED __declspec(dllexport) + #else + #define LIBINTL_DLL_EXPORTED + #endif +diff --git a/gettext-tools/intl/Makefile.in b/gettext-tools/intl/Makefile.in +index 9bdfe2238..6eabf22af 100644 +--- a/gettext-tools/intl/Makefile.in ++++ b/gettext-tools/intl/Makefile.in +@@ -2120,6 +2120,11 @@ libintl_la_DEPENDENCIES = $(WOE32_LIBADD) + libgnuintl_la_LIBADD = $(WOE32_LIBADD) + libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD) + ++# langprefs.c (_nl_language_preferences_win32_95) uses functions from ++# advapi32.dll. ++@WOE32_TRUE@INTL_WINDOWS_LIBS = -ladvapi32 ++@WOE32_FALSE@INTL_WINDOWS_LIBS = ++ + # Libtool's library version information for libintl. + # Before making a gettext release, you must change this according to the + # libtool documentation, section "Library interface versions". +@@ -2128,8 +2133,11 @@ LTV_REVISION = 6 + LTV_AGE = 1 + + # How to build libintl.la and libgnuintl.la. ++# Limit the exported symbols: Don't export glwthread* (from gnulib modules). + OTHER_LDFLAGS = \ +- @LTLIBICONV@ @INTL_MACOSX_LIBS@ @LTLIBTHREAD@ -no-undefined \ ++ @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \ ++ -no-undefined \ ++ -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) + +diff --git a/gettext-tools/libgettextpo/Makefile.in b/gettext-tools/libgettextpo/Makefile.in +index 59356fa1d..444ef7807 100644 +--- a/gettext-tools/libgettextpo/Makefile.in ++++ b/gettext-tools/libgettextpo/Makefile.in +@@ -2942,8 +2942,8 @@ config.h: $(BUILT_SOURCES) + ;; \ + esac; \ + done; \ +- } 5>&1 \ +- | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \ ++ } 5>&1 1>&2 \ ++ | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | sed -e 's,^obstack_free$$,__obstack_free,' \ + | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \ + if test -f config.h; then \ +diff --git a/gettext-tools/libgettextpo/exported.sh.in b/gettext-tools/libgettextpo/exported.sh.in +index 2e6b89ab6..be7fb38bd 100644 +--- a/gettext-tools/libgettextpo/exported.sh.in ++++ b/gettext-tools/libgettextpo/exported.sh.in +@@ -1,6 +1,6 @@ + #! /bin/sh + # +-# Copyright (C) 2006 Free Software Foundation, Inc. ++# Copyright (C) 2006, 2009, 2019 Free Software Foundation, Inc. + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -20,5 +20,4 @@ + # This is a separate script because $(GLOBAL_SYMBOL_PIPE) cannot be used in a + # Makefile, since it may contain dollar signs. + +-nm_cmd="@NM@ $1 | @GLOBAL_SYMBOL_PIPE@" +-eval $nm_cmd ++@NM@ "$1" | @GLOBAL_SYMBOL_PIPE@ +diff --git a/gettext-tools/src/lang-table.h b/gettext-tools/src/lang-table.h +index 7ac197669..ebf193b98 100644 +--- a/gettext-tools/src/lang-table.h ++++ b/gettext-tools/src/lang-table.h +@@ -1,5 +1,5 @@ + /* Table of languages. +- Copyright (C) 2001-2007 Free Software Foundation, Inc. ++ Copyright (C) 2001-2007, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2005. + + This program is free software: you can redistribute it and/or modify +@@ -20,6 +20,12 @@ + + #include + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + struct language_table_entry + { + const char *code; +@@ -32,4 +38,10 @@ extern const size_t language_table_size; + extern struct language_table_entry language_variant_table[]; + extern const size_t language_variant_table_size; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _LANG_TABLE_H */ +diff --git a/gettext-tools/src/read-po.h b/gettext-tools/src/read-po.h +index 6852a22a0..98fc893b2 100644 +--- a/gettext-tools/src/read-po.h ++++ b/gettext-tools/src/read-po.h +@@ -1,5 +1,5 @@ + /* Reading PO files. +- Copyright (C) 2006 Free Software Foundation, Inc. ++ Copyright (C) 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2006. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .po / .pot file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_po; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_PO_H */ +diff --git a/gettext-tools/src/read-properties.h b/gettext-tools/src/read-properties.h +index e04abe524..9c299e6c2 100644 +--- a/gettext-tools/src/read-properties.h ++++ b/gettext-tools/src/read-properties.h +@@ -1,5 +1,5 @@ + /* Reading Java .properties files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .properties file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_properties; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_PROPERTIES_H */ +diff --git a/gettext-tools/src/read-stringtable.h b/gettext-tools/src/read-stringtable.h +index 43d1ba505..4a107f2ff 100644 +--- a/gettext-tools/src/read-stringtable.h ++++ b/gettext-tools/src/read-stringtable.h +@@ -1,5 +1,5 @@ + /* Reading NeXTstep/GNUstep .strings files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "read-catalog-abstract.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a .strings file parser. */ + extern DLL_VARIABLE const struct catalog_input_format input_format_stringtable; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _READ_STRINGTABLE_H */ +diff --git a/gettext-tools/src/write-properties.h b/gettext-tools/src/write-properties.h +index f0d18a7e4..7671afb30 100644 +--- a/gettext-tools/src/write-properties.h ++++ b/gettext-tools/src/write-properties.h +@@ -1,5 +1,5 @@ + /* Writing Java .properties files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "write-catalog.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a PO file in Java .properties syntax. */ + extern DLL_VARIABLE const struct catalog_output_format output_format_properties; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _WRITE_PROPERTIES_H */ +diff --git a/gettext-tools/src/write-stringtable.h b/gettext-tools/src/write-stringtable.h +index 7d4981826..af0b081c8 100644 +--- a/gettext-tools/src/write-stringtable.h ++++ b/gettext-tools/src/write-stringtable.h +@@ -1,5 +1,5 @@ + /* Writing NeXTstep/GNUstep .strings files. +- Copyright (C) 2003, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify +@@ -20,7 +20,19 @@ + + #include "write-catalog.h" + ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ + /* Describes a PO file in .strings syntax. */ + extern DLL_VARIABLE const struct catalog_output_format output_format_stringtable; + ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ + #endif /* _WRITE_STRINGTABLE_H */ +diff --git a/libtextstyle/lib/Makefile.in b/libtextstyle/lib/Makefile.in +index 4a11d73a1..ebee4845a 100644 +--- a/libtextstyle/lib/Makefile.in ++++ b/libtextstyle/lib/Makefile.in +@@ -4536,8 +4536,8 @@ config.h: $(BUILT_SOURCES) libtextstyle.sym + ;; \ + esac; \ + done; \ +- } 5>&1 \ +- | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \ ++ } 5>&1 1>&2 \ ++ | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | LC_ALL=C join -v 1 - libtextstyle.sym \ + | sed -e 's,^\(.*\)$$,#define \1 libtextstyle_\1,' > config.h-t; \ + } 6>&1 && \ +-- +2.21.0.windows.1 + diff --git a/recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch b/recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch new file mode 100644 index 0000000..dbbf7b7 --- /dev/null +++ b/recipes/libgettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch @@ -0,0 +1,72 @@ +From 9b2e480278d36c4d7b6f988621a3a9f699cc730f Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 10 Jul 2019 03:55:56 -0700 +Subject: [PATCH 2/2] - memmove is intrinsic function on MSVC + +Signed-off-by: SSE4 +--- + gettext-runtime/gnulib-lib/memmove.c | 4 ++++ + gettext-tools/gnulib-lib/memmove.c | 4 ++++ + gettext-tools/gnulib-lib/memset.c | 4 ++++ + 3 files changed, 12 insertions(+) + +diff --git a/gettext-runtime/gnulib-lib/memmove.c b/gettext-runtime/gnulib-lib/memmove.c +index 0f040540c..bc8883ae4 100644 +--- a/gettext-runtime/gnulib-lib/memmove.c ++++ b/gettext-runtime/gnulib-lib/memmove.c +@@ -7,6 +7,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memmove (void *dest0, void const *source0, size_t length) + { +@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) + } + return dest0; + } ++ ++#endif +diff --git a/gettext-tools/gnulib-lib/memmove.c b/gettext-tools/gnulib-lib/memmove.c +index 0f040540c..bc8883ae4 100644 +--- a/gettext-tools/gnulib-lib/memmove.c ++++ b/gettext-tools/gnulib-lib/memmove.c +@@ -7,6 +7,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memmove (void *dest0, void const *source0, size_t length) + { +@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) + } + return dest0; + } ++ ++#endif +diff --git a/gettext-tools/gnulib-lib/memset.c b/gettext-tools/gnulib-lib/memset.c +index 4e60124e7..b595fa966 100644 +--- a/gettext-tools/gnulib-lib/memset.c ++++ b/gettext-tools/gnulib-lib/memset.c +@@ -18,6 +18,8 @@ + + #include + ++#ifndef _MSC_VER ++ + void * + memset (void *str, int c, size_t len) + { +@@ -27,3 +29,5 @@ memset (void *str, int c, size_t len) + *st++ = c; + return str; + } ++ ++#endif +-- +2.21.0.windows.1 + diff --git a/recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch b/recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch new file mode 100644 index 0000000..f5e7045 --- /dev/null +++ b/recipes/libgettext/all/patches/0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch @@ -0,0 +1,29 @@ +From e81ca090d69837e4f1a3c41fe2345c77b38f756a Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Fri, 12 Jul 2019 13:11:06 +0200 +Subject: [PATCH 3/3] Reported by Gabor Z. Papp . + +This is a regression from 2018-11-25. + +* gettext-tools/configure.ac (PRELOADABLE_LIBINTL): Set to false if +--disable-shared was specified. +--- + gettext-tools/configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gettext-tools/configure b/gettext-tools/configure +index 5a831d6da..4be36c383 100755 +--- a/gettext-tools/configure ++++ b/gettext-tools/configure +@@ -23901,7 +23901,7 @@ else + PACKAGE_IS_GETTEXT_TOOLS_FALSE= + fi + +- if test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes; then ++ if test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test $enable_shared = yes; then + PRELOADABLE_LIBINTL_TRUE= + PRELOADABLE_LIBINTL_FALSE='#' + else +-- +2.21.0 + diff --git a/recipes/libgettext/all/test_package/CMakeLists.txt b/recipes/libgettext/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..1ef1f4a --- /dev/null +++ b/recipes/libgettext/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(Intl CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Intl::Intl) diff --git a/recipes/libgettext/all/test_package/CMakeUserPresets.json b/recipes/libgettext/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..61fc9e2 --- /dev/null +++ b/recipes/libgettext/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libgettext/all/test_package/conanfile.py b/recipes/libgettext/all/test_package/conanfile.py new file mode 100644 index 0000000..50e1b26 --- /dev/null +++ b/recipes/libgettext/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +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" + test_type = "explicit" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + 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.bindirs[0], "test_package") + self.run(bin_path, env=f"conanrun") diff --git a/recipes/libgettext/all/test_package/test_package.c b/recipes/libgettext/all/test_package/test_package.c new file mode 100644 index 0000000..262221a --- /dev/null +++ b/recipes/libgettext/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main() { + gettext("Hello, world!"); + + return 0; +} diff --git a/recipes/libgettext/config.yml b/recipes/libgettext/config.yml new file mode 100644 index 0000000..c7ed4b0 --- /dev/null +++ b/recipes/libgettext/config.yml @@ -0,0 +1,7 @@ +versions: + "0.22": + folder: all + "0.21": + folder: all + "0.20.1": + folder: all diff --git a/recipes/libmount/all/conandata.yml b/recipes/libmount/all/conandata.yml new file mode 100644 index 0000000..f17eba3 --- /dev/null +++ b/recipes/libmount/all/conandata.yml @@ -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" diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py new file mode 100644 index 0000000..ea963a9 --- /dev/null +++ b/recipes/libmount/all/conanfile.py @@ -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"] diff --git a/recipes/libmount/all/test_package/CMakeLists.txt b/recipes/libmount/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..79b7610 --- /dev/null +++ b/recipes/libmount/all/test_package/CMakeLists.txt @@ -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) diff --git a/recipes/libmount/all/test_package/CMakeUserPresets.json b/recipes/libmount/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/libmount/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libmount/all/test_package/conanfile.py b/recipes/libmount/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/recipes/libmount/all/test_package/conanfile.py @@ -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") diff --git a/recipes/libmount/all/test_package/test_package.c b/recipes/libmount/all/test_package/test_package.c new file mode 100644 index 0000000..d4e4d65 --- /dev/null +++ b/recipes/libmount/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include + +#include +#include + +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; +} diff --git a/recipes/libmount/config.yml b/recipes/libmount/config.yml new file mode 100644 index 0000000..d10bf81 --- /dev/null +++ b/recipes/libmount/config.yml @@ -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 diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml new file mode 100644 index 0000000..3c27db6 --- /dev/null +++ b/recipes/libselinux/all/conandata.yml @@ -0,0 +1,64 @@ +sources: + "3.6": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.6/libselinux-3.6.tar.gz" + sha256: "ba4e0ef34b270e7672a5e5f1b523fe2beab3a40bb33d9389f4ad3a8728f21b52" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.6/libsepol-3.6.tar.gz" + sha256: "c9dc585ea94903d784d597c861cd5dce6459168f95e22b31a0eab1cdd800975a" + "3.5": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.5/libselinux-3.5.tar.gz" + sha256: "9a3a3705ac13a2ccca2de6d652b6356fead10f36fb33115c185c5ccdf29eec19" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.5/libsepol-3.5.tar.gz" + sha256: "78fdaf69924db780bac78546e43d9c44074bad798c2c415d0b9bb96d065ee8a2" + "3.3": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.3/libselinux-3.3.tar.gz" + sha256: "acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.3/libsepol-3.3.tar.gz" + sha256: "2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b" + "3.2": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.2/libselinux-3.2.tar.gz" + sha256: "df758ef1d9d4811051dd901ea6b029ae334ffd7c671c128beb16bce1e25ac161" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/3.2/libsepol-3.2.tar.gz" + sha256: "dfc7f662af8000116e56a01de6a0394ed79be1b34b999e551346233c5dd19508" + "3.1": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/20200710/libselinux-3.1.tar.gz" + sha256: "ea5dcbb4d859e3f999c26a13c630da2f16dff9462e3cc8cb7b458ac157d112e7" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/20200710/libsepol-3.1.tar.gz" + sha256: "ae6778d01443fdd38cd30eeee846494e19f4d407b09872580372f4aa4bf8a3cc" + "3.0": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/20191204/libselinux-3.0.tar.gz" + sha256: "2ea2b30f671dae9d6b1391cbe8fb2ce5d36a3ee4fb1cd3c32f0d933c31b82433" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/20191204/libsepol-3.0.tar.gz" + sha256: "5b7ae1881909f1048b06f7a0c364c5c8a86ec12e0ec76e740fe9595a6033eb79" + "2.9": + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/20190315/libselinux-2.9.tar.gz" + sha256: "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693" + - url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/SELinuxProject/selinux/releases/download/20190315/libsepol-2.9.tar.gz" + sha256: "a34b12b038d121e3e459b1cbaca3c9202e983137819c16baf63658390e3f1d5d" +patches: + "3.6": + - patch_file: patches/0003-fix-missing-include-3.6.patch + base_path: libselinux-3.6 + patch_description: "Fix a missing #include " + patch_type: "portability" + - patch_file: patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch + patch_description: "libsepol/src/Makefile: fix reallocarray detection" + patch_source: "https://lore.kernel.org/selinux/20240108210314.339682-1-fontaine.fabrice@gmail.com/" + patch_type: "portability" + base_path: libsepol-3.6 + - patch_file: patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch + patch_description: "libselinux, libsepol: Add CFLAGS and LDFLAGS to Makefile checks" + patch_source: "https://lore.kernel.org/selinux/20240313224806.2859045-1-jwcart2@gmail.com/T/#u" + patch_type: "portability" + "3.3": + - patch_file: patches/0003-fix-link-pcre.patch + base_path: libselinux-3.3 + "3.0": + - patch_file: patches/0001-fix-fno-common-3.0.patch + base_path: libsepol-3.0 + - patch_file: patches/0002-remove-cil_mem_error_handler.patch + base_path: libsepol-3.0 + "2.9": + - patch_file: patches/0001-fix-fno-common-2.9.patch + base_path: libsepol-2.9 + - patch_file: patches/0002-remove-cil_mem_error_handler.patch + base_path: libsepol-2.9 diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py new file mode 100644 index 0000000..84afac2 --- /dev/null +++ b/recipes/libselinux/all/conanfile.py @@ -0,0 +1,139 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class LibSELinuxConan(ConanFile): + name = "libselinux" + description = ( + "Security-enhanced Linux is a patch of the Linux kernel and a number " + "of utilities with enhanced security functionality designed to add " + "mandatory access controls to Linux" + ) + topics = ("linux", "selinux", "security", "security-enhanced") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SELinuxProject/selinux" + license = ( + # https://github.com/SELinuxProject/selinux/blob/main/libselinux/LICENSE + # For the libselinux component: public domain with a limited liability clause + "libselinux-1.0", + # https://github.com/SELinuxProject/selinux/blob/main/libsepol/LICENSE + # For the libsepol component: LGPL-2.1 + "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 export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("pcre2/[>=10.43]") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") + + def build_requirements(self): + self.tool_requires("flex/2.6.4") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.2.0") + + def source(self): + for download in self.conan_data["sources"][self.version]: + get(self, **download) + + @property + def _sepol_source_folder(self): + return os.path.join(self.source_folder, f"libsepol-{self.version}") + + @property + def _selinux_source_folder(self): + return os.path.join(self.source_folder, f"libselinux-{self.version}") + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + tc = AutotoolsToolchain(self) + sepol_include_folder = os.path.join(self._sepol_source_folder, "include") + tc.extra_cflags.append(f"-I{sepol_include_folder}") + sepol_lib_folder = os.path.join(self._sepol_source_folder, "src") + tc.extra_ldflags.append(f"-L{sepol_lib_folder}") + tc.make_args.append("USE_PCRE2=y") + env = tc.environment() + if cross_building(self): + env.append_path("PKG_CONFIG_LIBDIR", self.generators_folder) + tc.generate(env=env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + for subdir in [self._sepol_source_folder, self._selinux_source_folder]: + with chdir(self, subdir): + # Build only .a or .so, not both + replace_in_file(self, os.path.join("src", "Makefile"), + "all: $(LIBA) $(LIBSO) $(LIBPC)", + "all: $(LIBSO)" if self.options.shared else "all: $(LIBA)") + # Skip utils dir by truncating its Makefile + save(self, os.path.join("utils", "Makefile"), "all:\n") + autotools.make() + + def _copy_licenses(self): + copy(self, "LICENSE", self._selinux_source_folder, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "LICENSE"), + os.path.join(self.package_folder, "licenses", "LICENSE-libselinux")) + if Version(self.version) >= "3.5": + copy(self, "LICENSE", self._sepol_source_folder, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "LICENSE"), + os.path.join(self.package_folder, "licenses", "LICENSE-libsepol")) + else: + copy(self, "COPYING", self._sepol_source_folder, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), + os.path.join(self.package_folder, "licenses", "LICENSE-libsepol")) + + def package(self): + self._copy_licenses() + for library in [self._sepol_source_folder, self._selinux_source_folder]: + copy(self, "*.h", os.path.join(library, "include"), os.path.join(self.package_folder, "include")) + if self.options.shared: + copy(self, "*.so*", library, os.path.join(self.package_folder, "lib"), keep_path=False) + else: + copy(self, "*.a", library, os.path.join(self.package_folder, "lib"), keep_path=False) + + def package_info(self): + self.cpp_info.components["selinux"].set_property("pkg_config_name", "libselinux") + self.cpp_info.components["selinux"].libs = ["selinux"] + self.cpp_info.components["selinux"].requires = ["sepol", "pcre2::pcre2"] + if self.options.shared: + self.cpp_info.components["selinux"].system_libs = ["dl"] + + self.cpp_info.components["sepol"].set_property("pkg_config_name", "libsepol") + self.cpp_info.components["sepol"].libs = ["sepol"] diff --git a/recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch b/recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch new file mode 100644 index 0000000..7235c6c --- /dev/null +++ b/recipes/libselinux/all/patches/0001-fix-fno-common-2.9.patch @@ -0,0 +1,507 @@ +libsepol: fix CIL_KEY_* build errors with -fno-common + +GCC 10 comes with -fno-common enabled by default - fix the CIL_KEY_* +global variables to be defined only once in cil.c and declared in the +header file correctly with the 'extern' keyword, so that other units +including the file don't generate duplicate definitions. + +see https://github.com/SELinuxProject/selinux/commit/a96e8c59ecac84096d870b42701a504791a8cc8c + +--- a/cil/src/cil.c ++++ b/cil/src/cil.c +@@ -77,6 +77,167 @@ int cil_sym_sizes[CIL_SYM_ARRAY_NUM][CIL_SYM_NUM] = { + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + }; + ++char *CIL_KEY_CONS_T1; ++char *CIL_KEY_CONS_T2; ++char *CIL_KEY_CONS_T3; ++char *CIL_KEY_CONS_R1; ++char *CIL_KEY_CONS_R2; ++char *CIL_KEY_CONS_R3; ++char *CIL_KEY_CONS_U1; ++char *CIL_KEY_CONS_U2; ++char *CIL_KEY_CONS_U3; ++char *CIL_KEY_CONS_L1; ++char *CIL_KEY_CONS_L2; ++char *CIL_KEY_CONS_H1; ++char *CIL_KEY_CONS_H2; ++char *CIL_KEY_AND; ++char *CIL_KEY_OR; ++char *CIL_KEY_NOT; ++char *CIL_KEY_EQ; ++char *CIL_KEY_NEQ; ++char *CIL_KEY_CONS_DOM; ++char *CIL_KEY_CONS_DOMBY; ++char *CIL_KEY_CONS_INCOMP; ++char *CIL_KEY_CONDTRUE; ++char *CIL_KEY_CONDFALSE; ++char *CIL_KEY_SELF; ++char *CIL_KEY_OBJECT_R; ++char *CIL_KEY_STAR; ++char *CIL_KEY_TCP; ++char *CIL_KEY_UDP; ++char *CIL_KEY_DCCP; ++char *CIL_KEY_SCTP; ++char *CIL_KEY_AUDITALLOW; ++char *CIL_KEY_TUNABLEIF; ++char *CIL_KEY_ALLOW; ++char *CIL_KEY_DONTAUDIT; ++char *CIL_KEY_TYPETRANSITION; ++char *CIL_KEY_TYPECHANGE; ++char *CIL_KEY_CALL; ++char *CIL_KEY_TUNABLE; ++char *CIL_KEY_XOR; ++char *CIL_KEY_ALL; ++char *CIL_KEY_RANGE; ++char *CIL_KEY_GLOB; ++char *CIL_KEY_FILE; ++char *CIL_KEY_DIR; ++char *CIL_KEY_CHAR; ++char *CIL_KEY_BLOCK; ++char *CIL_KEY_SOCKET; ++char *CIL_KEY_PIPE; ++char *CIL_KEY_SYMLINK; ++char *CIL_KEY_ANY; ++char *CIL_KEY_XATTR; ++char *CIL_KEY_TASK; ++char *CIL_KEY_TRANS; ++char *CIL_KEY_TYPE; ++char *CIL_KEY_ROLE; ++char *CIL_KEY_USER; ++char *CIL_KEY_USERATTRIBUTE; ++char *CIL_KEY_USERATTRIBUTESET; ++char *CIL_KEY_SENSITIVITY; ++char *CIL_KEY_CATEGORY; ++char *CIL_KEY_CATSET; ++char *CIL_KEY_LEVEL; ++char *CIL_KEY_LEVELRANGE; ++char *CIL_KEY_CLASS; ++char *CIL_KEY_IPADDR; ++char *CIL_KEY_MAP_CLASS; ++char *CIL_KEY_CLASSPERMISSION; ++char *CIL_KEY_BOOL; ++char *CIL_KEY_STRING; ++char *CIL_KEY_NAME; ++char *CIL_KEY_SOURCE; ++char *CIL_KEY_TARGET; ++char *CIL_KEY_LOW; ++char *CIL_KEY_HIGH; ++char *CIL_KEY_LOW_HIGH; ++char *CIL_KEY_HANDLEUNKNOWN; ++char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++char *CIL_KEY_HANDLEUNKNOWN_DENY; ++char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++char *CIL_KEY_MACRO; ++char *CIL_KEY_IN; ++char *CIL_KEY_MLS; ++char *CIL_KEY_DEFAULTRANGE; ++char *CIL_KEY_BLOCKINHERIT; ++char *CIL_KEY_BLOCKABSTRACT; ++char *CIL_KEY_CLASSORDER; ++char *CIL_KEY_CLASSMAPPING; ++char *CIL_KEY_CLASSPERMISSIONSET; ++char *CIL_KEY_COMMON; ++char *CIL_KEY_CLASSCOMMON; ++char *CIL_KEY_SID; ++char *CIL_KEY_SIDCONTEXT; ++char *CIL_KEY_SIDORDER; ++char *CIL_KEY_USERLEVEL; ++char *CIL_KEY_USERRANGE; ++char *CIL_KEY_USERBOUNDS; ++char *CIL_KEY_USERPREFIX; ++char *CIL_KEY_SELINUXUSER; ++char *CIL_KEY_SELINUXUSERDEFAULT; ++char *CIL_KEY_TYPEATTRIBUTE; ++char *CIL_KEY_TYPEATTRIBUTESET; ++char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++char *CIL_KEY_TYPEALIAS; ++char *CIL_KEY_TYPEALIASACTUAL; ++char *CIL_KEY_TYPEBOUNDS; ++char *CIL_KEY_TYPEPERMISSIVE; ++char *CIL_KEY_RANGETRANSITION; ++char *CIL_KEY_USERROLE; ++char *CIL_KEY_ROLETYPE; ++char *CIL_KEY_ROLETRANSITION; ++char *CIL_KEY_ROLEALLOW; ++char *CIL_KEY_ROLEATTRIBUTE; ++char *CIL_KEY_ROLEATTRIBUTESET; ++char *CIL_KEY_ROLEBOUNDS; ++char *CIL_KEY_BOOLEANIF; ++char *CIL_KEY_NEVERALLOW; ++char *CIL_KEY_TYPEMEMBER; ++char *CIL_KEY_SENSALIAS; ++char *CIL_KEY_SENSALIASACTUAL; ++char *CIL_KEY_CATALIAS; ++char *CIL_KEY_CATALIASACTUAL; ++char *CIL_KEY_CATORDER; ++char *CIL_KEY_SENSITIVITYORDER; ++char *CIL_KEY_SENSCAT; ++char *CIL_KEY_CONSTRAIN; ++char *CIL_KEY_MLSCONSTRAIN; ++char *CIL_KEY_VALIDATETRANS; ++char *CIL_KEY_MLSVALIDATETRANS; ++char *CIL_KEY_CONTEXT; ++char *CIL_KEY_FILECON; ++char *CIL_KEY_IBPKEYCON; ++char *CIL_KEY_IBENDPORTCON; ++char *CIL_KEY_PORTCON; ++char *CIL_KEY_NODECON; ++char *CIL_KEY_GENFSCON; ++char *CIL_KEY_NETIFCON; ++char *CIL_KEY_PIRQCON; ++char *CIL_KEY_IOMEMCON; ++char *CIL_KEY_IOPORTCON; ++char *CIL_KEY_PCIDEVICECON; ++char *CIL_KEY_DEVICETREECON; ++char *CIL_KEY_FSUSE; ++char *CIL_KEY_POLICYCAP; ++char *CIL_KEY_OPTIONAL; ++char *CIL_KEY_DEFAULTUSER; ++char *CIL_KEY_DEFAULTROLE; ++char *CIL_KEY_DEFAULTTYPE; ++char *CIL_KEY_ROOT; ++char *CIL_KEY_NODE; ++char *CIL_KEY_PERM; ++char *CIL_KEY_ALLOWX; ++char *CIL_KEY_AUDITALLOWX; ++char *CIL_KEY_DONTAUDITX; ++char *CIL_KEY_NEVERALLOWX; ++char *CIL_KEY_PERMISSIONX; ++char *CIL_KEY_IOCTL; ++char *CIL_KEY_UNORDERED; ++char *CIL_KEY_SRC_INFO; ++char *CIL_KEY_SRC_CIL; ++char *CIL_KEY_SRC_HLL; ++ + static void cil_init_keys(void) + { + /* Initialize CIL Keys into strpool */ +--- a/cil/src/cil_internal.h ++++ b/cil/src/cil_internal.h +@@ -74,165 +74,325 @@ enum cil_pass { + /* + Keywords + */ ++extern + char *CIL_KEY_CONS_T1; ++extern + char *CIL_KEY_CONS_T2; ++extern + char *CIL_KEY_CONS_T3; ++extern + char *CIL_KEY_CONS_R1; ++extern + char *CIL_KEY_CONS_R2; ++extern + char *CIL_KEY_CONS_R3; ++extern + char *CIL_KEY_CONS_U1; ++extern + char *CIL_KEY_CONS_U2; ++extern + char *CIL_KEY_CONS_U3; ++extern + char *CIL_KEY_CONS_L1; ++extern + char *CIL_KEY_CONS_L2; ++extern + char *CIL_KEY_CONS_H1; ++extern + char *CIL_KEY_CONS_H2; ++extern + char *CIL_KEY_AND; ++extern + char *CIL_KEY_OR; ++extern + char *CIL_KEY_NOT; ++extern + char *CIL_KEY_EQ; ++extern + char *CIL_KEY_NEQ; ++extern + char *CIL_KEY_CONS_DOM; ++extern + char *CIL_KEY_CONS_DOMBY; ++extern + char *CIL_KEY_CONS_INCOMP; ++extern + char *CIL_KEY_CONDTRUE; ++extern + char *CIL_KEY_CONDFALSE; ++extern + char *CIL_KEY_SELF; ++extern + char *CIL_KEY_OBJECT_R; ++extern + char *CIL_KEY_STAR; ++extern + char *CIL_KEY_TCP; ++extern + char *CIL_KEY_UDP; ++extern + char *CIL_KEY_DCCP; ++extern + char *CIL_KEY_SCTP; ++extern + char *CIL_KEY_AUDITALLOW; ++extern + char *CIL_KEY_TUNABLEIF; ++extern + char *CIL_KEY_ALLOW; ++extern + char *CIL_KEY_DONTAUDIT; ++extern + char *CIL_KEY_TYPETRANSITION; ++extern + char *CIL_KEY_TYPECHANGE; ++extern + char *CIL_KEY_CALL; ++extern + char *CIL_KEY_TUNABLE; ++extern + char *CIL_KEY_XOR; ++extern + char *CIL_KEY_ALL; ++extern + char *CIL_KEY_RANGE; ++extern + char *CIL_KEY_GLOB; ++extern + char *CIL_KEY_FILE; ++extern + char *CIL_KEY_DIR; ++extern + char *CIL_KEY_CHAR; ++extern + char *CIL_KEY_BLOCK; ++extern + char *CIL_KEY_SOCKET; ++extern + char *CIL_KEY_PIPE; ++extern + char *CIL_KEY_SYMLINK; ++extern + char *CIL_KEY_ANY; ++extern + char *CIL_KEY_XATTR; ++extern + char *CIL_KEY_TASK; ++extern + char *CIL_KEY_TRANS; ++extern + char *CIL_KEY_TYPE; ++extern + char *CIL_KEY_ROLE; ++extern + char *CIL_KEY_USER; ++extern + char *CIL_KEY_USERATTRIBUTE; ++extern + char *CIL_KEY_USERATTRIBUTESET; ++extern + char *CIL_KEY_SENSITIVITY; ++extern + char *CIL_KEY_CATEGORY; ++extern + char *CIL_KEY_CATSET; ++extern + char *CIL_KEY_LEVEL; ++extern + char *CIL_KEY_LEVELRANGE; ++extern + char *CIL_KEY_CLASS; ++extern + char *CIL_KEY_IPADDR; ++extern + char *CIL_KEY_MAP_CLASS; ++extern + char *CIL_KEY_CLASSPERMISSION; ++extern + char *CIL_KEY_BOOL; ++extern + char *CIL_KEY_STRING; ++extern + char *CIL_KEY_NAME; ++extern + char *CIL_KEY_SOURCE; ++extern + char *CIL_KEY_TARGET; ++extern + char *CIL_KEY_LOW; ++extern + char *CIL_KEY_HIGH; ++extern + char *CIL_KEY_LOW_HIGH; ++extern + char *CIL_KEY_HANDLEUNKNOWN; ++extern + char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++extern + char *CIL_KEY_HANDLEUNKNOWN_DENY; ++extern + char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++extern + char *CIL_KEY_MACRO; ++extern + char *CIL_KEY_IN; ++extern + char *CIL_KEY_MLS; ++extern + char *CIL_KEY_DEFAULTRANGE; ++extern + char *CIL_KEY_BLOCKINHERIT; ++extern + char *CIL_KEY_BLOCKABSTRACT; ++extern + char *CIL_KEY_CLASSORDER; ++extern + char *CIL_KEY_CLASSMAPPING; ++extern + char *CIL_KEY_CLASSPERMISSIONSET; ++extern + char *CIL_KEY_COMMON; ++extern + char *CIL_KEY_CLASSCOMMON; ++extern + char *CIL_KEY_SID; ++extern + char *CIL_KEY_SIDCONTEXT; ++extern + char *CIL_KEY_SIDORDER; ++extern + char *CIL_KEY_USERLEVEL; ++extern + char *CIL_KEY_USERRANGE; ++extern + char *CIL_KEY_USERBOUNDS; ++extern + char *CIL_KEY_USERPREFIX; ++extern + char *CIL_KEY_SELINUXUSER; ++extern + char *CIL_KEY_SELINUXUSERDEFAULT; ++extern + char *CIL_KEY_TYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEATTRIBUTESET; ++extern + char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEALIAS; ++extern + char *CIL_KEY_TYPEALIASACTUAL; ++extern + char *CIL_KEY_TYPEBOUNDS; ++extern + char *CIL_KEY_TYPEPERMISSIVE; ++extern + char *CIL_KEY_RANGETRANSITION; ++extern + char *CIL_KEY_USERROLE; ++extern + char *CIL_KEY_ROLETYPE; ++extern + char *CIL_KEY_ROLETRANSITION; ++extern + char *CIL_KEY_ROLEALLOW; ++extern + char *CIL_KEY_ROLEATTRIBUTE; ++extern + char *CIL_KEY_ROLEATTRIBUTESET; ++extern + char *CIL_KEY_ROLEBOUNDS; ++extern + char *CIL_KEY_BOOLEANIF; ++extern + char *CIL_KEY_NEVERALLOW; ++extern + char *CIL_KEY_TYPEMEMBER; ++extern + char *CIL_KEY_SENSALIAS; ++extern + char *CIL_KEY_SENSALIASACTUAL; ++extern + char *CIL_KEY_CATALIAS; ++extern + char *CIL_KEY_CATALIASACTUAL; ++extern + char *CIL_KEY_CATORDER; ++extern + char *CIL_KEY_SENSITIVITYORDER; ++extern + char *CIL_KEY_SENSCAT; ++extern + char *CIL_KEY_CONSTRAIN; ++extern + char *CIL_KEY_MLSCONSTRAIN; ++extern + char *CIL_KEY_VALIDATETRANS; ++extern + char *CIL_KEY_MLSVALIDATETRANS; ++extern + char *CIL_KEY_CONTEXT; ++extern + char *CIL_KEY_FILECON; ++extern + char *CIL_KEY_IBPKEYCON; ++extern + char *CIL_KEY_IBENDPORTCON; ++extern + char *CIL_KEY_PORTCON; ++extern + char *CIL_KEY_NODECON; ++extern + char *CIL_KEY_GENFSCON; ++extern + char *CIL_KEY_NETIFCON; ++extern + char *CIL_KEY_PIRQCON; ++extern + char *CIL_KEY_IOMEMCON; ++extern + char *CIL_KEY_IOPORTCON; ++extern + char *CIL_KEY_PCIDEVICECON; ++extern + char *CIL_KEY_DEVICETREECON; ++extern + char *CIL_KEY_FSUSE; ++extern + char *CIL_KEY_POLICYCAP; ++extern + char *CIL_KEY_OPTIONAL; ++extern + char *CIL_KEY_DEFAULTUSER; ++extern + char *CIL_KEY_DEFAULTROLE; ++extern + char *CIL_KEY_DEFAULTTYPE; ++extern + char *CIL_KEY_ROOT; ++extern + char *CIL_KEY_NODE; ++extern + char *CIL_KEY_PERM; ++extern + char *CIL_KEY_ALLOWX; ++extern + char *CIL_KEY_AUDITALLOWX; ++extern + char *CIL_KEY_DONTAUDITX; ++extern + char *CIL_KEY_NEVERALLOWX; ++extern + char *CIL_KEY_PERMISSIONX; ++extern + char *CIL_KEY_IOCTL; ++extern + char *CIL_KEY_UNORDERED; ++extern + char *CIL_KEY_SRC_INFO; ++extern + char *CIL_KEY_SRC_CIL; ++extern + char *CIL_KEY_SRC_HLL; + + /* diff --git a/recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch b/recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch new file mode 100644 index 0000000..91052fa --- /dev/null +++ b/recipes/libselinux/all/patches/0001-fix-fno-common-3.0.patch @@ -0,0 +1,510 @@ +libsepol: fix CIL_KEY_* build errors with -fno-common + +GCC 10 comes with -fno-common enabled by default - fix the CIL_KEY_* +global variables to be defined only once in cil.c and declared in the +header file correctly with the 'extern' keyword, so that other units +including the file don't generate duplicate definitions. + +see https://github.com/SELinuxProject/selinux/commit/a96e8c59ecac84096d870b42701a504791a8cc8c + +--- a/cil/src/cil.c ++++ b/cil/src/cil.c +@@ -77,6 +77,168 @@ int cil_sym_sizes[CIL_SYM_ARRAY_NUM][CIL_SYM_NUM] = { + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + }; + ++char *CIL_KEY_CONS_T1; ++char *CIL_KEY_CONS_T2; ++char *CIL_KEY_CONS_T3; ++char *CIL_KEY_CONS_R1; ++char *CIL_KEY_CONS_R2; ++char *CIL_KEY_CONS_R3; ++char *CIL_KEY_CONS_U1; ++char *CIL_KEY_CONS_U2; ++char *CIL_KEY_CONS_U3; ++char *CIL_KEY_CONS_L1; ++char *CIL_KEY_CONS_L2; ++char *CIL_KEY_CONS_H1; ++char *CIL_KEY_CONS_H2; ++char *CIL_KEY_AND; ++char *CIL_KEY_OR; ++char *CIL_KEY_NOT; ++char *CIL_KEY_EQ; ++char *CIL_KEY_NEQ; ++char *CIL_KEY_CONS_DOM; ++char *CIL_KEY_CONS_DOMBY; ++char *CIL_KEY_CONS_INCOMP; ++char *CIL_KEY_CONDTRUE; ++char *CIL_KEY_CONDFALSE; ++char *CIL_KEY_SELF; ++char *CIL_KEY_OBJECT_R; ++char *CIL_KEY_STAR; ++char *CIL_KEY_TCP; ++char *CIL_KEY_UDP; ++char *CIL_KEY_DCCP; ++char *CIL_KEY_SCTP; ++char *CIL_KEY_AUDITALLOW; ++char *CIL_KEY_TUNABLEIF; ++char *CIL_KEY_ALLOW; ++char *CIL_KEY_DONTAUDIT; ++char *CIL_KEY_TYPETRANSITION; ++char *CIL_KEY_TYPECHANGE; ++char *CIL_KEY_CALL; ++char *CIL_KEY_TUNABLE; ++char *CIL_KEY_XOR; ++char *CIL_KEY_ALL; ++char *CIL_KEY_RANGE; ++char *CIL_KEY_GLOB; ++char *CIL_KEY_FILE; ++char *CIL_KEY_DIR; ++char *CIL_KEY_CHAR; ++char *CIL_KEY_BLOCK; ++char *CIL_KEY_SOCKET; ++char *CIL_KEY_PIPE; ++char *CIL_KEY_SYMLINK; ++char *CIL_KEY_ANY; ++char *CIL_KEY_XATTR; ++char *CIL_KEY_TASK; ++char *CIL_KEY_TRANS; ++char *CIL_KEY_TYPE; ++char *CIL_KEY_ROLE; ++char *CIL_KEY_USER; ++char *CIL_KEY_USERATTRIBUTE; ++char *CIL_KEY_USERATTRIBUTESET; ++char *CIL_KEY_SENSITIVITY; ++char *CIL_KEY_CATEGORY; ++char *CIL_KEY_CATSET; ++char *CIL_KEY_LEVEL; ++char *CIL_KEY_LEVELRANGE; ++char *CIL_KEY_CLASS; ++char *CIL_KEY_IPADDR; ++char *CIL_KEY_MAP_CLASS; ++char *CIL_KEY_CLASSPERMISSION; ++char *CIL_KEY_BOOL; ++char *CIL_KEY_STRING; ++char *CIL_KEY_NAME; ++char *CIL_KEY_SOURCE; ++char *CIL_KEY_TARGET; ++char *CIL_KEY_LOW; ++char *CIL_KEY_HIGH; ++char *CIL_KEY_LOW_HIGH; ++char *CIL_KEY_GLBLUB; ++char *CIL_KEY_HANDLEUNKNOWN; ++char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++char *CIL_KEY_HANDLEUNKNOWN_DENY; ++char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++char *CIL_KEY_MACRO; ++char *CIL_KEY_IN; ++char *CIL_KEY_MLS; ++char *CIL_KEY_DEFAULTRANGE; ++char *CIL_KEY_BLOCKINHERIT; ++char *CIL_KEY_BLOCKABSTRACT; ++char *CIL_KEY_CLASSORDER; ++char *CIL_KEY_CLASSMAPPING; ++char *CIL_KEY_CLASSPERMISSIONSET; ++char *CIL_KEY_COMMON; ++char *CIL_KEY_CLASSCOMMON; ++char *CIL_KEY_SID; ++char *CIL_KEY_SIDCONTEXT; ++char *CIL_KEY_SIDORDER; ++char *CIL_KEY_USERLEVEL; ++char *CIL_KEY_USERRANGE; ++char *CIL_KEY_USERBOUNDS; ++char *CIL_KEY_USERPREFIX; ++char *CIL_KEY_SELINUXUSER; ++char *CIL_KEY_SELINUXUSERDEFAULT; ++char *CIL_KEY_TYPEATTRIBUTE; ++char *CIL_KEY_TYPEATTRIBUTESET; ++char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++char *CIL_KEY_TYPEALIAS; ++char *CIL_KEY_TYPEALIASACTUAL; ++char *CIL_KEY_TYPEBOUNDS; ++char *CIL_KEY_TYPEPERMISSIVE; ++char *CIL_KEY_RANGETRANSITION; ++char *CIL_KEY_USERROLE; ++char *CIL_KEY_ROLETYPE; ++char *CIL_KEY_ROLETRANSITION; ++char *CIL_KEY_ROLEALLOW; ++char *CIL_KEY_ROLEATTRIBUTE; ++char *CIL_KEY_ROLEATTRIBUTESET; ++char *CIL_KEY_ROLEBOUNDS; ++char *CIL_KEY_BOOLEANIF; ++char *CIL_KEY_NEVERALLOW; ++char *CIL_KEY_TYPEMEMBER; ++char *CIL_KEY_SENSALIAS; ++char *CIL_KEY_SENSALIASACTUAL; ++char *CIL_KEY_CATALIAS; ++char *CIL_KEY_CATALIASACTUAL; ++char *CIL_KEY_CATORDER; ++char *CIL_KEY_SENSITIVITYORDER; ++char *CIL_KEY_SENSCAT; ++char *CIL_KEY_CONSTRAIN; ++char *CIL_KEY_MLSCONSTRAIN; ++char *CIL_KEY_VALIDATETRANS; ++char *CIL_KEY_MLSVALIDATETRANS; ++char *CIL_KEY_CONTEXT; ++char *CIL_KEY_FILECON; ++char *CIL_KEY_IBPKEYCON; ++char *CIL_KEY_IBENDPORTCON; ++char *CIL_KEY_PORTCON; ++char *CIL_KEY_NODECON; ++char *CIL_KEY_GENFSCON; ++char *CIL_KEY_NETIFCON; ++char *CIL_KEY_PIRQCON; ++char *CIL_KEY_IOMEMCON; ++char *CIL_KEY_IOPORTCON; ++char *CIL_KEY_PCIDEVICECON; ++char *CIL_KEY_DEVICETREECON; ++char *CIL_KEY_FSUSE; ++char *CIL_KEY_POLICYCAP; ++char *CIL_KEY_OPTIONAL; ++char *CIL_KEY_DEFAULTUSER; ++char *CIL_KEY_DEFAULTROLE; ++char *CIL_KEY_DEFAULTTYPE; ++char *CIL_KEY_ROOT; ++char *CIL_KEY_NODE; ++char *CIL_KEY_PERM; ++char *CIL_KEY_ALLOWX; ++char *CIL_KEY_AUDITALLOWX; ++char *CIL_KEY_DONTAUDITX; ++char *CIL_KEY_NEVERALLOWX; ++char *CIL_KEY_PERMISSIONX; ++char *CIL_KEY_IOCTL; ++char *CIL_KEY_UNORDERED; ++char *CIL_KEY_SRC_INFO; ++char *CIL_KEY_SRC_CIL; ++char *CIL_KEY_SRC_HLL; ++ + static void cil_init_keys(void) + { + /* Initialize CIL Keys into strpool */ +--- a/cil/src/cil_internal.h ++++ b/cil/src/cil_internal.h +@@ -74,166 +74,327 @@ enum cil_pass { + /* + Keywords + */ ++extern + char *CIL_KEY_CONS_T1; ++extern + char *CIL_KEY_CONS_T2; ++extern + char *CIL_KEY_CONS_T3; ++extern + char *CIL_KEY_CONS_R1; ++extern + char *CIL_KEY_CONS_R2; ++extern + char *CIL_KEY_CONS_R3; ++extern + char *CIL_KEY_CONS_U1; ++extern + char *CIL_KEY_CONS_U2; ++extern + char *CIL_KEY_CONS_U3; ++extern + char *CIL_KEY_CONS_L1; ++extern + char *CIL_KEY_CONS_L2; ++extern + char *CIL_KEY_CONS_H1; ++extern + char *CIL_KEY_CONS_H2; ++extern + char *CIL_KEY_AND; ++extern + char *CIL_KEY_OR; ++extern + char *CIL_KEY_NOT; ++extern + char *CIL_KEY_EQ; ++extern + char *CIL_KEY_NEQ; ++extern + char *CIL_KEY_CONS_DOM; ++extern + char *CIL_KEY_CONS_DOMBY; ++extern + char *CIL_KEY_CONS_INCOMP; ++extern + char *CIL_KEY_CONDTRUE; ++extern + char *CIL_KEY_CONDFALSE; ++extern + char *CIL_KEY_SELF; ++extern + char *CIL_KEY_OBJECT_R; ++extern + char *CIL_KEY_STAR; ++extern + char *CIL_KEY_TCP; ++extern + char *CIL_KEY_UDP; ++extern + char *CIL_KEY_DCCP; ++extern + char *CIL_KEY_SCTP; ++extern + char *CIL_KEY_AUDITALLOW; ++extern + char *CIL_KEY_TUNABLEIF; ++extern + char *CIL_KEY_ALLOW; ++extern + char *CIL_KEY_DONTAUDIT; ++extern + char *CIL_KEY_TYPETRANSITION; ++extern + char *CIL_KEY_TYPECHANGE; ++extern + char *CIL_KEY_CALL; ++extern + char *CIL_KEY_TUNABLE; ++extern + char *CIL_KEY_XOR; ++extern + char *CIL_KEY_ALL; ++extern + char *CIL_KEY_RANGE; ++extern + char *CIL_KEY_GLOB; ++extern + char *CIL_KEY_FILE; ++extern + char *CIL_KEY_DIR; ++extern + char *CIL_KEY_CHAR; ++extern + char *CIL_KEY_BLOCK; ++extern + char *CIL_KEY_SOCKET; ++extern + char *CIL_KEY_PIPE; ++extern + char *CIL_KEY_SYMLINK; ++extern + char *CIL_KEY_ANY; ++extern + char *CIL_KEY_XATTR; ++extern + char *CIL_KEY_TASK; ++extern + char *CIL_KEY_TRANS; ++extern + char *CIL_KEY_TYPE; ++extern + char *CIL_KEY_ROLE; ++extern + char *CIL_KEY_USER; ++extern + char *CIL_KEY_USERATTRIBUTE; ++extern + char *CIL_KEY_USERATTRIBUTESET; ++extern + char *CIL_KEY_SENSITIVITY; ++extern + char *CIL_KEY_CATEGORY; ++extern + char *CIL_KEY_CATSET; ++extern + char *CIL_KEY_LEVEL; ++extern + char *CIL_KEY_LEVELRANGE; ++extern + char *CIL_KEY_CLASS; ++extern + char *CIL_KEY_IPADDR; ++extern + char *CIL_KEY_MAP_CLASS; ++extern + char *CIL_KEY_CLASSPERMISSION; ++extern + char *CIL_KEY_BOOL; ++extern + char *CIL_KEY_STRING; ++extern + char *CIL_KEY_NAME; ++extern + char *CIL_KEY_SOURCE; ++extern + char *CIL_KEY_TARGET; ++extern + char *CIL_KEY_LOW; ++extern + char *CIL_KEY_HIGH; ++extern + char *CIL_KEY_LOW_HIGH; ++extern + char *CIL_KEY_GLBLUB; ++extern + char *CIL_KEY_HANDLEUNKNOWN; ++extern + char *CIL_KEY_HANDLEUNKNOWN_ALLOW; ++extern + char *CIL_KEY_HANDLEUNKNOWN_DENY; ++extern + char *CIL_KEY_HANDLEUNKNOWN_REJECT; ++extern + char *CIL_KEY_MACRO; ++extern + char *CIL_KEY_IN; ++extern + char *CIL_KEY_MLS; ++extern + char *CIL_KEY_DEFAULTRANGE; ++extern + char *CIL_KEY_BLOCKINHERIT; ++extern + char *CIL_KEY_BLOCKABSTRACT; ++extern + char *CIL_KEY_CLASSORDER; ++extern + char *CIL_KEY_CLASSMAPPING; ++extern + char *CIL_KEY_CLASSPERMISSIONSET; ++extern + char *CIL_KEY_COMMON; ++extern + char *CIL_KEY_CLASSCOMMON; ++extern + char *CIL_KEY_SID; ++extern + char *CIL_KEY_SIDCONTEXT; ++extern + char *CIL_KEY_SIDORDER; ++extern + char *CIL_KEY_USERLEVEL; ++extern + char *CIL_KEY_USERRANGE; ++extern + char *CIL_KEY_USERBOUNDS; ++extern + char *CIL_KEY_USERPREFIX; ++extern + char *CIL_KEY_SELINUXUSER; ++extern + char *CIL_KEY_SELINUXUSERDEFAULT; ++extern + char *CIL_KEY_TYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEATTRIBUTESET; ++extern + char *CIL_KEY_EXPANDTYPEATTRIBUTE; ++extern + char *CIL_KEY_TYPEALIAS; ++extern + char *CIL_KEY_TYPEALIASACTUAL; ++extern + char *CIL_KEY_TYPEBOUNDS; ++extern + char *CIL_KEY_TYPEPERMISSIVE; ++extern + char *CIL_KEY_RANGETRANSITION; ++extern + char *CIL_KEY_USERROLE; ++extern + char *CIL_KEY_ROLETYPE; ++extern + char *CIL_KEY_ROLETRANSITION; ++extern + char *CIL_KEY_ROLEALLOW; ++extern + char *CIL_KEY_ROLEATTRIBUTE; ++extern + char *CIL_KEY_ROLEATTRIBUTESET; ++extern + char *CIL_KEY_ROLEBOUNDS; ++extern + char *CIL_KEY_BOOLEANIF; ++extern + char *CIL_KEY_NEVERALLOW; ++extern + char *CIL_KEY_TYPEMEMBER; ++extern + char *CIL_KEY_SENSALIAS; ++extern + char *CIL_KEY_SENSALIASACTUAL; ++extern + char *CIL_KEY_CATALIAS; ++extern + char *CIL_KEY_CATALIASACTUAL; ++extern + char *CIL_KEY_CATORDER; ++extern + char *CIL_KEY_SENSITIVITYORDER; ++extern + char *CIL_KEY_SENSCAT; ++extern + char *CIL_KEY_CONSTRAIN; ++extern + char *CIL_KEY_MLSCONSTRAIN; ++extern + char *CIL_KEY_VALIDATETRANS; ++extern + char *CIL_KEY_MLSVALIDATETRANS; ++extern + char *CIL_KEY_CONTEXT; ++extern + char *CIL_KEY_FILECON; ++extern + char *CIL_KEY_IBPKEYCON; ++extern + char *CIL_KEY_IBENDPORTCON; ++extern + char *CIL_KEY_PORTCON; ++extern + char *CIL_KEY_NODECON; ++extern + char *CIL_KEY_GENFSCON; ++extern + char *CIL_KEY_NETIFCON; ++extern + char *CIL_KEY_PIRQCON; ++extern + char *CIL_KEY_IOMEMCON; ++extern + char *CIL_KEY_IOPORTCON; ++extern + char *CIL_KEY_PCIDEVICECON; ++extern + char *CIL_KEY_DEVICETREECON; ++extern + char *CIL_KEY_FSUSE; ++extern + char *CIL_KEY_POLICYCAP; ++extern + char *CIL_KEY_OPTIONAL; ++extern + char *CIL_KEY_DEFAULTUSER; ++extern + char *CIL_KEY_DEFAULTROLE; ++extern + char *CIL_KEY_DEFAULTTYPE; ++extern + char *CIL_KEY_ROOT; ++extern + char *CIL_KEY_NODE; ++extern + char *CIL_KEY_PERM; ++extern + char *CIL_KEY_ALLOWX; ++extern + char *CIL_KEY_AUDITALLOWX; ++extern + char *CIL_KEY_DONTAUDITX; ++extern + char *CIL_KEY_NEVERALLOWX; ++extern + char *CIL_KEY_PERMISSIONX; ++extern + char *CIL_KEY_IOCTL; ++extern + char *CIL_KEY_UNORDERED; ++extern + char *CIL_KEY_SRC_INFO; ++extern + char *CIL_KEY_SRC_CIL; ++extern + char *CIL_KEY_SRC_HLL; + + /* diff --git a/recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch b/recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch new file mode 100644 index 0000000..d985b01 --- /dev/null +++ b/recipes/libselinux/all/patches/0002-remove-cil_mem_error_handler.patch @@ -0,0 +1,45 @@ +libsepol: remove leftovers of cil_mem_error_handler + +Commit 4459d63 ("libsepol: Remove cil_mem_error_handler() function +pointer") replaced cil_mem_error_handler usage with inline contents of +the default handler. However, it left over the header declaration and +two callers. Convert these as well and remove the header declaration. + +This also fixes a build failure with -fno-common. + +see https://github.com/SELinuxProject/selinux/commit/3d32fc24d6aff360a538c63dad08ca5c957551b0 + +--- a/cil/src/cil_mem.h ++++ b/cil/src/cil_mem.h +@@ -36,7 +36,6 @@ void *cil_calloc(size_t num_elements, size_t element_size); + void *cil_realloc(void *ptr, size_t size); + char *cil_strdup(const char *str); + int cil_asprintf(char **strp, const char *fmt, ...); +-void (*cil_mem_error_handler)(void); + + #endif /* CIL_MEM_H_ */ + +--- a/cil/src/cil_strpool.c ++++ b/cil/src/cil_strpool.c +@@ -80,8 +80,8 @@ char *cil_strpool_add(const char *str) + int rc = hashtab_insert(cil_strpool_tab, (hashtab_key_t)strpool_ref->str, strpool_ref); + if (rc != SEPOL_OK) { + pthread_mutex_unlock(&cil_strpool_mutex); +- (*cil_mem_error_handler)(); +- pthread_mutex_lock(&cil_strpool_mutex); ++ cil_log(CIL_ERR, "Failed to allocate memory\n"); ++ exit(1); + } + } + +@@ -104,8 +104,8 @@ void cil_strpool_init(void) + cil_strpool_tab = hashtab_create(cil_strpool_hash, cil_strpool_compare, CIL_STRPOOL_TABLE_SIZE); + if (cil_strpool_tab == NULL) { + pthread_mutex_unlock(&cil_strpool_mutex); +- (*cil_mem_error_handler)(); +- return; ++ cil_log(CIL_ERR, "Failed to allocate memory\n"); ++ exit(1); + } + } + cil_strpool_readers++; diff --git a/recipes/libselinux/all/patches/0003-fix-link-pcre.patch b/recipes/libselinux/all/patches/0003-fix-link-pcre.patch new file mode 100644 index 0000000..993246d --- /dev/null +++ b/recipes/libselinux/all/patches/0003-fix-link-pcre.patch @@ -0,0 +1,11 @@ +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -43,7 +43,7 @@ endif + + override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) + override LDFLAGS += -L../src +-override LDLIBS += -lselinux $(FTS_LDLIBS) ++override LDLIBS += -lselinux $(FTS_LDLIBS) $(PCRE_LDLIBS) + PCRE_LDLIBS ?= -lpcre + + ifeq ($(ANDROID_HOST),y) diff --git a/recipes/libselinux/all/patches/0003-fix-missing-include-3.6.patch b/recipes/libselinux/all/patches/0003-fix-missing-include-3.6.patch new file mode 100644 index 0000000..8d2025e --- /dev/null +++ b/recipes/libselinux/all/patches/0003-fix-missing-include-3.6.patch @@ -0,0 +1,10 @@ +--- src/selinux_internal.c ++++ src/selinux_internal.c +@@ -1,6 +5,7 @@ + #include "selinux_internal.h" + + #include + #include + #include ++#include + diff --git a/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch b/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch new file mode 100644 index 0000000..c9a5ee5 --- /dev/null +++ b/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch @@ -0,0 +1,48 @@ +From a520f972bce9ec267f4e76b729bc3b7c1bdf13e6 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 8 Jan 2024 22:03:14 +0100 +Subject: [PATCH 1/3] libsepol/src/Makefile: fix reallocarray detection + +Pass LDFLAGS when checking for reallocarray to avoid the following +static build failure with musl raised since version 3.4 and +https://github.com/SELinuxProject/selinux/commit/f0a5f6e33084bd83d409bb7c932256139f471e71 +because -static is not passed when checking for reallocarray: + +/home/autobuild/autobuild/instance-9/output-1/host/bin/armeb-buildroot-linux-musleabi-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -static -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c -o assertion.o assertion.c +In file included from assertion.c:28: +private.h:88:21: error: static declaration of 'reallocarray' follows non-static declaration + 88 | static inline void* reallocarray(void *ptr, size_t nmemb, size_t size) { + | ^~~~~~~~~~~~ +In file included from ../include/sepol/policydb/mls_types.h:35, + from ../include/sepol/policydb/context.h:23, + from ../include/sepol/policydb/policydb.h:62, + from assertion.c:24: +/home/autobuild/autobuild/instance-9/output-1/host/armeb-buildroot-linux-musleabi/sysroot/usr/include/stdlib.h:150:7: note: previous declaration of 'reallocarray' with type 'void *(void *, size_t, size_t)' {aka 'void *(void *, unsigned int, unsigned int)'} + 150 | void *reallocarray (void *, size_t, size_t); + | ^~~~~~~~~~~~ + +Fixes: + - http://autobuild.buildroot.org/results/0170032548a38e2c991d62dc5823808458ad03b3 + +Signed-off-by: Fabrice Fontaine +Acked-by: James Carter +--- +src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index d80a941f..16b9bd5e 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -31,7 +31,7 @@ endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +-- +2.44.0 + diff --git a/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch b/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch new file mode 100644 index 0000000..bea3664 --- /dev/null +++ b/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch @@ -0,0 +1,61 @@ +[PATCH] libselinux, libsepol: Add CFLAGS and LDFLAGS to Makefile checks +@ 2024-03-13 22:48 James Carter + 0 siblings, 0 replies; only message in thread +From: James Carter @ 2024-03-13 22:48 UTC (permalink / raw) + To: selinux; +Cc: jordan, winfried_mb2, James Carter + +In libselinux there is an availability check for strlcpy() and +in both libselinux and libsepol there are availability checks for +reallocarray() in the src Makfiles. CFLAGS and LDFLAGS are needed +for cross-compiling, but, unfortunately, the default CFLAGS cause +all of these availability checks to fail to compile because of +compilationerrors (rather than just the function not being available). + +Add CFLAGS and LDFLAGS to the availibility checks, update the checks +so that a compilation error will only happen if the function being +checked for is not available, and make checks for the same function +the same in both libselinux and libsepol. + +Suggested-by: Jordan Williams +Suggested-by: Winfried Dobbe +Signed-off-by: James Carter +--- + libselinux/src/Makefile | 4 ++-- + libsepol/src/Makefile | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libselinux-3.6/src/Makefile b/libselinux-3.6/src/Makefile +index d3b981fc..41cfbdca 100644 +--- a/libselinux-3.6/src/Makefile ++++ b/libselinux-3.6/src/Makefile +@@ -104,13 +104,13 @@ override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) + + # check for strlcpy(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}include \nint main(void){char*d,*s;strlcpy(d, s, 0);return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){char d[2];const char *s="a";return (size_t)strlcpy(d,s,sizeof(d))>=sizeof(d);}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_STRLCPY + endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}include \nint main(void){reallocarray(NULL, 0, 0);return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +diff --git a/libsepol-3.6/src/Makefile b/libsepol-3.6/src/Makefile +index 16b9bd5e..7b0e8446 100644 +--- a/libsepol-3.6/src/Makefile ++++ b/libsepol-3.6/src/Makefile +@@ -31,7 +31,7 @@ endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +-- +2.44.0 diff --git a/recipes/libselinux/all/test_package/CMakeLists.txt b/recipes/libselinux/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..a2c8fc5 --- /dev/null +++ b/recipes/libselinux/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(libselinux REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libselinux::libselinux) diff --git a/recipes/libselinux/all/test_package/CMakeUserPresets.json b/recipes/libselinux/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/libselinux/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libselinux/all/test_package/conanfile.py b/recipes/libselinux/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fb966 --- /dev/null +++ b/recipes/libselinux/all/test_package/conanfile.py @@ -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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libselinux/all/test_package/test_package.c b/recipes/libselinux/all/test_package/test_package.c new file mode 100644 index 0000000..193f49f --- /dev/null +++ b/recipes/libselinux/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include + +int main() +{ + if (is_selinux_enabled()) + printf("SELinux is enabled\n"); + else + printf("SELinux is not enabled\n"); + return 0; +} diff --git a/recipes/libselinux/config.yml b/recipes/libselinux/config.yml new file mode 100644 index 0000000..901df00 --- /dev/null +++ b/recipes/libselinux/config.yml @@ -0,0 +1,15 @@ +versions: + "3.6": + folder: all + "3.5": + folder: all + "3.3": + folder: all + "3.2": + folder: all + "3.1": + folder: all + "3.0": + folder: all + "2.9": + folder: all diff --git a/recipes/m4/all/conandata.yml b/recipes/m4/all/conandata.yml new file mode 100644 index 0000000..a4dd466 --- /dev/null +++ b/recipes/m4/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "1.4.19": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/gnu/m4/m4-1.4.19.tar.xz" + sha256: "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96" + "1.4.18": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/gnu/m4/m4-1.4.18.tar.xz" + sha256: "f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07" +patches: + "1.4.19": + - patch_file: "patches/1.4.19-0001-open-files-in-binary-mode.patch" + - patch_file: "patches/1.4.19-0002-ar-lib.patch" + - patch_file: "patches/1.4.19-0003-msvc-debug-assertion.patch" + - patch_file: "patches/1.4.19-0004-disable-hardening-in-source.patch" + "1.4.18": + - patch_file: "patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch" + - patch_file: "patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch" + - patch_file: "patches/1.4.18-0004-fix-checks.patch" + - patch_file: "patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch" + - patch_file: "patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch" + - patch_file: "patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch" + - patch_file: "patches/1.4.18-0008-open-files-in-binary-mode.patch" + - patch_file: "patches/1.4.18-0009-disable-hardening-in-source.patch" + - patch_file: "patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch" diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py new file mode 100644 index 0000000..dadcf2b --- /dev/null +++ b/recipes/m4/all/conanfile.py @@ -0,0 +1,135 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version +import os +import shutil + +required_conan_version = ">=1.55.0" + + +class M4Conan(ConanFile): + name = "m4" + package_type = "application" + description = "GNU M4 is an implementation of the traditional Unix macro processor" + topics = ("macro", "preprocessor") + homepage = "https://www.gnu.org/software/m4/" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-only" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug + # Visual Studio does not support the %n format flag: + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions + # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, + # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) + if self.settings.build_type in ("Debug", "RelWithDebInfo"): + tc.extra_ldflags.append("-PDB") + elif self.settings.compiler == "clang" and Version(self.version) < "1.4.19": + tc.extra_cflags.extend([ + "-rtlib=compiler-rt", + "-Wno-unused-command-line-argument", + ]) + if cross_building(self) and is_msvc(self): + triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"} + + host_arch = triplet_arch_windows.get(str(self.settings.arch)) + build_arch = triplet_arch_windows.get(str(self._settings_build.arch)) + + if host_arch and build_arch: + host = f"{host_arch}-w64-mingw32" + build = f"{build_arch}-w64-mingw32" + tc.configure_args.extend([ + f"--host={host}", + f"--build={build}", + ]) + if self.settings.os == "Windows": + tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes") + env = tc.environment() + # help2man trick + env.prepend_path("PATH", self.source_folder) + # handle msvc + if is_msvc(self): + ar_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "ar-lib")) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("LD", "link") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + if shutil.which("help2man") == None: + # dummy file for configure + help2man = os.path.join(self.source_folder, "help2man") + save(self, help2man, "#!/usr/bin/env bash\n:") + if os.name == "posix": + os.chmod(help2man, os.stat(help2man).st_mode | 0o111) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path + bin_ext = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.package_folder, "bin", f"m4{bin_ext}").replace("\\", "/") + self.runenv_info.define_path("M4", m4_bin) + self.buildenv_info.define_path("M4", m4_bin) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.M4 = m4_bin diff --git a/recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch new file mode 100644 index 0000000..18da1f9 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch @@ -0,0 +1,170 @@ +# this patches is from https://git.busybox.net/buildroot/commit/?id=c48f8a64626c60bd1b46804b7cf1a699ff53cdf3 +# to fix compiler error on certain systems: +# freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." + +From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Mon, 5 Mar 2018 10:56:29 -0800 +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Daniel P. Berrangé in: +https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Check _IO_EOF_SEEN instead of _IO_ftrylockfile. +* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: +Define if not already defined. + +[yann.morin.1998@free.fr: partially backport from upstream gnulib] +Signed-off-by: "Yann E. MORIN" + +--- + lib/fflush.c | 6 +++--- + lib/fpending.c | 2 +- + lib/fpurge.c | 2 +- + lib/freadahead.c | 2 +- + lib/freading.c | 2 +- + lib/fseeko.c | 4 ++-- + lib/stdio-impl.h | 6 ++++++ + 7 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/lib/fflush.c b/lib/fflush.c +index ef2a7f1..787790d 100644 +--- a/lib/fflush.c ++++ b/lib/fflush.c +@@ -33,7 +33,7 @@ + #undef fflush + + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index ce93604..9fe7ffb 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,7 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff --git a/lib/fpurge.c b/lib/fpurge.c +index 53ee68c..7cba3a3 100644 +--- a/lib/fpurge.c ++++ b/lib/fpurge.c +@@ -62,7 +62,7 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/lib/freadahead.c b/lib/freadahead.c +index cfc969b..5e43e13 100644 +--- a/lib/freadahead.c ++++ b/lib/freadahead.c +@@ -25,7 +25,7 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff --git a/lib/freading.c b/lib/freading.c +index 05cb0b8..f1da5b9 100644 +--- a/lib/freading.c ++++ b/lib/freading.c +@@ -31,7 +31,7 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/lib/fseeko.c b/lib/fseeko.c +index 0c01c4f..0601619 100644 +--- a/lib/fseeko.c ++++ b/lib/fseeko.c +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h +index 766d693..75fe3ad 100644 +--- a/lib/stdio-impl.h ++++ b/lib/stdio-impl.h +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + +-- +2.7.4.windows.1 + diff --git a/recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch b/recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch new file mode 100644 index 0000000..5fb554c --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch @@ -0,0 +1,156 @@ +# this patches is from https://git.busybox.net/buildroot/commit/?id=c48f8a64626c60bd1b46804b7cf1a699ff53cdf3 +# to fix compiler error on certain systems: +# freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." + + +From 74d9d6a293d7462dea8f83e7fc5ac792e956a0ad Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Thu, 8 Mar 2018 16:42:45 -0800 +Subject: [PATCH 2/2] fflush: be more paranoid about libio.h change + +Suggested by Eli Zaretskii in: +https://lists.gnu.org/r/emacs-devel/2018-03/msg00270.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Look at _IO_ftrylockfile as well as at _IO_EOF_SEEN. +--- + lib/fflush.c | 9 ++++++--- + lib/fpending.c | 3 ++- + lib/fpurge.c | 3 ++- + lib/freadahead.c | 3 ++- + lib/freading.c | 3 ++- + lib/fseeko.c | 6 ++++-- + 6 files changed, 18 insertions(+), 9 deletions(-) + +[yann.morin.1998@free.fr: partially backport from upstream gnulib] +Signed-off-by: "Yann E. MORIN" + +diff --git a/lib/fflush.c b/lib/fflush.c +index 787790d..d6951a8 100644 +--- a/lib/fflush.c ++++ b/lib/fflush.c +@@ -33,7 +33,8 @@ + #undef fflush + + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++/* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +73,8 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1) ++/* GNU libc, BeOS, Haiku, Linux libc5 */ + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +150,8 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index 9fe7ffb..9433c1a 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,8 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff --git a/lib/fpurge.c b/lib/fpurge.c +index 7cba3a3..55758d7 100644 +--- a/lib/fpurge.c ++++ b/lib/fpurge.c +@@ -62,7 +62,8 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/lib/freadahead.c b/lib/freadahead.c +index 5e43e13..4ccaa09 100644 +--- a/lib/freadahead.c ++++ b/lib/freadahead.c +@@ -25,7 +25,8 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff --git a/lib/freading.c b/lib/freading.c +index f1da5b9..7ae5618 100644 +--- a/lib/freading.c ++++ b/lib/freading.c +@@ -31,7 +31,8 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/lib/fseeko.c b/lib/fseeko.c +index 0601619..2fc1986 100644 +--- a/lib/fseeko.c ++++ b/lib/fseeko.c +@@ -47,7 +47,8 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +124,8 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +-- +2.7.4.windows.1 + diff --git a/recipes/m4/all/patches/1.4.18-0004-fix-checks.patch b/recipes/m4/all/patches/1.4.18-0004-fix-checks.patch new file mode 100644 index 0000000..adbef56 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0004-fix-checks.patch @@ -0,0 +1,35 @@ +--- checks/check-them ++++ checks/check-them +@@ -58,12 +58,13 @@ + shift; shift + fi + + # Find out how the executable prints argv[0] + m4name=`"$m4" --help | ${SED} -e 's/Usage: \(.*\) \[OPTION.*/\1/' \ + -e 's/\\\\/\\\\\\\\/g' -e 1q` ++m4name=`basename $m4name` + + # Find out if we should strip \r in the output + "$m4" --version | tee $out + "$m4" --version | tr -d '\015' > $xout + if cmp -s $out $xout; then + : + +---checks/Makefile ++++ checks/Makefile.in +@@ -1612,14 +1612,14 @@ + $(srcdir)/stamp-checks: $(srcdir)/get-them $(top_srcdir)/doc/m4.texi + rm -f $(DOC_CHECKS) + cd $(srcdir) && AWK=$(AWK) ./get-them ../doc/m4.texi + echo stamp >$@ + + check-local: $(srcdir)/stamp-checks +- PATH=`pwd`/../src"$(PATH_SEPARATOR)"$$PATH; export PATH; \ +- $(srcdir)/check-them -I $(srcdir)/../examples $(CHECKS) ++ cd $(srcdir)/.. && PATH=src"$(PATH_SEPARATOR)"$$PATH \ ++ $(srcdir)/check-them -I examples $(CHECKS) + + installcheck: $(srcdir)/stamp-checks + PATH='$(bindir)'"$(PATH_SEPARATOR)"$$PATH; export PATH; \ + $(srcdir)/check-them -I $(srcdir)/../examples \ + -m "`echo m4 | sed '$(program_transform_name)'`" $(CHECKS) diff --git a/recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch b/recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch new file mode 100644 index 0000000..65911ef --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch @@ -0,0 +1,124 @@ +From 0d01189c540f63159448ba6bf4740bb20ff1e1ee Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Fri, 21 Apr 2017 17:24:48 +0200 +Subject: vasnprintf: Fix for MSVC 14. + +* lib/vasnprintf.c (USE_MSVC__SNPRINTF): New macro. +Everywhere, use !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF instead +of !HAVE_SNPRINTF_RETVAL_C99. +--- + lib/vasnprintf.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 4962e5893..839f79060 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -156,6 +156,7 @@ + # define SNPRINTF snwprintf + # else + # define SNPRINTF _snwprintf ++# define USE_MSVC__SNPRINTF 1 + # endif + # else + /* Unix. */ +@@ -181,7 +182,9 @@ + /* Here we need to call the native snprintf, not rpl_snprintf. */ + # undef snprintf + # else ++ /* MSVC versions < 14 did not have snprintf, only _snprintf. */ + # define SNPRINTF _snprintf ++# define USE_MSVC__SNPRINTF 1 + # endif + # else + /* Unix. */ +@@ -208,7 +211,7 @@ + #undef remainder + #define remainder rem + +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION + # if (HAVE_STRNLEN && !defined _AIX) + # define local_strnlen strnlen + # else +@@ -224,7 +227,7 @@ local_strnlen (const char *string, size_t maxlen) + # endif + #endif + +-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T ++#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T + # if HAVE_WCSLEN + # define local_wcslen wcslen + # else +@@ -247,7 +250,7 @@ local_wcslen (const wchar_t *s) + # endif + #endif + +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION + # if HAVE_WCSNLEN + # define local_wcsnlen wcsnlen + # else +@@ -1517,7 +1520,7 @@ is_borderline (const char *digits, size_t precision) + + #endif + +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + + /* Use a different function name, to make it possible that the 'wchar_t' + parametrization and the 'char' parametrization get compiled in the same +@@ -2392,7 +2395,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + } + } + #endif +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T + else if (dp->conversion == 's' + # if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +@@ -4591,10 +4594,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int has_width; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + size_t width; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; + #endif +@@ -4623,7 +4626,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 0; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + width = 0; + if (dp->width_start != dp->width_end) + { +@@ -4657,7 +4660,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + } + #endif + +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) +@@ -5127,7 +5130,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + /* Look at the snprintf() return value. */ + if (retcount < 0) + { +-# if !HAVE_SNPRINTF_RETVAL_C99 ++# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length +-- +cgit v1.2.1 + diff --git a/recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch b/recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch new file mode 100644 index 0000000..3ef80ae --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch @@ -0,0 +1,50 @@ +From 5e22aee79f9d02ac37f40f1d18f5696114c3c3c9 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 16 May 2017 09:23:52 -0700 +Subject: manywarnings: update for GCC 7 + +* build-aux/gcc-warning.spec: +* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): +Add GCC 7 warnings, notably -Wimplicit-fallthrough=5, which +requires a non-comment fallthrough attribute. This is a bit +cleaner than the comment versions. +* lib/strftime.c, lib/dfa.c, lib/fnmatch.c, lib/mbrtowc.c: +* lib/vasnprintf.c, tests/macros.h (FALLTHROUGH): New macro. +Use it whenever one switch case falls through into the next. +--- + lib/vasnprintf.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 839f79060..9c2af0e45 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -118,6 +118,14 @@ + # include "fpucw.h" + #endif + ++#ifndef FALLTHROUGH ++# if __GNUC__ < 7 ++# define FALLTHROUGH ((void) 0) ++# else ++# define FALLTHROUGH __attribute__ ((__fallthrough__)) ++# endif ++#endif ++ + /* Default parameters. */ + #ifndef VASNPRINTF + # if WIDE_CHAR_VERSION +@@ -4837,7 +4845,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + *fbp++ = 'l'; + # endif + #endif +- /*FALLTHROUGH*/ ++ FALLTHROUGH; + case TYPE_LONGINT: + case TYPE_ULONGINT: + #if HAVE_WINT_T +-- +cgit v1.2.1 + diff --git a/recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch b/recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch new file mode 100644 index 0000000..85a0bdd --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch @@ -0,0 +1,47 @@ +From c41f233c4c38e84023a16339782ee306f03e7f59 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Fri, 7 Jul 2017 14:10:20 -0700 +Subject: vasnprintf: port to macOS 10.13 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by comex in: +http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00056.html +* lib/vasnprintf.c (VASNPRINTF): Don’t use %n on macOS. +--- + lib/vasnprintf.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 9c2af0e45..fecaf27a1 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -4869,7 +4869,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #endif + *fbp = dp->conversion; + #if USE_SNPRINTF +-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++# if ! (((__GLIBC__ > 2 \ ++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ ++ && !defined __UCLIBC__) \ ++ || (defined __APPLE__ && defined __MACH__) \ ++ || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +@@ -4883,6 +4887,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + in format strings in writable memory may crash the program + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it + in this situation. */ ++ /* macOS 10.13 High Sierra behaves like glibc with ++ _FORTIFY_SOURCE=2, and older macOS releases ++ presumably do not need %n. */ + /* On native Windows systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, +-- +cgit v1.2.1 + diff --git a/recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch b/recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch new file mode 100644 index 0000000..fefd1a8 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch @@ -0,0 +1,15 @@ +This will open all files in binary mode. +files may contain binary data. +This fixes e.g. autoconf, of whose frozen file, contains all characters from 0x00 to 0xff. + +--- src/path.c ++++ src/path.c +@@ -110,7 +110,7 @@ + static FILE * + m4_fopen (const char *file) + { +- FILE *fp = fopen (file, "r"); ++ FILE *fp = fopen (file, "rb"); + if (fp) + { + struct stat st; diff --git a/recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch b/recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch new file mode 100644 index 0000000..b72b413 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- lib/config.hin ++++ lib/config.hin +@@ -96,7 +96,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch b/recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch new file mode 100644 index 0000000..5d5a404 --- /dev/null +++ b/recipes/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch @@ -0,0 +1,106 @@ +c-stack: stop using SIGSTKSZ + +It’s been proposed to stop making SIGSTKSZ an integer constant: +https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html +Also, using SIGSTKSZ in #if did not conform to current POSIX. +Also, avoiding SIGSTKSZ makes the code simpler and easier to grok. +* lib/c-stack.c (SIGSTKSZ): Remove. +(alternate_signal_stack): Now a 64 KiB array, for simplicity. +All uses changed. + +[Retrieved (and backported) from: +https://git.savannah.gnu.org/cgit/gnulib.git/patch/?id=f9e2b20a12a230efa30f1d479563ae07d276a94b] +Signed-off-by: Fabrice Fontaine + +diff -Nura lib/c-stack.c lib/c-stack.c +--- lib/c-stack.c 2021-04-11 19:12:14.086494029 +0200 ++++ lib/c-stack.c 2021-04-11 19:48:46.316862760 +0200 +@@ -50,15 +50,16 @@ + #if ! HAVE_STACK_T && ! defined stack_t + typedef struct sigaltstack stack_t; + #endif +-#ifndef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 +-/* libsigsegv 2.6 through 2.8 have a bug where some architectures use +- more than the Linux default of an 8k alternate stack when deciding +- if a fault was caused by stack overflow. */ +-# undef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#endif ++ ++/* Storage for the alternate signal stack. ++ 64 KiB is not too large for Gnulib-using apps, and is large enough ++ for all known platforms. Smaller sizes may run into trouble. ++ For example, libsigsegv 2.6 through 2.8 have a bug where some ++ architectures use more than the Linux default of an 8 KiB alternate ++ stack when deciding if a fault was caused by stack overflow. */ ++static max_align_t alternate_signal_stack[(64 * 1024 ++ + sizeof (max_align_t) - 1) ++ / sizeof (max_align_t)]; + + #include + #include +@@ -128,19 +129,6 @@ + #if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ + && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV + +-/* Storage for the alternate signal stack. */ +-static union +-{ +- char buffer[SIGSTKSZ]; +- +- /* These other members are for proper alignment. There's no +- standard way to guarantee stack alignment, but this seems enough +- in practice. */ +- long double ld; +- long l; +- void *p; +-} alternate_signal_stack; +- + static void + null_action (int signo __attribute__ ((unused))) + { +@@ -205,8 +193,8 @@ + + /* Always install the overflow handler. */ + if (stackoverflow_install_handler (overflow_handler, +- alternate_signal_stack.buffer, +- sizeof alternate_signal_stack.buffer)) ++ alternate_signal_stack, ++ sizeof alternate_signal_stack)) + { + errno = ENOTSUP; + return -1; +@@ -279,14 +267,14 @@ + stack_t st; + struct sigaction act; + st.ss_flags = 0; ++ st.ss_sp = alternate_signal_stack; ++ st.ss_size = sizeof alternate_signal_stack; + # if SIGALTSTACK_SS_REVERSED + /* Irix mistakenly treats ss_sp as the upper bound, rather than + lower bound, of the alternate stack. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *); +- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *); +-# else +- st.ss_sp = alternate_signal_stack.buffer; +- st.ss_size = sizeof alternate_signal_stack.buffer; ++ st.ss_size -= sizeof (void *); ++ char *ss_sp = st.ss_sp; ++ st.ss_sp = ss_sp + st.ss_size; + # endif + r = sigaltstack (&st, NULL); + if (r != 0) +diff -Nura lib/c-stack.h lib/c-stack.h +--- lib/c-stack.h 2021-04-11 19:12:14.098494042 +0200 ++++ lib/c-stack.h 2021-04-11 19:17:42.138848378 +0200 +@@ -34,7 +34,7 @@ + A null ACTION acts like an action that does nothing. + + ACTION must be async-signal-safe. ACTION together with its callees +- must not require more than SIGSTKSZ bytes of stack space. Also, ++ must not require more than 64 KiB bytes of stack space. Also, + ACTION should not call longjmp, because this implementation does + not guarantee that it is safe to return to the original stack. + diff --git a/recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch b/recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch new file mode 100644 index 0000000..91f68e0 --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch @@ -0,0 +1,15 @@ +This will open all files in binary mode. +files may contain binary data. +This fixes e.g. autoconf, of whose frozen file, contains all characters from 0x00 to 0xff. + +--- src/path.c ++++ src/path.c +@@ -110,7 +110,7 @@ + static FILE * + m4_fopen (const char *file) + { +- FILE *fp = fopen (file, "re"); ++ FILE *fp = fopen (file, "reb"); + if (fp) + { + struct stat st; diff --git a/recipes/m4/all/patches/1.4.19-0002-ar-lib.patch b/recipes/m4/all/patches/1.4.19-0002-ar-lib.patch new file mode 100644 index 0000000..22f7abe --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0002-ar-lib.patch @@ -0,0 +1,276 @@ +ar-lib is needed for building m4 with Visual Studio. +Re-use the one from m4/1.4.18. +We can't use automake here to avoid a build cycle (m4 -> automake -> autoconf -> m4) +--- /dev/null ++++ build-aux/ar-lib +@@ -0,0 +1,270 @@ ++#! /bin/sh ++# Wrapper for Microsoft lib.exe ++ ++me=ar-lib ++scriptversion=2012-03-01.08; # UTC ++ ++# Copyright (C) 2010-2014 Free Software Foundation, Inc. ++# Written by Peter Rosin . ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++ ++# func_error message ++func_error () ++{ ++ echo "$me: $1" 1>&2 ++ exit 1 ++} ++ ++file_conv= ++ ++# func_file_conv build_file ++# Convert a $build file to $host form and store it in $file ++# Currently only supports Windows hosts. ++func_file_conv () ++{ ++ file=$1 ++ case $file in ++ / | /[!/]*) # absolute file, and not a UNC file ++ if test -z "$file_conv"; then ++ # lazily determine how to convert abs files ++ case `uname -s` in ++ MINGW*) ++ file_conv=mingw ++ ;; ++ CYGWIN*) ++ file_conv=cygwin ++ ;; ++ *) ++ file_conv=wine ++ ;; ++ esac ++ fi ++ case $file_conv in ++ mingw) ++ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ++ ;; ++ cygwin) ++ file=`cygpath -m "$file" || echo "$file"` ++ ;; ++ wine) ++ file=`winepath -w "$file" || echo "$file"` ++ ;; ++ esac ++ ;; ++ esac ++} ++ ++# func_at_file at_file operation archive ++# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE ++# for each of them. ++# When interpreting the content of the @FILE, do NOT use func_file_conv, ++# since the user would need to supply preconverted file names to ++# binutils ar, at least for MinGW. ++func_at_file () ++{ ++ operation=$2 ++ archive=$3 ++ at_file_contents=`cat "$1"` ++ eval set x "$at_file_contents" ++ shift ++ ++ for member ++ do ++ $AR -NOLOGO $operation:"$member" "$archive" || exit $? ++ done ++} ++ ++case $1 in ++ '') ++ func_error "no command. Try '$0 --help' for more information." ++ ;; ++ -h | --h*) ++ cat < ++#endif ++ + /* TRANSLATORS: This is a non-ASCII name: The first name is (with + Unicode escapes) "Ren\u00e9" or (with HTML entities) "René". */ + #define AUTHORS proper_name_utf8 ("Rene' Seindal", "Ren\xC3\xA9 Seindal") +@@ -423,6 +427,15 @@ main (int argc, char *const *argv) + textdomain (PACKAGE); + atexit (close_stdin); + ++#ifdef _WIN32 ++ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); ++ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); ++ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); ++#endif ++ + include_init (); + debug_init (); + diff --git a/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch b/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch new file mode 100644 index 0000000..9386ee5 --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- a/lib/config.hin ++++ b/lib/config.hin +@@ -198,7 +198,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/recipes/m4/all/test_package/conanbuild.sh b/recipes/m4/all/test_package/conanbuild.sh new file mode 100644 index 0000000..9aac8ec --- /dev/null +++ b/recipes/m4/all/test_package/conanbuild.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/m4/all/test_package/conanbuildenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/m4/all/test_package/conanbuildenv-release-x86_64.sh b/recipes/m4/all/test_package/conanbuildenv-release-x86_64.sh new file mode 100644 index 0000000..eb6a8cb --- /dev/null +++ b/recipes/m4/all/test_package/conanbuildenv-release-x86_64.sh @@ -0,0 +1,20 @@ +script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/m4/all/test_package" +echo "echo Restoring environment" > "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" +for v in CXX CC CONAN_V2_MODE M4 PATH +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" +export M4="/home/aleksandr.vodyanov/.conan2/p/b/m47abe83bbe08ec/p/bin/m4" +export PATH="/home/aleksandr.vodyanov/.conan2/p/b/m47abe83bbe08ec/p/bin:$PATH" \ No newline at end of file diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py new file mode 100644 index 0000000..54ca096 --- /dev/null +++ b/recipes/m4/all/test_package/conanfile.py @@ -0,0 +1,14 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + extension = ".exe" if self.settings.os == "Windows" else "" + self.run(f"m4{extension} --version") diff --git a/recipes/m4/all/test_package/conanrun.sh b/recipes/m4/all/test_package/conanrun.sh new file mode 100644 index 0000000..ef636a5 --- /dev/null +++ b/recipes/m4/all/test_package/conanrun.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/m4/all/test_package/conanrunenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/m4/all/test_package/conanrunenv-release-x86_64.sh b/recipes/m4/all/test_package/conanrunenv-release-x86_64.sh new file mode 100644 index 0000000..f41d670 --- /dev/null +++ b/recipes/m4/all/test_package/conanrunenv-release-x86_64.sh @@ -0,0 +1,14 @@ +script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/m4/all/test_package" +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 + diff --git a/recipes/m4/all/test_package/deactivate_conanbuild.sh b/recipes/m4/all/test_package/deactivate_conanbuild.sh new file mode 100644 index 0000000..ac3d71a --- /dev/null +++ b/recipes/m4/all/test_package/deactivate_conanbuild.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/m4/all/test_package/deactivate_conanbuildenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/m4/all/test_package/deactivate_conanbuildenv-release-x86_64.sh b/recipes/m4/all/test_package/deactivate_conanbuildenv-release-x86_64.sh new file mode 100644 index 0000000..cb9e29e --- /dev/null +++ b/recipes/m4/all/test_package/deactivate_conanbuildenv-release-x86_64.sh @@ -0,0 +1,6 @@ +echo Restoring environment +unset CXX +unset CC +unset CONAN_V2_MODE +unset M4 +export PATH='/home/aleksandr.vodyanov/Documents/Avroid/Conan/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/aleksandr.vodyanov/.fzf/bin' diff --git a/recipes/m4/all/test_package/deactivate_conanrun.sh b/recipes/m4/all/test_package/deactivate_conanrun.sh new file mode 100644 index 0000000..3f2b582 --- /dev/null +++ b/recipes/m4/all/test_package/deactivate_conanrun.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/m4/all/test_package/deactivate_conanrunenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/m4/config.yml b/recipes/m4/config.yml new file mode 100644 index 0000000..d9912c9 --- /dev/null +++ b/recipes/m4/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.19": + folder: all + "1.4.18": + folder: all diff --git a/recipes/pcre2/all/conandata.yml b/recipes/pcre2/all/conandata.yml new file mode 100644 index 0000000..a53cdb7 --- /dev/null +++ b/recipes/pcre2/all/conandata.yml @@ -0,0 +1,76 @@ +sources: + "10.44": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.bz2" + sha256: "d34f02e113cf7193a1ebf2770d3ac527088d485d4e047ed10e5d217c6ef5de96" + "10.43": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PCRE2Project/pcre2/releases/download/pcre2-10.43/pcre2-10.43.tar.bz2" + sha256: "e2a53984ff0b07dfdb5ae4486bbb9b21cca8e7df2434096cc9bf1b728c350bcb" + "10.42": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2" + sha256: "8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840" + "10.40": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.bz2" + sha256: "14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68" + "10.39": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.tar.bz2" + sha256: "0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d440" + "10.37": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PhilipHazel/pcre2/releases/download/pcre2-10.37/pcre2-10.37.tar.bz2" + sha256: "4d95a96e8b80529893b4562be12648d798b957b1ba1aae39606bbc2ab956d270" + "10.36": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PhilipHazel/pcre2/releases/download/pcre2-10.36/pcre2-10.36.tar.bz2" + sha256: "a9ef39278113542968c7c73a31cfcb81aca1faa64690f400b907e8ab6b4a665c" + "10.35": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PhilipHazel/pcre2/releases/download/pcre2-10.35/pcre2-10.35.tar.bz2" + sha256: "9ccba8e02b0ce78046cdfb52e5c177f0f445e421059e43becca4359c669d4613" + "10.33": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PhilipHazel/pcre2/releases/download/pcre2-10.33/pcre2-10.33.tar.bz2" + sha256: "35514dff0ccdf02b55bd2e9fa586a1b9d01f62332c3356e379eabb75f789d8aa" + "10.32": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/PhilipHazel/pcre2/releases/download/pcre2-10.32/pcre2-10.32.tar.bz2" + sha256: "f29e89cc5de813f45786580101aaee3984a65818631d4ddbda7b32f699b87c2e" +patches: + "10.42": + - patch_file: "patches/0002-fix-cmake-c-std.patch" + patch_description: "make the C99 requirement explicit" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/193" + "10.40": + - patch_file: "patches/0001-fix-cmake-1.39.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + - patch_file: "patches/0002-fix-cmake-c-std.patch" + patch_description: "make the C99 requirement explicit" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/193" + "10.39": + - patch_file: "patches/0001-fix-cmake-1.39.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.37": + - patch_file: "patches/0001-fix-cmake-1.36.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.36": + - patch_file: "patches/0001-fix-cmake-1.36.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.35": + - patch_file: "patches/0001-fix-cmake-1.35.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.33": + - patch_file: "patches/0001-fix-cmake-1.33.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + "10.32": + - patch_file: "patches/0001-fix-cmake-1.32.patch" + patch_description: "correct the order of cmake_minimum_required() and project()" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py new file mode 100644 index 0000000..7f6022b --- /dev/null +++ b/recipes/pcre2/all/conanfile.py @@ -0,0 +1,221 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class PCRE2Conan(ConanFile): + name = "pcre2" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.pcre.org/" + description = "Perl Compatible Regular Expressions" + topics = ("regex", "regexp", "perl") + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_pcre2_8": [True, False], + "build_pcre2_16": [True, False], + "build_pcre2_32": [True, False], + "build_pcre2grep": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "support_jit": [True, False], + "grep_support_callout_fork": [True, False], + "link_size": [2, 3, 4], + } + default_options = { + "shared": False, + "fPIC": True, + "build_pcre2_8": True, + "build_pcre2_16": True, + "build_pcre2_32": True, + "build_pcre2grep": True, + "with_zlib": True, + "with_bzip2": True, + "support_jit": False, + "grep_support_callout_fork": True, + "link_size": 2, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.build_pcre2grep: + del self.options.with_zlib + del self.options.with_bzip2 + del self.options.grep_support_callout_fork + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_zlib"): + self.requires("zlib/[>=1.2.11 <2]") + if self.options.get_safe("with_bzip2"): + self.requires("bzip2/1.0.8") + + def validate(self): + if not self.options.build_pcre2_8 and not self.options.build_pcre2_16 and not self.options.build_pcre2_32: + raise ConanInvalidConfiguration("At least one of build_pcre2_8, build_pcre2_16 or build_pcre2_32 must be enabled") + if self.options.build_pcre2grep and not self.options.build_pcre2_8: + raise ConanInvalidConfiguration("build_pcre2_8 must be enabled for the pcre2grep program") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Mandatory because upstream CMakeLists overrides BUILD_SHARED_LIBS as a CACHE variable + # (see https://github.com/conan-io/conan/issues/11840) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + if Version(self.version) >= "10.38": + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["PCRE2_BUILD_PCRE2GREP"] = self.options.build_pcre2grep + tc.variables["PCRE2_SUPPORT_LIBZ"] = self.options.get_safe("with_zlib", False) + tc.variables["PCRE2_SUPPORT_LIBBZ2"] = self.options.get_safe("with_bzip2", False) + tc.variables["PCRE2_BUILD_TESTS"] = False + if is_msvc(self): + tc.variables["PCRE2_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.variables["PCRE2_DEBUG"] = self.settings.build_type == "Debug" + tc.variables["PCRE2_BUILD_PCRE2_8"] = self.options.build_pcre2_8 + tc.variables["PCRE2_BUILD_PCRE2_16"] = self.options.build_pcre2_16 + tc.variables["PCRE2_BUILD_PCRE2_32"] = self.options.build_pcre2_32 + tc.variables["PCRE2_SUPPORT_JIT"] = self.options.support_jit + tc.variables["PCRE2_LINK_SIZE"] = self.options.link_size + tc.variables["PCRE2GREP_SUPPORT_CALLOUT_FORK"] = self.options.get_safe("grep_support_callout_fork", False) + if Version(self.version) < "10.38": + # relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Do not add ${PROJECT_SOURCE_DIR}/cmake because it contains a custom + # FindPackageHandleStandardArgs.cmake which can break conan generators + if Version(self.version) < "10.34": + replace_in_file(self, cmakelists, "SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)", "") + else: + replace_in_file(self, cmakelists, "LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)", "") + # Avoid CMP0006 error (macos bundle) + replace_in_file(self, cmakelists, + "RUNTIME DESTINATION bin", + "RUNTIME DESTINATION bin BUNDLE DESTINATION bin") + # pcre2-config does not correctly include '-static' in static library names + if is_msvc(self): + replace = None + if Version(self.version) > "10.42": + replace = "configure_file(pcre2-config.in" + elif Version(self.version) >= "10.38": + replace = "CONFIGURE_FILE(pcre2-config.in" + postfix = "-static" if not self.options.shared else "" + if replace: + if self.settings.build_type == "Debug": + postfix += "d" + replace_in_file(self, cmakelists, replace, f'set(LIB_POSTFIX "{postfix}")\n{replace}') + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENCE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "man")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PCRE2") + self.cpp_info.set_property("pkg_config_name", "libpcre2") + if self.options.build_pcre2_8: + # pcre2-8 + self.cpp_info.components["pcre2-8"].set_property("cmake_target_name", "PCRE2::8BIT") + self.cpp_info.components["pcre2-8"].set_property("pkg_config_name", "libpcre2-8") + self.cpp_info.components["pcre2-8"].libs = [self._lib_name("pcre2-8")] + if not self.options.shared: + self.cpp_info.components["pcre2-8"].defines.append("PCRE2_STATIC") + # pcre2-posix + self.cpp_info.components["pcre2-posix"].set_property("cmake_target_name", "PCRE2::POSIX") + self.cpp_info.components["pcre2-posix"].set_property("pkg_config_name", "libpcre2-posix") + self.cpp_info.components["pcre2-posix"].libs = [self._lib_name("pcre2-posix")] + self.cpp_info.components["pcre2-posix"].requires = ["pcre2-8"] + if Version(self.version) >= "10.43" and is_msvc(self) and self.options.shared: + self.cpp_info.components["pcre2-posix"].defines.append("PCRE2POSIX_SHARED=1") + + # pcre2-16 + if self.options.build_pcre2_16: + self.cpp_info.components["pcre2-16"].set_property("cmake_target_name", "PCRE2::16BIT") + self.cpp_info.components["pcre2-16"].set_property("pkg_config_name", "libpcre2-16") + self.cpp_info.components["pcre2-16"].libs = [self._lib_name("pcre2-16")] + if not self.options.shared: + self.cpp_info.components["pcre2-16"].defines.append("PCRE2_STATIC") + # pcre2-32 + if self.options.build_pcre2_32: + self.cpp_info.components["pcre2-32"].set_property("cmake_target_name", "PCRE2::32BIT") + self.cpp_info.components["pcre2-32"].set_property("pkg_config_name", "libpcre2-32") + self.cpp_info.components["pcre2-32"].libs = [self._lib_name("pcre2-32")] + if not self.options.shared: + self.cpp_info.components["pcre2-32"].defines.append("PCRE2_STATIC") + + if self.options.build_pcre2grep: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) + # FIXME: This is a workaround to avoid ConanException. zlib and bzip2 + # are optional requirements of pcre2grep executable, not of any pcre2 lib. + if self.options.with_zlib: + self.cpp_info.components["pcre2-8"].requires.append("zlib::zlib") + if self.options.with_bzip2: + self.cpp_info.components["pcre2-8"].requires.append("bzip2::bzip2") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generator removed + self.cpp_info.names["cmake_find_package"] = "PCRE2" + self.cpp_info.names["cmake_find_package_multi"] = "PCRE2" + self.cpp_info.names["pkg_config"] = "libpcre2" + if self.options.build_pcre2_8: + self.cpp_info.components["pcre2-8"].names["cmake_find_package"] = "8BIT" + self.cpp_info.components["pcre2-8"].names["cmake_find_package_multi"] = "8BIT" + self.cpp_info.components["pcre2-posix"].names["cmake_find_package"] = "POSIX" + self.cpp_info.components["pcre2-posix"].names["cmake_find_package_multi"] = "POSIX" + if self.options.build_pcre2_16: + self.cpp_info.components["pcre2-16"].names["cmake_find_package"] = "16BIT" + self.cpp_info.components["pcre2-16"].names["cmake_find_package_multi"] = "16BIT" + if self.options.build_pcre2_32: + self.cpp_info.components["pcre2-32"].names["cmake_find_package"] = "32BIT" + self.cpp_info.components["pcre2-32"].names["cmake_find_package_multi"] = "32BIT" + + def _lib_name(self, name): + libname = name + if Version(self.version) >= "10.38" and is_msvc(self) and not self.options.shared: + libname += "-static" + if self.settings.os == "Windows": + if self.settings.build_type == "Debug": + libname += "d" + if self.settings.compiler == "gcc" and self.options.shared: + libname += ".dll" + return libname diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch new file mode 100644 index 0000000..c4932b9 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -83,13 +83,13 @@ + # 2018-06-19 PH added checks for stdint.h and inttypes.h + # 2018-06-27 PH added Daniel's patch to increase the stack for MSVC + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.0 to support newer add_test features. Set policy + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) + CMAKE_POLICY(SET CMP0026 OLD) ++PROJECT(PCRE2 C) + + SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake + diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch new file mode 100644 index 0000000..a2ac76a --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.33.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,10 +86,10 @@ + # 2018-11-16 PH added PCRE2GREP_SUPPORT_CALLOUT_FORK support and tidied + # 2019-02-16 PH hacked to avoid CMP0026 policy issue (see comments below) + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.0 to support newer add_test features. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch new file mode 100644 index 0000000..e09e604 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.35.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -93,10 +93,10 @@ + # 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator + # 2020-04-28 PH added function check for memfd_create based on Carlo's patch + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.0 to support newer add_test features. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch new file mode 100644 index 0000000..9990a60 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.36.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,10 +95,10 @@ + # 2020-05-25 PH added a check for Intel CET + # 2020-12-03 PH altered the definition of pcre2test as suggested by Daniel + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.5 to support GNUInstallDirs. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch new file mode 100644 index 0000000..a9d33c9 --- /dev/null +++ b/recipes/pcre2/all/patches/0001-fix-cmake-1.39.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,11 +100,11 @@ + # 2021-08-28 PH increased minimum version + # 2021-08-28 PH added test for realpath() + +-PROJECT(PCRE2 C) + + # Increased minimum to 2.8.5 to support GNUInstallDirs. + # Increased minimum to 3.0.0 because older than 2.8.12 is deprecated. + CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) ++PROJECT(PCRE2 C) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. diff --git a/recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch b/recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch new file mode 100644 index 0000000..e75faef --- /dev/null +++ b/recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch @@ -0,0 +1,52 @@ +From 12b0e40ee4556318e5a0da3155f28bdfd7c5bc35 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= +Date: Sun, 15 Jan 2023 14:38:44 -0800 +Subject: [PATCH] build: make the C99 requirement explicit + +Recent code uses C99 syntax (as reported in #163, and therefore it +will fail to build unless C99 (or higher) support is required by the +compiler (gcc >= 5 does it by default). + +For those unfortunate to need an older compiler that does require a +flag to enable that, make sure that both autoconf and cmake make it +explicit. + +While testing the change with the ancient autoconf version listed as +a prerequisite, noticed that the LT_INIT syntax introduced with 91485e5 +(Update configure.ac for latest version of autoconf., 2021-02-02), was +not supported, so update the autoconf minimum as well. +--- + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cec7dfb4..a8147575 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,1 +107,3 @@ + PROJECT(PCRE2 C) ++set(CMAKE_C_STANDARD 99) ++set(CMAKE_C_STANDARD_REQUIRED TRUE) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. +diff --git a/configure.ac b/configure.ac +index ce5bda3c..67b2fdce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,7 +22,7 @@ m4_define(libpcre2_posix_version, [3:4:0]) + # NOTE: The CMakeLists.txt file searches for the above variables in the first + # 50 lines of this file. Please update that if the variables above are moved. + +-AC_PREREQ([2.60]) ++AC_PREREQ([2.62]) + AC_INIT([PCRE2],pcre2_major.pcre2_minor[]pcre2_prerelease,[],[pcre2]) + AC_CONFIG_SRCDIR([src/pcre2.h.in]) + AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) +@@ -42,7 +42,7 @@ AC_CONFIG_MACRO_DIR([m4]) + + remember_set_CFLAGS="$CFLAGS" + +-AC_PROG_CC ++m4_version_prereq(2.70, [AC_PROG_CC], [AC_PROG_CC_C99]) + AM_PROG_CC_C_O + AC_USE_SYSTEM_EXTENSIONS + diff --git a/recipes/pcre2/all/test_package/CMakeLists.txt b/recipes/pcre2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..016db5b --- /dev/null +++ b/recipes/pcre2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(PCRE2 REQUIRED 8BIT CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PCRE2::8BIT) diff --git a/recipes/pcre2/all/test_package/CMakeUserPresets.json b/recipes/pcre2/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/pcre2/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/pcre2/all/test_package/conanfile.py b/recipes/pcre2/all/test_package/conanfile.py new file mode 100644 index 0000000..fafba71 --- /dev/null +++ b/recipes/pcre2/all/test_package/conanfile.py @@ -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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pcre2/all/test_package/test_package.c b/recipes/pcre2/all/test_package/test_package.c new file mode 100644 index 0000000..9f42714 --- /dev/null +++ b/recipes/pcre2/all/test_package/test_package.c @@ -0,0 +1,34 @@ +#include +#include +#include + +#define PCRE2_CODE_UNIT_WIDTH 8 +#include + + +int main() { + pcre2_code *re; + int rc; + PCRE2_SIZE erroffset; + int errcode; + PCRE2_SIZE* ovector; + const char *pattern = "\\w+"; + size_t pattern_size = strlen(pattern); + const char *subject = "conan"; + size_t subject_size = strlen(subject); + uint32_t options = 0; + pcre2_match_data *match_data; + uint32_t ovecsize = 128; + + re = pcre2_compile(pattern, pattern_size, options, &errcode, &erroffset, NULL); + match_data = pcre2_match_data_create(ovecsize, NULL); + rc = pcre2_match(re, subject, subject_size, 0, options, match_data, NULL); + ovector = pcre2_get_ovector_pointer(match_data); + PCRE2_SPTR start = subject + ovector[0]; + PCRE2_SIZE slen = ovector[1] - ovector[0]; + printf("match: %.*s\n", (int)slen, (char *)start ); + pcre2_match_data_free(match_data); + pcre2_code_free(re); + + return EXIT_SUCCESS; +} diff --git a/recipes/pcre2/config.yml b/recipes/pcre2/config.yml new file mode 100644 index 0000000..7b719e0 --- /dev/null +++ b/recipes/pcre2/config.yml @@ -0,0 +1,21 @@ +versions: + "10.44": + folder: all + "10.43": + folder: all + "10.42": + folder: all + "10.40": + folder: all + "10.39": + folder: all + "10.37": + folder: all + "10.36": + folder: all + "10.35": + folder: all + "10.33": + folder: all + "10.32": + folder: all