From ec1c446607b436bd4ea184b7e8ee1f3aeccfb473 Mon Sep 17 00:00:00 2001 From: Dmitry Mikhin Date: Mon, 19 Aug 2024 18:59:20 +0300 Subject: [PATCH] libxml2@2.13.3 (#2511) # Conflicts: # modules/rules_foreign_cc/metadata.json --- modules/libxml2/2.13.3/MODULE.bazel | 7 +++ .../2.13.3/patches/add_build_file.patch | 41 +++++++++++++++++ .../2.13.3/patches/module_dot_bazel.patch | 10 ++++ modules/libxml2/2.13.3/presubmit.yml | 17 +++++++ modules/libxml2/2.13.3/source.json | 10 ++++ modules/libxml2/metadata.json | 15 ++++++ .../0.12.0+fix1239/MODULE.bazel | 46 +++++++++++++++++++ .../patches/module_dot_bazel_version.patch | 14 ++++++ .../0.12.0+fix1239/presubmit.yml | 11 +++++ .../0.12.0+fix1239/source.json | 9 ++++ modules/rules_foreign_cc/metadata.json | 7 ++- 11 files changed, 183 insertions(+), 4 deletions(-) create mode 100644 modules/libxml2/2.13.3/MODULE.bazel create mode 100644 modules/libxml2/2.13.3/patches/add_build_file.patch create mode 100644 modules/libxml2/2.13.3/patches/module_dot_bazel.patch create mode 100644 modules/libxml2/2.13.3/presubmit.yml create mode 100644 modules/libxml2/2.13.3/source.json create mode 100644 modules/libxml2/metadata.json create mode 100644 modules/rules_foreign_cc/0.12.0+fix1239/MODULE.bazel create mode 100644 modules/rules_foreign_cc/0.12.0+fix1239/patches/module_dot_bazel_version.patch create mode 100644 modules/rules_foreign_cc/0.12.0+fix1239/presubmit.yml create mode 100644 modules/rules_foreign_cc/0.12.0+fix1239/source.json diff --git a/modules/libxml2/2.13.3/MODULE.bazel b/modules/libxml2/2.13.3/MODULE.bazel new file mode 100644 index 00000000000..741b3041c11 --- /dev/null +++ b/modules/libxml2/2.13.3/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "libxml2", + version = "2.13.3", + compatibility_level = 1, +) +bazel_dep(name = "rules_foreign_cc", version = "0.12.0+fix1239") +bazel_dep(name = "platforms", version = "0.0.10") diff --git a/modules/libxml2/2.13.3/patches/add_build_file.patch b/modules/libxml2/2.13.3/patches/add_build_file.patch new file mode 100644 index 00000000000..b704c96a4c6 --- /dev/null +++ b/modules/libxml2/2.13.3/patches/add_build_file.patch @@ -0,0 +1,41 @@ +--- /dev/null ++++ BUILD.bazel +@@ -0,0 +1,38 @@ ++""" Builds libxml2. ++""" ++ ++load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") ++ ++filegroup( ++ name = "srcs", ++ srcs = glob(["**"]), ++) ++ ++cache_entries = { ++ "CMAKE_INSTALL_LIBDIR": "lib", ++ "CMAKE_POSITION_INDEPENDENT_CODE": "ON", ++ "BUILD_SHARED_LIBS": "OFF", ++ #libxml2 specific options. ++ "LIBXML2_WITH_PYTHON": "OFF", ++ "LIBXML2_WITH_LZMA": "OFF", ++ "LIBXML2_WITH_ICONV": "OFF", ++ "LIBXML2_WITH_TESTS": "OFF", ++ "LIBXML2_WITH_PROGRAMS": "OFF", ++} ++ ++cmake( ++ name = "libxml2", ++ env = {"CMAKE_BUILD_TYPE": "Release"}, ++ lib_source = ":srcs", ++ cache_entries = cache_entries, ++ out_static_libs = select({ ++ "@platforms//os:windows": [ ++ "libxml2s.lib", ++ ], ++ "//conditions:default": [ ++ "libxml2.a", ++ ], ++ }), ++ out_include_dir = "include/libxml2", ++ visibility = ["//visibility:public"], ++) diff --git a/modules/libxml2/2.13.3/patches/module_dot_bazel.patch b/modules/libxml2/2.13.3/patches/module_dot_bazel.patch new file mode 100644 index 00000000000..538efe1fbef --- /dev/null +++ b/modules/libxml2/2.13.3/patches/module_dot_bazel.patch @@ -0,0 +1,10 @@ +--- MODULE.bazel ++++ MODULE.bazel +@@ -0,0 +1,7 @@ ++module( ++ name = "libxml2", ++ version = "2.13.3", ++ compatibility_level = 1, ++) ++bazel_dep(name = "rules_foreign_cc", version = "0.12.0+fix1239") ++bazel_dep(name = "platforms", version = "0.0.10") diff --git a/modules/libxml2/2.13.3/presubmit.yml b/modules/libxml2/2.13.3/presubmit.yml new file mode 100644 index 00000000000..060f93eb58a --- /dev/null +++ b/modules/libxml2/2.13.3/presubmit.yml @@ -0,0 +1,17 @@ +matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + - windows + bazel: + - 7.x + - 6.x +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - '@libxml2//:libxml2' diff --git a/modules/libxml2/2.13.3/source.json b/modules/libxml2/2.13.3/source.json new file mode 100644 index 00000000000..e6996794ccb --- /dev/null +++ b/modules/libxml2/2.13.3/source.json @@ -0,0 +1,10 @@ +{ + "url": "https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.3.tar.xz", + "integrity": "sha256-CAXXwYDPCcqtcWZsekWKdPBBVhpTKQJFTaUEfYOUgTg=", + "strip_prefix": "libxml2-2.13.3", + "patches": { + "add_build_file.patch": "sha256-up7y9h92pFRePlMeUPgtT5LfXjk3IUqZrHgXyEJ+mjE=", + "module_dot_bazel.patch": "sha256-CzFwftEOBvNDVIblET5TF6SSJDwwu3YpmeaWSE2RMxY=" + }, + "patch_strip": 0 +} diff --git a/modules/libxml2/metadata.json b/modules/libxml2/metadata.json new file mode 100644 index 00000000000..ef0c152032b --- /dev/null +++ b/modules/libxml2/metadata.json @@ -0,0 +1,15 @@ +{ + "homepage": "https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home", + "maintainers": [ + { + "email": "tectep@gmail.com", + "github": "dmitry-j-mikhin", + "name": "Dmitry Mikhin" + } + ], + "repository": [], + "versions": [ + "2.13.3" + ], + "yanked_versions": {} +} diff --git a/modules/rules_foreign_cc/0.12.0+fix1239/MODULE.bazel b/modules/rules_foreign_cc/0.12.0+fix1239/MODULE.bazel new file mode 100644 index 00000000000..b14a49547d1 --- /dev/null +++ b/modules/rules_foreign_cc/0.12.0+fix1239/MODULE.bazel @@ -0,0 +1,46 @@ +"bazelbuild/rules_foreign_cc" + +module( + name = "rules_foreign_cc", + version = "0.12.0+fix1239", + compatibility_level = 1, +) + +bazel_dep(name = "bazel_features", version = "1.15.0") +bazel_dep(name = "bazel_skylib", version = "1.3.0") +bazel_dep(name = "platforms", version = "0.0.5") +bazel_dep(name = "rules_python", version = "0.23.1") + +# Dev dependencies +bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True, repo_name = "bazel_gazelle") +bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "stardoc", version = "0.5.6", dev_dependency = True, repo_name = "io_bazel_stardoc") +bazel_dep(name = "rules_cc", version = "0.0.9", dev_dependency = True) + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain(python_version = "3.9") +use_repo(python, "python_3_9") + +tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools") +use_repo( + tools, + "cmake_3.23.2_toolchains", + "cmake_src", + "gettext_runtime", + "glib_dev", + "glib_src", + "gnumake_src", + "meson_src", + "ninja_1.12.1_toolchains", + "ninja_build_src", + "pkgconfig_src", + "rules_foreign_cc_framework_toolchains", +) + +register_toolchains( + "@rules_foreign_cc_framework_toolchains//:all", + "@cmake_3.23.2_toolchains//:all", + "@ninja_1.12.1_toolchains//:all", + "@python_3_9//:all", + "@rules_foreign_cc//toolchains:all", +) diff --git a/modules/rules_foreign_cc/0.12.0+fix1239/patches/module_dot_bazel_version.patch b/modules/rules_foreign_cc/0.12.0+fix1239/patches/module_dot_bazel_version.patch new file mode 100644 index 00000000000..2e4bef4c2c2 --- /dev/null +++ b/modules/rules_foreign_cc/0.12.0+fix1239/patches/module_dot_bazel_version.patch @@ -0,0 +1,14 @@ +=================================================================== +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -1,9 +1,9 @@ + "bazelbuild/rules_foreign_cc" + + module( + name = "rules_foreign_cc", +- version = "0.0.0", ++ version = "0.12.0+fix1239", + compatibility_level = 1, + ) + + bazel_dep(name = "bazel_features", version = "1.15.0") diff --git a/modules/rules_foreign_cc/0.12.0+fix1239/presubmit.yml b/modules/rules_foreign_cc/0.12.0+fix1239/presubmit.yml new file mode 100644 index 00000000000..23ef4201ab2 --- /dev/null +++ b/modules/rules_foreign_cc/0.12.0+fix1239/presubmit.yml @@ -0,0 +1,11 @@ +matrix: + platform: ["centos7", "debian10", "macos", "ubuntu2004", "windows"] + bazel: ["6.x", "7.x"] + +tasks: + verify_targets: + name: "Verify build targets" + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - "@rules_foreign_cc//toolchains/private:make_tool" diff --git a/modules/rules_foreign_cc/0.12.0+fix1239/source.json b/modules/rules_foreign_cc/0.12.0+fix1239/source.json new file mode 100644 index 00000000000..d6f6c9973f9 --- /dev/null +++ b/modules/rules_foreign_cc/0.12.0+fix1239/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-TuXwhr0M73ALPXUWiNxy47+O01452CZnYm/QK0AuAtk=", + "strip_prefix": "rules_foreign_cc-0.12.0-fix1239", + "url": "https://github.com/dmitry-j-mikhin/rules_foreign_cc/releases/download/0.12.0%2Bfix1239/rules_foreign_cc-0.12.0-fix1239.tar.gz", + "patches": { + "module_dot_bazel_version.patch": "sha256-EzktVGMtU6uudGRGp8ewXhS4d7VlljCosybOdFcX/RQ=" + }, + "patch_strip": 1 +} diff --git a/modules/rules_foreign_cc/metadata.json b/modules/rules_foreign_cc/metadata.json index ea129af272e..86c549cd9e3 100644 --- a/modules/rules_foreign_cc/metadata.json +++ b/modules/rules_foreign_cc/metadata.json @@ -7,15 +7,14 @@ "name": "James Sharpe" } ], - "repository": [ - "github:bazelbuild/rules_foreign_cc" - ], + "repository": [], "versions": [ "0.8.0", "0.9.0", "0.10.1", "0.11.1", - "0.12.0" + "0.12.0", + "0.12.0+fix1239" ], "yanked_versions": {} }