diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index de57045..62f7e0e 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -13,19 +13,28 @@ depends=(glpk) makedepends=(swi-prolog) optdepends=('swi-prolog: SWI Prolog interface') options=(!docs) -source=(https://bugseng.com/products/ppl/download/ftp/releases/$pkgver/ppl-$pkgver.tar.gz) -sha256sums=('6bc36dd4a87abc429d8f9c00c53e334e5041a9b0857cfc00dbad6ef14294aac8') +source=(https://bugseng.com/products/ppl/download/ftp/releases/$pkgver/ppl-$pkgver.tar.gz + ppl-1.2-prolog8.2.patch + ppl-1.2-configure.patch) +sha256sums=('6bc36dd4a87abc429d8f9c00c53e334e5041a9b0857cfc00dbad6ef14294aac8' + '847feca3cf81fc27ce3d5c9f38f7a9b83cc619749e319f00e9933e175de027ea' + '31118efd1f3df077f4a40f1ec1bb0ef9e7f324bc47f82c15cb92852c9c4b5994') validpgpkeys=('058E41DB299DE2DD0AC649CA881457CBB5944392') # Roberto Bagnara prepare() { cd ppl-$pkgver -# Adapt to SWI Prolog 8.x (Fedora) - sed -i 's/-dump-runtime-variables/-&/g' configure +# Fix prolog 8.2 detection (Fedora) + patch -Np1 -i ../ppl-1.2-prolog8.2.patch +# Fix configure check broken by LTO (Fedora) + patch -Np1 -i ../ppl-1.2-configure.patch # Fix detection of C++11 features (Fedora) - sed -i 's,== 201103L,>= 201103L,g' configure + sed -i 's,== 201103L,>= 201103L,g' m4/ac_check_cxx11.m4 + autoreconf -fi } build() { +# Adapt to SWI Prolog 8.x (Fedora) + CPPFLAGS+="$(pkgconf --cflags-only-I swipl)" cd ppl-$pkgver ./configure --prefix=/usr --enable-interfaces="c,cxx,swi_prolog" make diff --git a/trunk/ppl-1.2-configure.patch b/trunk/ppl-1.2-configure.patch new file mode 100644 index 0000000..fd905d1 --- /dev/null +++ b/trunk/ppl-1.2-configure.patch @@ -0,0 +1,16 @@ +diff -Nrup a/m4/ac_check_fpu_control.m4 b/m4/ac_check_fpu_control.m4 +--- a/m4/ac_check_fpu_control.m4 2016-02-11 05:31:26.000000000 -0700 ++++ b/m4/ac_check_fpu_control.m4 2020-05-21 13:19:45.448773119 -0600 +@@ -49,9 +49,9 @@ main() { + + #else + +- float nf1 = -3, pf1 = 3, f2 = 5; +- double nd1 = -7, pd1 = 7, d2 = 11; +-long double nl1 = -13, pl1 = 13, l2 = 17; ++ volatile float nf1 = -3, pf1 = 3, f2 = 5; ++ volatile double nd1 = -7, pd1 = 7, d2 = 11; ++volatile long double nl1 = -13, pl1 = 13, l2 = 17; + + float nf[2], pf[2]; + double nd[2], pd[2]; diff --git a/trunk/ppl-1.2-prolog8.2.patch b/trunk/ppl-1.2-prolog8.2.patch new file mode 100644 index 0000000..cf1e8a7 --- /dev/null +++ b/trunk/ppl-1.2-prolog8.2.patch @@ -0,0 +1,196 @@ +--- a/interfaces/Prolog/Ciao/ciao_cfli.hh ++++ b/interfaces/Prolog/Ciao/ciao_cfli.hh +@@ -296,7 +296,7 @@ Prolog_get_atom_name(Prolog_term_ref t, + The behavior is undefined if \p t is not a Prolog compound term. + */ + inline int +-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) { ++Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) { + assert(Prolog_is_compound(t)); + *ap = ciao_structure_name(t); + *ip = ciao_structure_arity(t); +--- a/interfaces/Prolog/GNU/gprolog_cfli.hh ++++ b/interfaces/Prolog/GNU/gprolog_cfli.hh +@@ -420,9 +420,11 @@ Prolog_get_atom_name(Prolog_term_ref t, + The behavior is undefined if \p t is not a Prolog compound term. + */ + inline int +-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) { ++Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) { ++ int i; + assert(Prolog_is_compound(t)); +- Rd_Compound_Check(t, ap, ip); ++ Rd_Compound_Check(t, ap, &i); ++ *ip = (size_t)i; + return 1; + } + +--- a/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4 ++++ b/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4 +@@ -1934,7 +1934,7 @@ m4_define(`ppl_@CLASS@_map_space_dimensi + while (Prolog_is_cons(t_pfunc)) { + Prolog_get_cons(t_pfunc, t_pair, t_pfunc); + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t_pair, &functor, &arity); + if (arity != 2 || functor != a_minus) + return PROLOG_FAILURE; +--- a/interfaces/Prolog/ppl_prolog_common.cc ++++ b/interfaces/Prolog/ppl_prolog_common.cc +@@ -937,7 +937,7 @@ build_linear_expression(Prolog_term_ref + return Linear_Expression(integer_term_to_Coefficient(t)); + else if (Prolog_is_compound(t)) { + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t, &functor, &arity); + switch (arity) { + case 1: +@@ -1000,7 +1000,7 @@ Constraint + build_constraint(Prolog_term_ref t, const char* where) { + if (Prolog_is_compound(t)) { + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t, &functor, &arity); + if (arity == 2) { + Prolog_term_ref arg1 = Prolog_new_term_ref(); +@@ -1073,7 +1073,7 @@ Congruence + build_congruence(Prolog_term_ref t, const char* where) { + if (Prolog_is_compound(t)) { + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t, &functor, &arity); + if (arity == 2) { + Prolog_term_ref arg1 = Prolog_new_term_ref(); +@@ -1084,7 +1084,7 @@ build_congruence(Prolog_term_ref t, cons + // / + if (Prolog_is_integer(arg2)) { + Prolog_atom functor1; +- int arity1; ++ size_t arity1; + Prolog_get_compound_name_arity(arg1, &functor1, &arity1); + if (arity1 == 2) { + if (functor1 == a_is_congruent_to) { +@@ -1137,7 +1137,7 @@ Generator + build_generator(Prolog_term_ref t, const char* where) { + if (Prolog_is_compound(t)) { + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t, &functor, &arity); + if (arity == 1) { + Prolog_term_ref arg = Prolog_new_term_ref(); +@@ -1174,7 +1174,7 @@ Grid_Generator + build_grid_generator(Prolog_term_ref t, const char* where) { + if (Prolog_is_compound(t)) { + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t, &functor, &arity); + if (arity == 1) { + Prolog_term_ref arg = Prolog_new_term_ref(); +@@ -1406,7 +1406,7 @@ Variable + term_to_Variable(Prolog_term_ref t, const char* where) { + if (Prolog_is_compound(t)) { + Prolog_atom functor; +- int arity; ++ size_t arity; + Prolog_get_compound_name_arity(t, &functor, &arity); + if (functor == a_dollar_VAR && arity == 1) { + Prolog_term_ref arg = Prolog_new_term_ref(); +@@ -1554,7 +1554,7 @@ term_to_boundary(Prolog_term_ref t_b, Bo + return false; + + Prolog_atom functor; +- int arity; ++ size_t arity; + + Prolog_get_compound_name_arity(t_b, &functor, &arity); + // A boundary term is either of the form c(Limit) or o(Limit). +--- a/interfaces/Prolog/SICStus/sicstus_cfli.h ++++ b/interfaces/Prolog/SICStus/sicstus_cfli.h +@@ -134,7 +134,7 @@ Prolog_get_atom_name(Prolog_term_ref t, + + PCFLI_DECLSPEC int + Prolog_get_compound_name_arity(Prolog_term_ref t, +- Prolog_atom& name, int& arity); ++ Prolog_atom& name, size_t& arity); + + PCFLI_DECLSPEC int + Prolog_get_arg(int i, Prolog_term_ref t, Prolog_term_ref a); +--- a/interfaces/Prolog/SICStus/sicstus_cfli.ic ++++ b/interfaces/Prolog/SICStus/sicstus_cfli.ic +@@ -262,9 +262,12 @@ Prolog_get_atom_name(Prolog_term_ref t, + The behavior is undefined if \p t is not a Prolog compound term. + */ + PCFLI_EXTERN_INLINE int +-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) { ++Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) { ++ int i, ret; + assert(Prolog_is_compound(t)); +- return SP_get_functor(t, ap, ip); ++ ret = SP_get_functor(t, ap, &i); ++ *ip = i; ++ return ret; + } + + /*! +--- a/interfaces/Prolog/SWI/swi_cfli.hh ++++ b/interfaces/Prolog/SWI/swi_cfli.hh +@@ -346,7 +346,7 @@ Prolog_get_atom_name(Prolog_term_ref t, + The behavior is undefined if \p t is not a Prolog compound term. + */ + inline int +-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) { ++Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) { + assert(Prolog_is_compound(t)); + return PL_get_name_arity(t, ap, ip); + } +--- a/interfaces/Prolog/XSB/xsb_cfli.hh ++++ b/interfaces/Prolog/XSB/xsb_cfli.hh +@@ -314,10 +314,10 @@ Prolog_get_atom_name(Prolog_term_ref t, + The behavior is undefined if \p t is not a Prolog compound term. + */ + inline int +-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) { ++Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) { + assert(Prolog_is_compound(t)); + *ap = p2c_functor(t); +- *ip = p2c_arity(t); ++ *ip = (size_t)p2c_arity(t); + return 1; + } + +--- a/interfaces/Prolog/YAP/yap_cfli.hh ++++ b/interfaces/Prolog/YAP/yap_cfli.hh +@@ -313,7 +313,7 @@ Prolog_get_atom_name(Prolog_term_ref t, + The behavior is undefined if \p t is not a Prolog compound term. + */ + inline int +-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) { ++Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) { + assert(Prolog_is_compound(t)); + YAP_Functor f = YAP_FunctorOfTerm(t); + *ap = YAP_NameOfFunctor(f); +--- a/m4/ac_check_swi_prolog.m4 ++++ b/m4/ac_check_swi_prolog.m4 +@@ -45,11 +45,11 @@ then + fi + if test x$swi_prolog != x + then +- swi_prolog_base=`$swi_prolog -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'` +- swi_prolog_version=`$swi_prolog -dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'` +- swi_prolog_arch=`$swi_prolog -dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'` +- swi_prolog_libs=`$swi_prolog -dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'` +- swi_prolog_lib=`$swi_prolog -dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'` ++ swi_prolog_base=`$swi_prolog --dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'` ++ swi_prolog_version=`$swi_prolog --dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'` ++ swi_prolog_arch=`$swi_prolog --dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'` ++ swi_prolog_libs=`$swi_prolog --dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'` ++ swi_prolog_lib=`$swi_prolog --dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'` + + dnl Additional version checks could be inserted here, if necessary. +