Skip to content

Commit adb213d

Browse files
committed
(maint) only force libxml2/libxslt internal mirror if necessary
autotools version patch required to support building on EL8 era operating systems and older.
1 parent 1e10ef1 commit adb213d

File tree

4 files changed

+93
-17
lines changed

4 files changed

+93
-17
lines changed

configs/components/libxml2.rb

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
component "libxml2" do |pkg, settings, platform|
22
pkg.version '2.10.3'
3-
pkg.sha256sum '26d2415e1c23e0aad8ca52358523fc9116a2eb6e4d4ef47577b1635c7cee3d5f'
4-
pkg.url "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}.tar.gz"
5-
6-
# Newer versions of libxml2 either ship as tar.xz or do not ship with a configure file
7-
# and require a newer version of GNU Autotools to generate. This causes problems with
8-
# the older and esoteric (AIX, Solaris) platforms that we support.
9-
# So we generate a configure file manually, compress as tar.gz, and host internally.
3+
pkg.sha256sum '497f12e34790d407ec9e2a190d576c0881a1cd78ff3c8991d1f9e40281a5ff57'
4+
pkg.url "https://gitlab.gnome.org/GNOME/libxml2/-/archive/v#{pkg.get_version}/libxml2-v#{pkg.get_version}.tar.gz"
105

116
if platform.is_aix?
127
if platform.name == 'aix-7.1-ppc'
@@ -23,6 +18,7 @@
2318
pkg.environment "CFLAGS", "#{settings[:cflags]} -std=c99"
2419
pkg.environment "LDFLAGS", settings[:ldflags]
2520
elsif platform.is_macos?
21+
pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin'
2622
pkg.environment "LDFLAGS", settings[:ldflags]
2723
pkg.environment "CFLAGS", settings[:cflags]
2824
if platform.is_cross_compiled?
@@ -34,7 +30,38 @@
3430
pkg.environment "CFLAGS", settings[:cflags]
3531
end
3632

37-
pkg.build_requires "runtime-#{settings[:runtime_project]}"
33+
build_deps = [ "runtime-#{settings[:runtime_project]}" ]
34+
35+
if platform.is_sles?
36+
build_deps << "autoconf"
37+
elsif platform.is_deb? || platform.is_rpm?
38+
build_deps << "dh-autoreconf"
39+
end
40+
41+
if platform.name == 'el-8-x86_64' || platform.name == 'el-9-x86_64'
42+
build_deps.reject! { |r| r == 'dh-autoreconf' }
43+
end
44+
45+
build_deps.each do |dep|
46+
pkg.build_requires dep
47+
end
48+
49+
# Newer versions of libxml2 either ship as tar.xz or do not ship with a configure file
50+
# and require a newer version of GNU Autotools to generate. This causes problems with
51+
# the older and esoteric (AIX, Solaris) platforms that we support.
52+
# So we generate a configure file manually, compress as tar.gz, and host internally.
53+
if (platform.is_aix? && platform.name == 'aix-7.1-ppc') || platform.is_solaris?
54+
pkg.url "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}-puppet.tar.gz"
55+
pkg.sha256sum '26d2415e1c23e0aad8ca52358523fc9116a2eb6e4d4ef47577b1635c7cee3d5f'
56+
else
57+
pkg.mirror "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}.tar.gz"
58+
# Patch downgrades autotools requirement from 1.16.3 to 1.15
59+
# EL8 era distros and older do not support 1.16.3.
60+
# Vendor only required it to fix a python 3.10 detection bug,
61+
# 1.15 works just fine for our build.
62+
pkg.apply_patch 'resources/patches/libxml2/configure.ac.patch'
63+
pkg.configure { ["autoreconf --force --install"] }
64+
end
3865

3966
pkg.configure do
4067
["./configure --prefix=#{settings[:prefix]} --without-python #{settings[:host]}"]

configs/components/libxslt.rb

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
component "libxslt" do |pkg, settings, platform|
22
pkg.version '1.1.37'
3-
pkg.sha256sum 'a4ecab265f44e888ed3b39e11c7e925103ef6e26e09d62e9381f26977df96343'
4-
pkg.url "#{settings[:buildsources_url]}/libxslt-v#{pkg.get_version}.tar.gz"
5-
6-
# Newer versions of libxslt either ship as tar.xz or do not ship with a configure file
7-
# and require a newer version of GNU Autotools to generate. This causes problems with
8-
# the older and esoteric (AIX, Solaris) platforms that we support.
9-
# So we generate a configure file manually, compress as tar.gz, and host internally.
10-
11-
pkg.build_requires "libxml2"
3+
pkg.sha256sum 'b6f96869b8c42e8257b19d633d31e38cf12ff770829352a9dd109795ffc78bf2'
4+
pkg.url "https://gitlab.gnome.org/GNOME/libxslt/-/archive/v#{pkg.get_version}/libxslt-v#{pkg.get_version}.tar.gz"
125

136
if platform.is_aix?
147
if platform.name == 'aix-7.1-ppc'
@@ -34,13 +27,47 @@
3427
pkg.environment 'CC', 'clang -target arm64-apple-macos11' if platform.name =~ /osx-11/
3528
pkg.environment 'CC', 'clang -target arm64-apple-macos12' if platform.name =~ /osx-12/
3629
end
30+
pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin'
3731
pkg.environment "LDFLAGS", settings[:ldflags]
3832
pkg.environment "CFLAGS", settings[:cflags]
3933
else
4034
pkg.environment "LDFLAGS", settings[:ldflags]
4135
pkg.environment "CFLAGS", settings[:cflags]
4236
end
4337

38+
build_deps = [ "libxml2" ]
39+
40+
if platform.is_sles?
41+
build_deps << "autoconf"
42+
elsif platform.is_deb? || platform.is_rpm?
43+
build_deps << "dh-autoreconf"
44+
end
45+
46+
if platform.name == 'el-8-x86_64' || platform.name == 'el-9-x86_64'
47+
build_deps.reject! { |r| r == 'dh-autoreconf' }
48+
end
49+
50+
build_deps.each do |dep|
51+
pkg.build_requires dep
52+
end
53+
54+
# Newer versions of libxslt either ship as tar.xz or do not ship with a configure file
55+
# and require a newer version of GNU Autotools to generate. This causes problems with
56+
# the older and esoteric (AIX, Solaris) platforms that we support.
57+
# So we generate a configure file manually, compress as tar.gz, and host internally.
58+
if (platform.is_aix? && platform.name == 'aix-7.1-ppc') || platform.is_solaris?
59+
pkg.url "#{settings[:buildsources_url]}/libxslt-v#{pkg.get_version}-puppet.tar.gz"
60+
pkg.sha256sum 'a4ecab265f44e888ed3b39e11c7e925103ef6e26e09d62e9381f26977df96343'
61+
else
62+
pkg.mirror "#{settings[:buildsources_url]}/libxslt-v#{pkg.get_version}.tar.gz"
63+
# Patch downgrades autotools requirement from 1.16.3 to 1.15
64+
# EL8 era distros and older do not support 1.16.3.
65+
# Vendor only required it to fix a python 3.10 detection bug,
66+
# 1.15 works just fine for our build.
67+
pkg.apply_patch 'resources/patches/libxslt/configure.ac.patch'
68+
pkg.configure { ["autoreconf --force --install"] }
69+
end
70+
4471
pkg.configure do
4572
["./configure --without-python --prefix=#{settings[:prefix]} --docdir=/tmp --with-libxml-prefix=#{settings[:prefix]} #{settings[:host]} #{disable_crypto} #{build}"]
4673
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/configure.ac 2024-02-13 20:48:04.340733431 +0000
2+
+++ b/configure.ac 2024-02-13 20:47:55.056533429 +0000
3+
@@ -39,7 +39,7 @@
4+
5+
VERSION=${LIBXML_VERSION}
6+
7+
-AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz])
8+
+AM_INIT_AUTOMAKE([1.15 foreign no-dist-gzip dist-xz])
9+
AM_MAINTAINER_MODE([enable])
10+
AM_SILENT_RULES([yes])
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/configure.ac 2024-02-13 20:45:38.453590684 +0000
2+
+++ b/configure.ac 2024-02-13 20:45:16.549118812 +0000
3+
@@ -67,7 +67,7 @@
4+
AC_SUBST(LIBEXSLT_VERSION_NUMBER)
5+
AC_SUBST(LIBEXSLT_VERSION_EXTRA)
6+
7+
-AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz])
8+
+AM_INIT_AUTOMAKE([1.15 foreign no-dist-gzip dist-xz])
9+
AM_MAINTAINER_MODE([enable])
10+
AM_SILENT_RULES([yes])
11+

0 commit comments

Comments
 (0)