Merge pull request #20055 from mgondan/master

swi-prolog: update to V9.2.1
This commit is contained in:
Christoph Reiter 2024-02-17 09:08:08 +01:00 committed by GitHub
commit aecd886ed2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 44 additions and 154 deletions

View File

@ -0,0 +1,19 @@
--- swipl-9.2.1/cmake/port/Windows.cmake 2024-02-15 07:31:29.593572000 +0100
+++ swipl-9.2.1/cmake/port/Windows.cmake 2024-02-15 07:30:51.689756700 +0100
@@ -17,6 +17,8 @@
if(MINGW_ROOT)
include(port/MinGW)
elseif(CONDA)
include(port/CondaWindows)
+elseif(MSYS2)
+ include(port/msys2)
endif()
if(NOT PLHOME)
+++ swipl-9.2.1/cmake/port/msys2.cmake 2024-02-15 07:32:00.0 +0100
@@ -0,0 +1,4 @@
+message("Building for MSYS2")
+
+set(PLHOME no-home)
+set(PLRELHOME ../lib/${SWIPL_INSTALL_DIR})

View File

@ -1,13 +0,0 @@
--- swipl-9.0.4/src/Tests/files/test_pipe.pl 2023-01-27 11:09:04 +0000
+++ swipl-9.0.4/src/Tests/files/test_pipe.pl 2023-01-27 17:27:29 +0000
@@ -95,7 +95,8 @@
format(atom(A), '~w~n', [Text]).
test(cat2, error(io_error(write, _))) :-
( current_prolog_flag(windows, true)
- -> Cmd = 'cmd /c rem true'
+ -> Cmd = 'cmd /c rem true',
+ Cleanup = true
; Cmd = true,
( current_prolog_flag(signals, false)
-> on_signal(pipe, OldSigPipe, ignore),

View File

@ -1,29 +0,0 @@
--- swipl-8.4.3/CMakeLists.txt.old 2022-06-17 10:48:26 +0000
+++ swipl-8.4.3/CMakeLists.txt 2022-06-17 10:49:01 +0000
@@ -120,7 +120,7 @@
################
# Installation directories
-if(WIN32)
+if(WIN32 AND NOT MSYS2)
set(SWIPL_INSTALL_DIR "."
CACHE STRING "Directory below <prefix> for installation")
@@ -134,7 +134,7 @@
set(SWIPL_TMP_DIR "c:/tmp" CACHE STRING
"Directory to be used if the environment variable TEMP is not set")
-else(WIN32)
+else()
if(SWIPL_VERSIONED_DIR)
set(SWIPL_INSTALL_DIR_DEF swipl-${SWIPL_VERSION_STRING})
@@ -169,7 +169,7 @@
set(SWIPL_INSTALL_MODULES ${SWIPL_INSTALL_PREFIX}/lib/${SWIPL_ARCH})
-endif(WIN32)
+endif()
set(SWIPL_CMAKE_NAMESPACE swipl::)
set(SWIPL_INSTALL_CMAKE_CONFIG_DIR lib/cmake/swipl)

View File

@ -1,19 +0,0 @@
--- swipl-9.0.3/src/CMakeLists.txt 2022-12-18 16:16:32 +0000
+++ swipl-9.0.3/src/CMakeLists.txt.new 2022-12-27 15:35:26 +0000
@@ -712,6 +712,16 @@
FILES ${CMAKE_CURRENT_SOURCE_DIR}/swipl.ico
DESTINATION ${SWIPL_INSTALL_PREFIX})
+if(MSYS2)
+install(DIRECTORY DESTINATION bin)
+file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/swipl
+ "#!/usr/bin/bash\n${CMAKE_INSTALL_PREFIX}/${SWIPL_INSTALL_ARCH_EXE}/swipl $@\n")
+file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/swipl-ld
+ "#!/usr/bin/bash\n${CMAKE_INSTALL_PREFIX}/${SWIPL_INSTALL_ARCH_EXE}/swipl-ld $@\n")
+install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/swipl DESTINATION bin)
+install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/swipl-ld DESTINATION bin)
+endif()
+
else(WIN32)
if(NOT BUILD_MACOS_BUNDLE)

View File

@ -1,19 +0,0 @@
--- swipl-8.4.3/boot/init.pl 2022-06-21 13:08:37 +0000
+++ src/swipl-8.4.3/boot/init.pl 2022-07-20 14:05:33 +0000
@@ -1069,10 +1069,14 @@
ArchLib = 'lib/fat-darwin'.
user:file_search_path(foreign, swi(ArchLib)) :-
- \+ current_prolog_flag(windows, true),
+ ( current_prolog_flag(msys2, true) ; \+ current_prolog_flag(windows, true) ),
current_prolog_flag(arch, Arch),
atom_concat('lib/', Arch, ArchLib).
user:file_search_path(foreign, swi(SoLib)) :-
( current_prolog_flag(windows, true)
+ -> ( current_prolog_flag(msys2, true)
+ -> current_prolog_flag(arch, Arch),
+ atomic_list_concat([bin, Arch], /, SoLib)
+ ; SoLib = bin
+ )
- -> SoLib = bin
; SoLib = lib
).

View File

@ -1,15 +0,0 @@
--- swipl-8.4.3/library/prolog_config.pl 2022-08-09 07:31:18 +0000
+++ swipl-8.4.3/library/prolog_config.pl.new 2022-08-09 07:31:11 +0000
@@ -92,7 +92,11 @@
( current_prolog_flag(c_libdir, Rel)
-> atomic_list_concat([Home, Rel], /, Value)
; current_prolog_flag(windows, true)
- -> atomic_list_concat([Home, bin], /, Value)
+ -> ( current_prolog_flag(msys2, true)
+ -> current_prolog_flag(arch, Arch),
+ atomic_list_concat([Home, bin, Arch], /, Value)
+ ; atomic_list_concat([Home, bin], /, Value)
+ )
; apple_bundle_libdir(LibDir)
-> Value = LibDir
; current_prolog_flag(arch, Arch)

View File

@ -1,15 +0,0 @@
--- swipl-9.0.0/library/build/tools.pl 2022-11-24 12:05:19 +0000
+++ swipl-9.0.0/library/build/tools.pl.new 2022-11-26 09:42:23 +0000
@@ -376,11 +376,12 @@
prolog_library_dir(Dir) :-
prolog:runtime_config(c_libdir, Dir),
!.
prolog_library_dir(Dir) :-
current_prolog_flag(windows, true),
+ \+ current_prolog_flag(msys2, true),
current_prolog_flag(home, Home),
!,
atomic_list_concat([Home, bin], /, Dir).
prolog_library_dir(Dir) :-
current_prolog_flag(home, Home),
( current_prolog_flag(c_libdir, Rel)

View File

@ -1,10 +0,0 @@
--- swipl-9.0.4/packages/clib/test_uri.pl 2023-01-27 11:09:04 +0000
+++ swipl-9.0.4/packages/clib/test_uri.pl 2023-01-27 17:27:29 +0000
@@ -37,6 +37,7 @@
:- module(test_uri,
[ test_uri/0
]).
+:- encoding(utf8).
:- asserta(user:file_search_path(library, '../plunit')).
:- asserta(user:file_search_path(library, '.')).

View File

@ -3,8 +3,8 @@
_realname=swi-prolog
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=9.0.4
pkgrel=3
pkgver=9.2.1
pkgrel=1
pkgdesc="Prolog environment (mingw-w64)"
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64')
@ -12,48 +12,30 @@ url="https://www.swi-prolog.org/"
license=('spdx:BSD-2-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-libwinpthread-git"
"${MINGW_PACKAGE_PREFIX}-zlib")
optdepends=("${MINGW_PACKAGE_PREFIX}-gmp: support for large integers"
"${MINGW_PACKAGE_PREFIX}-libyaml: yaml support"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-gmp")
optdepends=("${MINGW_PACKAGE_PREFIX}-libyaml: yaml support"
"${MINGW_PACKAGE_PREFIX}-db: support for Berkeley db"
"${MINGW_PACKAGE_PREFIX}-pcre2: support for regular expressions")
"${MINGW_PACKAGE_PREFIX}-pcre2: support for regular expressions"
"${MINGW_PACKAGE_PREFIX}-python: python interface")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-libarchive"
"${MINGW_PACKAGE_PREFIX}-libyaml"
"${MINGW_PACKAGE_PREFIX}-db"
"${MINGW_PACKAGE_PREFIX}-pcre2"
"${MINGW_PACKAGE_PREFIX}-xpm-nox"
"${MINGW_PACKAGE_PREFIX}-pkgconf")
source=("https://www.swi-prolog.org/download/stable/src/swipl-${pkgver}.tar.gz"
"01-test_pipe.patch"
"02-unixdirs-cmakelist.patch"
"03-unixdirs-src-cmakelist.patch"
"04-unixdirs-boot-init.patch"
"05-unixdirs-library-prolog_config.patch"
"06-unixdirs-build-tools.patch"
"07-test_uri.patch")
"01-plhome.patch")
sha256sums=('feb2815a51d34fa81cb34e8149830405935a7e1d1c1950461239750baa8b49f0'
'c412572542290b871a5f25fa088c96c09e778398f157322ecabee580b2a1be7b'
'30d729e5ea584e4f7c134f5fac2bc53d61081b0dd1f9812ba3bb0941ebb50b22'
'fbbc34b8a450c51839190eb7a0b3b43cd8a2ccb74e8fdbcde9ceb6ce60e61847'
'a7f1c46606466e0084f497247abbad71afa606fb24f1a0ceeb33d106d1b74299'
'5aa1172661f0ecfe2e90696dcbcb7632515ece0ede85fb67dda7f1d1cf5a0955'
'1e8ee40e4139a70c49b86bfa5147455ab9af3b91dc2f0972c4791be0059e7b01'
'43e5aeb9c48b0e03f2fe4b23c9f57377dba80b2731cfc5dcc51ca9886ce93fe7')
sha256sums=('77e8884d8330e1f6c91667400ea8721640f47c214061d3476ac469e9ad63eeee'
'78aba8c14b2e32d96381e751783f6c529e10fcaca73b60c449512e6677bdd684')
prepare() {
cd ${srcdir}/swipl-${pkgver}
patch -p1 < ${srcdir}/01-test_pipe.patch
patch -p1 < ${srcdir}/02-unixdirs-cmakelist.patch
patch -p1 < ${srcdir}/03-unixdirs-src-cmakelist.patch
patch -p1 < ${srcdir}/04-unixdirs-boot-init.patch
patch -p1 < ${srcdir}/05-unixdirs-library-prolog_config.patch
patch -p1 < ${srcdir}/06-unixdirs-build-tools.patch
patch -p1 < ${srcdir}/07-test_uri.patch
patch -p1 < ${srcdir}/01-plhome.patch
}
build() {
@ -67,13 +49,12 @@ build() {
fi
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
"${MINGW_PREFIX}"/bin/cmake \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
-DMSYS2=1 \
-DWIN32_DLLS="" \
-DMINGW_ROOT="${MINGW_PREFIX}" \
"${extra_config[@]}" \
-DUSE_GMP=ON \
-DSWIPL_PACKAGES_JAVA=OFF \
-DSWIPL_PACKAGES_X=OFF \
-DINSTALL_DOCUMENTATION=OFF \
@ -86,6 +67,17 @@ build() {
package() {
cd "${srcdir}/build-${MSYSTEM}"
DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install .
# Remove path reference in cmake and .pc files
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/**/*.cmake; do
sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f}
sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i ${_f}
done
for pcfile in "${pkgdir}${MINGW_PREFIX}"/share/pkgconfig/*.pc; do
sed -s "s|${MINGW_PREFIX}/lib|\${prefix}/lib|g" -i "${pcfile}"
done
install -Dm644 "${srcdir}/swipl-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
@ -93,4 +85,3 @@ check() {
cd "${srcdir}/build-${MSYSTEM}"
"${MINGW_PREFIX}"/bin/cmake.exe --build . --target test
}