[clisp] Add libsvm patch to fix FTBFS on Rawhide (bz 715970). Fix readline module to also use compat-readlin

Jerry James jjames at fedoraproject.org
Sat Jul 2 17:53:19 UTC 2011


commit 3e2265ad3e4d542d89d8e1aa59f4aa2e6a596fbd
Author: Jerry James <loganjerry at gmail.com>
Date:   Sat Jul 2 11:52:15 2011 -0600

    Add libsvm patch to fix FTBFS on Rawhide (bz 715970).
    Fix readline module to also use compat-readline5 instead of readline6.
    Enable use of lightning on supported arches.

 clisp-libsvm.patch |   63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 clisp.spec         |   30 +++++++++++++++++++-----
 2 files changed, 86 insertions(+), 7 deletions(-)
---
diff --git a/clisp-libsvm.patch b/clisp-libsvm.patch
new file mode 100644
index 0000000..b253991
--- /dev/null
+++ b/clisp-libsvm.patch
@@ -0,0 +1,63 @@
+--- modules/libsvm/config.h.in.orig	2010-06-30 12:02:55.000000000 -0600
++++ modules/libsvm/config.h.in	2011-06-23 14:28:00.454999254 -0600
+@@ -27,8 +27,8 @@
+ /* Define to 1 if you have the `svm_cross_validation' function. */
+ #undef HAVE_SVM_CROSS_VALIDATION
+ 
+-/* Define to 1 if you have the `svm_destroy_model' function. */
+-#undef HAVE_SVM_DESTROY_MODEL
++/* Define to 1 if you have the `svm_free_and_destroy_model' function. */
++#undef HAVE_SVM_FREE_AND_DESTROY_MODEL
+ 
+ /* Define to 1 if you have the `svm_destroy_param' function. */
+ #undef HAVE_SVM_DESTROY_PARAM
+--- modules/libsvm/configure.in.orig	2010-06-30 12:02:55.000000000 -0600
++++ modules/libsvm/configure.in	2011-06-23 14:28:49.333999905 -0600
+@@ -30,7 +30,7 @@
+ AC_CHECK_FUNCS(svm_check_parameter dnl
+ svm_check_probability_model dnl
+ svm_cross_validation dnl
+-svm_destroy_model dnl
++svm_free_and_destroy_model dnl
+ svm_destroy_param dnl
+ svm_get_labels dnl
+ svm_get_nr_class dnl
+--- modules/libsvm/configure.orig	2010-06-30 12:02:55.000000000 -0600
++++ modules/libsvm/configure	2011-06-23 14:28:27.827999766 -0600
+@@ -4555,7 +4555,7 @@
+ if test "$ac_cv_search_svm_train" = "no"; then
+   as_fn_error "cannot find LibSVM library" "$LINENO" 5
+ fi
+-for ac_func in svm_check_parameter svm_check_probability_model svm_cross_validation svm_destroy_model svm_destroy_param svm_get_labels svm_get_nr_class svm_get_svm_type svm_get_svr_probability svm_load_model svm_predict svm_predict_probability svm_predict_values svm_save_model svm_train svm_set_print_string_function
++for ac_func in svm_check_parameter svm_check_probability_model svm_cross_validation svm_free_and_destroy_model svm_destroy_param svm_get_labels svm_get_nr_class svm_get_svm_type svm_get_svr_probability svm_load_model svm_predict svm_predict_probability svm_predict_values svm_save_model svm_train svm_set_print_string_function
+ do :
+   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+--- modules/libsvm/libsvm.lisp.orig	2010-06-30 11:56:36.000000000 -0600
++++ modules/libsvm/libsvm.lisp	2011-06-23 14:33:44.334999678 -0600
+@@ -97,11 +97,11 @@
+ ;;; foreign functions and small wrappers
+ ;;;
+ 
+-(ffi:def-call-out svm_destroy_model
+-  (:arguments (model model)) (:return-type nil))
++(ffi:def-call-out svm_free_and_destroy_model
++  (:arguments (model (c-pointer model))) (:return-type nil))
+ (defun destroy-model (model)
+   (when (validp model)
+-    (svm_destroy_model model)
++    (svm_free_and_destroy_model (ffi:with-c-var (modelp 'model model) (ffi:c-var-address modelp)))
+     (setf (validp model) nil)))
+ (cl:defun finalize-model (model)
+   (ext:finalize (set-foreign-pointer model :copy) #'destroy-model)
+--- modules/libsvm/svm.xml.orig	2010-05-26 11:52:55.000000000 -0600
++++ modules/libsvm/svm.xml	2011-06-23 14:34:44.021999852 -0600
+@@ -91,7 +91,7 @@
+  <varlistentry><term><code>(destroy-model &model-r;)</code></term>
+   <listitem><simpara>Release the memory taken by the <type>model</type>
+     object and invalidate the &foreign-variable-t; &model-r;.</simpara>
+-   <simpara>Calls <function>svm_destroy_model</function>.</simpara>
++   <simpara>Calls <function>svm_free_and_destroy_model</function>.</simpara>
+    <simpara>You do &not-e; have to call this function yourself, it is
+     attached to the &model-r; by <function>train</function>
+     and <function>load-model</function> via &finalize;.</simpara>
diff --git a/clisp.spec b/clisp.spec
index 748e0c0..b0fbc28 100644
--- a/clisp.spec
+++ b/clisp.spec
@@ -1,12 +1,14 @@
 Name:		clisp
 Summary:	ANSI Common Lisp implementation
 Version:	2.49
-Release:	3%{?dist}
+Release:	4%{?dist}
 
 Group:		Development/Languages
 License:	GPLv2
 URL:		http://clisp.cons.org
-Source0:	http://downloads.sourceforge.net/project/clisp/clisp/%{version}/clisp-%{version}.tar.bz2
+Source0:	http://downloads.sourceforge.net/clisp/clisp-%{version}.tar.bz2
+# Adapt to libsvm 3.1.  Sent upstream 23 Jun 2011.
+Patch0:		clisp-libsvm.patch
 BuildRequires:	compat-readline5-devel
 BuildRequires:	db4-devel
 BuildRequires:	dbus-devel
@@ -17,6 +19,7 @@ BuildRequires:	gettext-devel
 BuildRequires:	ghostscript
 BuildRequires:	groff
 BuildRequires:	gtk2-devel
+BuildRequires:	gzip
 BuildRequires:	libICE-devel
 BuildRequires:	libSM-devel
 BuildRequires:	libX11-devel
@@ -33,6 +36,9 @@ BuildRequires:	pari-devel
 BuildRequires:	pcre-devel
 BuildRequires:	postgresql-devel
 BuildRequires:	zlib-devel
+%ifarch %{ix86} ppc sparc
+BuildRequires:	lightning
+%endif
 
 # See Red Hat bug #238954
 ExcludeArch:	ppc64
@@ -72,6 +78,7 @@ Files necessary for linking CLISP programs.
 
 %prep
 %setup -q
+%patch0
 
 # Convince CLisp to build against compat-readline5 instead of readline.
 # This is to avoid pulling the GPLv3 readline 6 into a GPLv2 CLisp binary.
@@ -93,10 +100,7 @@ sed -i -e 's/${wl}-rpath ${wl}/-L/g' src/build-aux/config.rpath
 
 %build
 %ifarch ppc ppc64
-%define opt_flags "$RPM_OPT_FLAGS -DNO_GENERATIONAL_GC -DNO_MULTIMAP_FILE -DNO_SINGLEMAP"
 ulimit -s unlimited
-%else
-%define opt_flags "$RPM_OPT_FLAGS"
 %endif
 
 # Do not need to specify base modules: i18n, readline, regexp, syscalls
@@ -107,6 +111,9 @@ ulimit -s unlimited
 	    --docdir=%{_docdir}/clisp-%{version} \
 	    --fsstnd=redhat \
 	    --hyperspec=http://www.lispworks.com/documentation/HyperSpec/ \
+%ifarch %{ix86} ppc sparc
+	    --with-jitc=lightning \
+%endif
 	    --with-module=berkeley-db \
 	    --with-module=bindings/glibc \
 	    --with-module=clx/new-clx \
@@ -124,8 +131,12 @@ ulimit -s unlimited
 	    --with-libreadline-prefix=`pwd`/readline \
 	    --cbc \
 	    build \
-	    CFLAGS="$RPM_OPT_FLAGS -I/usr/include/libsvm -Wa,--noexecstack" \
-	    LDFLAGS="-Wl,-z,noexecstack"
+%ifarch ppc ppc64
+	    CFLAGS="${RPM_OPT_FLAGS} -DNO_GENERATIONAL_GC -DNO_MULTIMAP_FILE -DNO_SINGLEMAP -I/usr/include/readline5 -I/usr/include/libsvm -Wa,--noexecstack -L%{_libdir}/readline5" \
+%else
+	    CFLAGS="${RPM_OPT_FLAGS} -I/usr/include/readline5 -I/usr/include/libsvm -Wa,--noexecstack -L%{_libdir}/readline5" \
+%endif
+	    LDFLAGS="-L%{_libdir}/readline5 -Wl,-z,noexecstack"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -194,6 +205,11 @@ rm -fr $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jun 23 2011 Jerry James <loganjerry at gmail.com> - 2.49-4
+- Add libsvm patch to fix FTBFS on Rawhide (bz 715970)
+- Fix readline module to also use compat-readline5 instead of readline6
+- Enable use of lightning on supported arches
+
 * Fri Feb 11 2011 Jerry James <loganjerry at gmail.com> - 2.49-3
 - Build with compat-readline5 instead of readline (#511303)
 - Build the libsvm module


More information about the scm-commits mailing list