From 7ce89990c46ecd45cf6fc9a5106d9aad9325df00 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 14 Apr 2026 14:01:23 -0600 Subject: [PATCH 1/6] Adapt to changes in OpenSSL 4.0 --- pl.spec | 6 ++- swipl-10.0.2-openssl4.patch | 96 +++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 swipl-10.0.2-openssl4.patch diff --git a/pl.spec b/pl.spec index d72be1b..020bbeb 100644 --- a/pl.spec +++ b/pl.spec @@ -25,6 +25,9 @@ Patch2: swipl-8.2.0-unbundle-libstemmer.patch Patch3: swipl-9.2.7-inclpr-math.patch # Use zlib-ng directly rather than via the zlib compatibility interface Patch4: swipl-10.0.1-zlib-ng.patch +# Adapt to changes in OpenSSL 4.0 +# https://github.com/SWI-Prolog/packages-ssl/pull/174 +Patch5: swipl-10.0.2-openssl4.patch # See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} @@ -410,8 +413,7 @@ ln -s %{_texmf_main}/tex/texinfo/texinfo.tex packages/xpce/man/info cp -p customize/README.md README-customize.md %generate_buildrequires -cd packages/mqi/python -%pyproject_buildrequires +%pyproject_buildrequires -d packages/mqi/python %build %ifarch %{java_arches} diff --git a/swipl-10.0.2-openssl4.patch b/swipl-10.0.2-openssl4.patch new file mode 100644 index 0000000..13d669a --- /dev/null +++ b/swipl-10.0.2-openssl4.patch @@ -0,0 +1,96 @@ +--- swipl-10.0.2/packages/ssl/ssl4pl.c.orig 2026-01-22 12:39:26.000000000 -0700 ++++ swipl-10.0.2/packages/ssl/ssl4pl.c 2026-04-14 12:05:12.521302862 -0600 +@@ -74,6 +74,12 @@ + + #define SSL_MAX_CERT_KEY_PAIRS 12 + ++#if OPENSSL_API_LEVEL < 40000 ++#define ASN1_STRING_get0_data(x) (x)->data ++#define ASN1_STRING_length(x) (x)->length ++#define ASN1_STRING_type(x) (x)->type ++#endif ++ + typedef int BOOL; + #ifndef TRUE + #define TRUE 1 +@@ -458,12 +464,12 @@ unify_asn1_time(term_t term, const ASN1_ + { time_t result = 0; + char buffer[24]; + char* pbuffer = buffer; +- size_t length = time->length; +- char * source = (char *)time->data; ++ size_t length = ASN1_STRING_length(time); ++ const char * source = (const char *)ASN1_STRING_get0_data(time); + struct tm time_tm; + time_t lSecondsFromUTC; + +- if (time->type == V_ASN1_UTCTIME) ++ if (ASN1_STRING_type(time) == V_ASN1_UTCTIME) + { if ((length < 11) || (length > 17)) + { ssl_deb(2, "Unable to parse time - expected either 11 or 17 chars," + " not %d", length); +@@ -679,7 +685,7 @@ unify_hash(term_t hash, const ASN1_OBJEC + + + static int +-unify_name(term_t term, X509_NAME* name) ++unify_name(term_t term, const X509_NAME* name) + { int ni; + term_t list = PL_copy_term_ref(term); + term_t item = PL_new_term_ref(); +@@ -688,8 +694,8 @@ unify_name(term_t term, X509_NAME* name) + return PL_unify_term(term, PL_CHARS, ""); + + for (ni = 0; ni < X509_NAME_entry_count(name); ni++) +- { X509_NAME_ENTRY* e = X509_NAME_get_entry(name, ni); +- ASN1_STRING* entry_data = X509_NAME_ENTRY_get_data(e); ++ { const X509_NAME_ENTRY* e = X509_NAME_get_entry(name, ni); ++ const ASN1_STRING* entry_data = X509_NAME_ENTRY_get_data(e); + unsigned char *utf8_data; + int rc; + +@@ -775,7 +781,7 @@ unify_crl(term_t term, X509_CRL* crl) + unify_hash(hash, palg->algorithm, i2d_X509_CRL_INFO_wrapper, crl->crl) && + #endif + unify_asn1_time(next_update, X509_CRL_get0_nextUpdate(crl)) && +- unify_bytes_hex(signature, psig->length, psig->data) && ++ unify_bytes_hex(signature, ASN1_STRING_length(psig), ASN1_STRING_get0_data(psig)) && + PL_unify_term(term, + PL_LIST, 5, + PL_FUNCTOR, FUNCTOR_issuername1, +@@ -1325,7 +1331,7 @@ fetch_public_key(term_t Field, X509* cer + static foreign_t + fetch_crls(term_t Field, X509* cert) + { unsigned int crl_ext_id; +- X509_EXTENSION * crl_ext = NULL; ++ const X509_EXTENSION * crl_ext = NULL; + + crl_ext_id = X509_get_ext_by_NID(cert, NID_crl_distribution_points, -1); + crl_ext = X509_get_ext(cert, crl_ext_id); +@@ -1352,7 +1358,7 @@ fetch_crls(term_t Field, X509* cert) + { name = sk_GENERAL_NAME_value(point->distpoint->name.fullname, j); + if (name != NULL && name->type == GEN_URI) + { if (!(PL_unify_list(crl_list, crl_item, crl_list) && +- PL_unify_atom_chars(crl_item, (const char *)name->d.ia5->data))) ++ PL_unify_atom_chars(crl_item, (const char *)ASN1_STRING_get0_data(name->d.ia5)))) + { + CRL_DIST_POINTS_free(distpoints); + return FALSE; +@@ -1379,7 +1385,7 @@ fetch_crls(term_t Field, X509* cert) + static foreign_t + fetch_sans(term_t Field, X509* cert) + { unsigned int san_ext_id; +- X509_EXTENSION * san_ext = NULL; ++ const X509_EXTENSION * san_ext = NULL; + + san_ext_id = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1); + san_ext = X509_get_ext(cert, san_ext_id); +@@ -1418,7 +1424,7 @@ fetch_signature(term_t Field, X509* cert + { GET0SIG_CONST_T ASN1_BIT_STRING *psig; + GET0SIG_CONST_T X509_ALGOR *palg; + X509_get0_signature(&psig, &palg, cert); +- return unify_bytes_hex(Field, psig->length, psig->data); ++ return unify_bytes_hex(Field, ASN1_STRING_length(psig), ASN1_STRING_get0_data(psig)); + } + + From 4db7149a82be02ae8417c686a6f75a5157de5f42 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 3 Jun 2026 23:37:25 +0200 Subject: [PATCH 2/6] Rebuilt for Python 3.15 From c0f21942dd525329036f77c4dffcab22feff4734 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 12 Jun 2026 19:28:14 -0400 Subject: [PATCH 3/6] Rebuilt for openssl 4.0 From ea303f388f13fffd1c28ce2dbd8fb44a159233de Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 14 Jul 2026 19:23:08 -0600 Subject: [PATCH 4/6] Use the cmake declarative buildsystem - Drop unused BuildRequires --- pl.spec | 151 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 76 insertions(+), 75 deletions(-) diff --git a/pl.spec b/pl.spec index 020bbeb..cf8c7cb 100644 --- a/pl.spec +++ b/pl.spec @@ -1,3 +1,6 @@ +# Whether to run tests +%bcond ctest 1 + # Name of the architecture-specific lib directory %global swipl_arch %{_target_cpu}-linux @@ -31,9 +34,21 @@ Patch5: swipl-10.0.2-openssl4.patch # See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} +BuildSystem: cmake +BuildOption(conf): -DBUILD_PDF_DOCUMENTATION:BOOL=%{?fedora:ON}%{!?fedora:OFF} +BuildOption(conf): -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} +BuildOption(conf): -DCPACK_GENERATOR:STRING=RPM +BuildOption(conf): -DINSTALL_TESTS:BOOL=ON +BuildOption(conf): -DJQUERYDIR:PATH=%{_datadir}/javascript/jquery/latest +BuildOption(conf): -DSKIP_SSL_TESTS:BOOL=ON +BuildOption(conf): -DSWIPL_INSTALL_IN_LIB:BOOL=ON +BuildOption(conf): -DSWIPL_INSTALL_IN_SHARE:BOOL=ON +BuildOption(conf): -DSWIPL_VERSIONED_DIR:BOOL=OFF +BuildOption(conf): -DSYSTEM_LIBEDIT:BOOL=ON +BuildOption(conf): -DUSE_TCMALLOC:BOOL=ON +BuildOption(conf): -G Ninja BuildRequires: cmake -BuildRequires: fdupes BuildRequires: findutils BuildRequires: gcc-c++ BuildRequires: ninja-build @@ -52,8 +67,6 @@ BuildRequires: pkgconfig(libarchive) BuildRequires: libdb-devel # crypt BuildRequires: libxcrypt-devel -# http -BuildRequires: js-jquery # jpl %ifarch %{java_arches} BuildRequires: java-25-devel @@ -67,7 +80,6 @@ BuildRequires: libstemmer-devel # ODBC BuildRequires: pkgconfig(odbc) # SSL -BuildRequires: openssl BuildRequires: pkgconfig(openssl) # sweep BuildRequires: emacs-devel @@ -92,11 +104,21 @@ BuildRequires: pkgconfig(yaml-0.1) # Doc building # Gated to Fedora as EL is currently missing tex(a4wide.sty) %if 0%{?fedora} -BuildRequires: tex(latex) +BuildRequires: tex(a4.sty) BuildRequires: tex(a4wide.sty) +BuildRequires: tex(color.sty) +BuildRequires: tex(dcolumn.sty) +BuildRequires: tex(fancyvrb.sty) +BuildRequires: tex(graphicx.sty) +BuildRequires: tex(hyperref.sty) +BuildRequires: tex(ifpdf.sty) +BuildRequires: tex(longtable.sty) BuildRequires: tex(tabulary.sty) +BuildRequires: tex(url.sty) BuildRequires: texlive-courier BuildRequires: texlive-helvetic +BuildRequires: texlive-latex +BuildRequires: texlive-latex-base-dev BuildRequires: texlive-times %endif @@ -157,14 +179,14 @@ This is a metapackage, which installs the full SWI-Prolog suite, except tests. # and other development files are included in this package. It is a Prolog # compiler, and therefore is a development package itself. License: %{shrink: - BSD-2-Clause AND - (Brian-Gladman-3-Clause OR GPL-1.0-or-later) AND - BSD-3-Clause AND - dtoa AND - LicenseRef-Fedora-Public-Domain AND - MIT AND - Unicode-DFS-2016 AND - Zlib + BSD-2-Clause + AND (Brian-Gladman-3-Clause OR GPL-1.0-or-later) + AND BSD-3-Clause + AND dtoa + AND LicenseRef-Fedora-Public-Domain + AND MIT + AND Unicode-DFS-2016 + AND Zlib } Summary: ISO/Edinburgh-style Prolog interpreter - core system Recommends: swi-prolog-bdb%{?_isa} = %{version}-%{release} @@ -183,21 +205,21 @@ This package contains the core SWI-Prolog system. %package -n swi-prolog-core-packages License: %{shrink: - BSD-2-Clause AND - Beerware AND - (Brian-Gladman-3-Clause OR GPL-1.0-or-later) AND - (BSD-2-Clause OR Artistic-2.0) AND - BSD-3-Clause AND - GFDL-1.3-no-invariants-or-later AND - (GPL-1.0-or-later OR Artistic-1.0-Perl) AND - GPL-2.0-or-later WITH SWI-exception AND - GPL-3.0-or-later AND - LGPL-2.0-or-later AND - LicenseRef-Fedora-Public-Domain AND - MIT AND - Unicode-DFS-2016 AND - W3C AND - Zlib + BSD-2-Clause + AND Beerware + AND (Brian-Gladman-3-Clause OR GPL-1.0-or-later) + AND (BSD-2-Clause OR Artistic-2.0) + AND BSD-3-Clause + AND GFDL-1.3-no-invariants-or-later + AND (GPL-1.0-or-later OR Artistic-1.0-Perl) + AND GPL-2.0-or-later WITH SWI-exception + AND GPL-3.0-or-later + AND LGPL-2.0-or-later + AND LicenseRef-Fedora-Public-Domain + AND MIT + AND Unicode-DFS-2016 + AND W3C + AND Zlib } Summary: ISO/Edinburgh-style Prolog interpreter - core packages Requires: swi-prolog-core%{?_isa} = %{version}-%{release} @@ -243,17 +265,17 @@ but no GUI components. %package -n swi-prolog-win License: %{shrink: - BSD-2-Clause AND - CC-BY-SA-3.0 AND - FBM AND - GPL-2.0-or-later WITH Bison-exception-2.2 AND - HPND-Pbmplus AND - IJG AND - Knuth-CTAN AND - LicenseRef-Fedora-Public-Domain AND - PostgreSQL AND - Spencer-99 AND - TCL + BSD-2-Clause + AND CC-BY-SA-3.0 + AND FBM + AND GPL-2.0-or-later WITH Bison-exception-2.2 + AND HPND-Pbmplus + AND IJG + AND Knuth-CTAN + AND LicenseRef-Fedora-Public-Domain + AND PostgreSQL + AND Spencer-99 + AND TCL } Summary: ISO/Edinburgh-style Prolog interpreter - with GUI support Requires: swi-prolog-cli%{?_isa} = %{version}-%{release} @@ -338,10 +360,10 @@ embedded database. %package -n swi-prolog-doc License: %{shrink: - BSD-2-Clause AND - CC-BY-SA-3.0 AND - Knuth-CTAN AND - LPPL-1.3c + BSD-2-Clause + AND CC-BY-SA-3.0 + AND Knuth-CTAN + AND LPPL-1.3c } Summary: Documentation and examples for SWI-Prolog BuildArch: noarch @@ -358,10 +380,10 @@ This package provides documentation and examples. %package -n swi-prolog-test License: %{shrink: - BSD-2-Clause AND - GPL-2.0-or-later AND - GPL-2.0-or-later WITH SWI-exception AND - LGPL-2.1-or-later + BSD-2-Clause + AND GPL-2.0-or-later + AND GPL-2.0-or-later WITH SWI-exception + AND LGPL-2.1-or-later } Summary: Tests and checks for SWI-Prolog BuildArch: noarch @@ -382,7 +404,6 @@ package, you do not. %autopatch -p1 -m1 cp -p %{SOURCE2} . -%conf # Fix the installation path on 64-bit systems if [ "%{_lib}" = "lib64" ]; then sed -e 's,lib\(/\${SWIPL_INSTALL_DIR}\),lib64\1,' \ @@ -415,7 +436,7 @@ cp -p customize/README.md README-customize.md %generate_buildrequires %pyproject_buildrequires -d packages/mqi/python -%build +%conf -p %ifarch %{java_arches} export JAVA_HOME=%{java_home} export LD_LIBRARY_PATH=%{java_home}/lib/server @@ -424,21 +445,7 @@ export LD_LIBRARY_PATH=%{java_home}/lib/server export DISABLE_PKGS="jpl" %endif -# Configure -%cmake \ - -DBUILD_PDF_DOCUMENTATION:BOOL=%{?fedora:ON}%{!?fedora:OFF} \ - -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \ - -DCPACK_GENERATOR:STRING=RPM \ - -DINSTALL_TESTS:BOOL=ON \ - -DJQUERYDIR:PATH=%{_datadir}/javascript/jquery/latest \ - -DSKIP_SSL_TESTS:BOOL=ON \ - -DSWIPL_INSTALL_IN_LIB:BOOL=ON \ - -DSWIPL_INSTALL_IN_SHARE:BOOL=ON \ - -DSWIPL_VERSIONED_DIR:BOOL=OFF \ - -DSYSTEM_LIBEDIT:BOOL=ON \ - -DUSE_TCMALLOC:BOOL=ON \ - -G Ninja - +%build -p # Help latex2html find the bibliographies for d in $(find . -name gen); do target=$(dirname $d) @@ -446,15 +453,12 @@ for d in $(find . -name gen); do cp -p $d/*.bbl %{_vpath_builddir}/$target done -# Build -%cmake_build - +%build -a # Switch back before installing; see above cp -p packages/jpl/jpl.pl.install packages/jpl/jpl.pl -%install +%install -a # See for file layout -%cmake_install # Scripts with shebang should be executable chmod 0755 \ @@ -529,15 +533,12 @@ mv %{buildroot}%{_libdir}/swipl/desktop/prolog-mime.xml \ %{buildroot}%{_datadir}/mime/packages rmdir %{buildroot}%{_libdir}/swipl/desktop -# Link duplicates -%fdupes %{buildroot}%{_datadir}/swipl -%fdupes %{buildroot}%{_libdir}/swipl - -%check +%check -p # Test with the original jpl.pl, since the new version refers to paths that # don't exist; then switch back. cp -p packages/jpl/jpl.pl.jni packages/jpl/jpl.pl -%ctest + +%check -a cp -p packages/jpl/jpl.pl.install packages/jpl/jpl.pl %files -n swi-prolog From 7216bd099b98473c4285255f46ffc18debce7b1f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jul 2026 17:18:08 +0000 Subject: [PATCH 5/6] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From b46c8c1baf4129ac3c917beac8fc7a0a6796ad76 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 22 Jul 2026 10:52:03 +0200 Subject: [PATCH 6/6] Rebuilt for Python 3.15.0b4 ABI change