diff --git a/configs/components/libxml2.rb b/configs/components/libxml2.rb index 9e3413192..5c0a40139 100644 --- a/configs/components/libxml2.rb +++ b/configs/components/libxml2.rb @@ -1,12 +1,7 @@ component "libxml2" do |pkg, settings, platform| pkg.version '2.10.3' - pkg.sha256sum '26d2415e1c23e0aad8ca52358523fc9116a2eb6e4d4ef47577b1635c7cee3d5f' - pkg.url "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}.tar.gz" - - # Newer versions of libxml2 either ship as tar.xz or do not ship with a configure file - # and require a newer version of GNU Autotools to generate. This causes problems with - # the older and esoteric (AIX, Solaris) platforms that we support. - # So we generate a configure file manually, compress as tar.gz, and host internally. + pkg.sha256sum '497f12e34790d407ec9e2a190d576c0881a1cd78ff3c8991d1f9e40281a5ff57' + pkg.url "https://gitlab.gnome.org/GNOME/libxml2/-/archive/v#{pkg.get_version}/libxml2-v#{pkg.get_version}.tar.gz" if platform.is_aix? if platform.name == 'aix-7.1-ppc' @@ -23,6 +18,7 @@ pkg.environment "CFLAGS", "#{settings[:cflags]} -std=c99" pkg.environment "LDFLAGS", settings[:ldflags] elsif platform.is_macos? + pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin' pkg.environment "LDFLAGS", settings[:ldflags] pkg.environment "CFLAGS", settings[:cflags] if platform.is_cross_compiled? @@ -34,7 +30,38 @@ pkg.environment "CFLAGS", settings[:cflags] end - pkg.build_requires "runtime-#{settings[:runtime_project]}" + build_deps = [ "runtime-#{settings[:runtime_project]}" ] + + if platform.is_sles? + build_deps << "autoconf" + elsif platform.is_deb? || platform.is_rpm? + build_deps << "dh-autoreconf" + end + + if platform.name == 'el-8-x86_64' || platform.name == 'el-9-x86_64' + build_deps.reject! { |r| r == 'dh-autoreconf' } + end + + build_deps.each do |dep| + pkg.build_requires dep + end + + # Newer versions of libxml2 either ship as tar.xz or do not ship with a configure file + # and require a newer version of GNU Autotools to generate. This causes problems with + # the older and esoteric (AIX, Solaris) platforms that we support. + # So we generate a configure file manually, compress as tar.gz, and host internally. + if (platform.is_aix? && platform.name == 'aix-7.1-ppc') || platform.is_solaris? + pkg.url "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}-puppet.tar.gz" + pkg.sha256sum '26d2415e1c23e0aad8ca52358523fc9116a2eb6e4d4ef47577b1635c7cee3d5f' + else + pkg.mirror "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}.tar.gz" + # Patch downgrades autotools requirement from 1.16.3 to 1.15 + # EL8 era distros and older do not support 1.16.3. + # Vendor only required it to fix a python 3.10 detection bug, + # 1.15 works just fine for our build. + pkg.apply_patch 'resources/patches/libxml2/configure.ac.patch' + pkg.configure { ["autoreconf --force --install"] } + end pkg.configure do ["./configure --prefix=#{settings[:prefix]} --without-python #{settings[:host]}"] diff --git a/configs/components/libxslt.rb b/configs/components/libxslt.rb index cfc109839..af9965688 100644 --- a/configs/components/libxslt.rb +++ b/configs/components/libxslt.rb @@ -1,14 +1,7 @@ component "libxslt" do |pkg, settings, platform| pkg.version '1.1.37' - pkg.sha256sum 'a4ecab265f44e888ed3b39e11c7e925103ef6e26e09d62e9381f26977df96343' - pkg.url "#{settings[:buildsources_url]}/libxslt-v#{pkg.get_version}.tar.gz" - - # Newer versions of libxslt either ship as tar.xz or do not ship with a configure file - # and require a newer version of GNU Autotools to generate. This causes problems with - # the older and esoteric (AIX, Solaris) platforms that we support. - # So we generate a configure file manually, compress as tar.gz, and host internally. - - pkg.build_requires "libxml2" + pkg.sha256sum 'b6f96869b8c42e8257b19d633d31e38cf12ff770829352a9dd109795ffc78bf2' + pkg.url "https://gitlab.gnome.org/GNOME/libxslt/-/archive/v#{pkg.get_version}/libxslt-v#{pkg.get_version}.tar.gz" if platform.is_aix? if platform.name == 'aix-7.1-ppc' @@ -34,6 +27,7 @@ pkg.environment 'CC', 'clang -target arm64-apple-macos11' if platform.name =~ /osx-11/ pkg.environment 'CC', 'clang -target arm64-apple-macos12' if platform.name =~ /osx-12/ end + pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin' pkg.environment "LDFLAGS", settings[:ldflags] pkg.environment "CFLAGS", settings[:cflags] else @@ -41,6 +35,39 @@ pkg.environment "CFLAGS", settings[:cflags] end + build_deps = [ "libxml2" ] + + if platform.is_sles? + build_deps << "autoconf" + elsif platform.is_deb? || platform.is_rpm? + build_deps << "dh-autoreconf" + end + + if platform.name == 'el-8-x86_64' || platform.name == 'el-9-x86_64' + build_deps.reject! { |r| r == 'dh-autoreconf' } + end + + build_deps.each do |dep| + pkg.build_requires dep + end + + # Newer versions of libxslt either ship as tar.xz or do not ship with a configure file + # and require a newer version of GNU Autotools to generate. This causes problems with + # the older and esoteric (AIX, Solaris) platforms that we support. + # So we generate a configure file manually, compress as tar.gz, and host internally. + if (platform.is_aix? && platform.name == 'aix-7.1-ppc') || platform.is_solaris? + pkg.url "#{settings[:buildsources_url]}/libxslt-v#{pkg.get_version}-puppet.tar.gz" + pkg.sha256sum 'a4ecab265f44e888ed3b39e11c7e925103ef6e26e09d62e9381f26977df96343' + else + pkg.mirror "#{settings[:buildsources_url]}/libxslt-v#{pkg.get_version}.tar.gz" + # Patch downgrades autotools requirement from 1.16.3 to 1.15 + # EL8 era distros and older do not support 1.16.3. + # Vendor only required it to fix a python 3.10 detection bug, + # 1.15 works just fine for our build. + pkg.apply_patch 'resources/patches/libxslt/configure.ac.patch' + pkg.configure { ["autoreconf --force --install"] } + end + pkg.configure do ["./configure --without-python --prefix=#{settings[:prefix]} --docdir=/tmp --with-libxml-prefix=#{settings[:prefix]} #{settings[:host]} #{disable_crypto} #{build}"] end diff --git a/resources/patches/libxml2/configure.ac.patch b/resources/patches/libxml2/configure.ac.patch new file mode 100644 index 000000000..93baf1188 --- /dev/null +++ b/resources/patches/libxml2/configure.ac.patch @@ -0,0 +1,11 @@ +--- a/configure.ac 2024-02-13 20:48:04.340733431 +0000 ++++ b/configure.ac 2024-02-13 20:47:55.056533429 +0000 +@@ -39,7 +39,7 @@ + + VERSION=${LIBXML_VERSION} + +-AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz]) ++AM_INIT_AUTOMAKE([1.15 foreign no-dist-gzip dist-xz]) + AM_MAINTAINER_MODE([enable]) + AM_SILENT_RULES([yes]) + diff --git a/resources/patches/libxslt/configure.ac.patch b/resources/patches/libxslt/configure.ac.patch new file mode 100644 index 000000000..360a0ee0c --- /dev/null +++ b/resources/patches/libxslt/configure.ac.patch @@ -0,0 +1,11 @@ +--- a/configure.ac 2024-02-13 20:45:38.453590684 +0000 ++++ b/configure.ac 2024-02-13 20:45:16.549118812 +0000 +@@ -67,7 +67,7 @@ + AC_SUBST(LIBEXSLT_VERSION_NUMBER) + AC_SUBST(LIBEXSLT_VERSION_EXTRA) + +-AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz]) ++AM_INIT_AUTOMAKE([1.15 foreign no-dist-gzip dist-xz]) + AM_MAINTAINER_MODE([enable]) + AM_SILENT_RULES([yes]) +