[packages/linux-gpib] - added guile2 patch, enabled guile binding
qboosh
qboosh at pld-linux.org
Wed Jul 6 21:09:24 CEST 2016
commit 91dbb87421ab5f80e2b55a27d3dc39942a442a44
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Jul 6 21:09:35 2016 +0200
- added guile2 patch, enabled guile binding
linux-gpib-guile2.patch | 43 +++++++++++++++++++++++++++++++++++++++++++
linux-gpib.spec | 43 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 83 insertions(+), 3 deletions(-)
---
diff --git a/linux-gpib.spec b/linux-gpib.spec
index b771b5b..d379ad6 100644
--- a/linux-gpib.spec
+++ b/linux-gpib.spec
@@ -1,6 +1,5 @@
# TODO:
# - where to get firmware from?
-# - guile 2 support
# - PHP 7 support
#
# Conditional build:
@@ -11,7 +10,7 @@
%bcond_without docs # documentation build
%bcond_with hotplug # legacy hotplug support
%bcond_without static_libs # static library
-%bcond_with guile # guile binding
+%bcond_without guile # guile binding
%bcond_without perl # Perl binding
%bcond_without php # PHP binding
%bcond_without python # Python binding
@@ -32,6 +31,7 @@ Patch1: %{name}-destdir.patch
Patch2: %{name}-python.patch
Patch3: %{name}-perl.patch
Patch4: %{name}-firmwaredir.patch
+Patch5: %{name}-guile2.patch
URL: http://linux-gpib.sourceforge.net/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
@@ -44,7 +44,7 @@ BuildRequires: kernel-module-build >= 3:2.6.8
BuildRequires: bison
%{?with_docs:BuildRequires: docbook-utils}
BuildRequires: flex
-%{?with_guile:BuildRequires: guile-devel < 5:2.0}
+%{?with_guile:BuildRequires: guile-devel >= 1.4}
%{?with_perl:BuildRequires: perl-devel}
%{?with_php:BuildRequires: php-devel < 4:7}
%{?with_python:BuildRequires: python-devel >= 2}
@@ -108,6 +108,19 @@ Static GPIB library.
%description static -l pl.UTF-8
Biblioteka statyczna GPIB.
+%package -n guile-gpib
+Summary: Guile bindings for GPIB library
+Summary(pl.UTF-8): Wiązania Guile do biblioteki GPIB
+Group: Development/Languages/Perl
+Requires: %{name}-libs = %{version}-%{release}
+Requires: guile-libs
+
+%description -n guile-gpib
+Guile bindings for GPIB library.
+
+%description -n guile-gpib -l pl.UTF-8
+Wiązania Guile do biblioteki GPIB.
+
%package -n perl-gpib
Summary: Perl bindings for GPIB library
Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
@@ -206,6 +219,7 @@ cd drivers/gpib\
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
# disable modules build by default, just install userspace header
echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
@@ -221,6 +235,9 @@ done
%{__autoconf}
%{__autoheader}
%{__automake}
+%if %{with guile}
+CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
+%endif
%configure \
%ifarch %{ix86}
--enable-isa \
@@ -267,6 +284,13 @@ ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
+%if %{with guile}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
+%if %{with static_libs}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
+%endif
+%endif
+
%if %{with perl}
%{__make} -C language/perl pure_install \
DESTDIR=$RPM_BUILD_ROOT
@@ -298,6 +322,12 @@ rm -rf $RPM_BUILD_ROOT
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
+%post -n guile-gpib -p /sbin/ldconfig
+%postun -n guile-gpib -p /sbin/ldconfig
+
+%post -n tcl-gpib -p /sbin/ldconfig
+%postun -n tcl-gpib -p /sbin/ldconfig
+
%if %{with userspace}
%files
%defattr(644,root,root,755)
@@ -345,6 +375,13 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libgpib.a
%endif
+%if %{with guile}
+%files -n guile-gpib
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
+%attr(755,root,root) %{_libdir}/libgpib-guile.so
+%endif
+
%if %{with perl}
%files -n perl-gpib
%defattr(644,root,root,755)
diff --git a/linux-gpib-guile2.patch b/linux-gpib-guile2.patch
new file mode 100644
index 0000000..427a252
--- /dev/null
+++ b/linux-gpib-guile2.patch
@@ -0,0 +1,43 @@
+--- linux-gpib-4.0.3/configure.ac.orig 2016-04-09 15:34:55.000000000 +0200
++++ linux-gpib-4.0.3/configure.ac 2016-07-06 17:55:18.567320365 +0200
+@@ -143,8 +143,10 @@
+ fi
+
+ dnl Checks for libraries.
++AC_CHECK_LIB([guile-2.0],[scm_c_define],[:],[
+ AC_CHECK_LIB([guile],[gh_define],[echo this prevents default actions from occurring > /dev/null],
+ [BIND_GUILE="no";AC_MSG_NOTICE([libguile not found, disabling guile binding])],[])
++])
+
+ AC_CHECK_LIB([readline], [readline],
+ [readline_lib=yes;AC_SUBST([LIB_READLINE_LDFLAGS], ["-lreadline -lncurses"])],
+--- linux-gpib-4.0.3/language/guile/gpib.h.orig 2016-04-09 15:33:09.000000000 +0200
++++ linux-gpib-4.0.3/language/guile/gpib.h 2016-07-06 20:44:07.355781339 +0200
+@@ -22,12 +22,12 @@
+ #ifndef SCM_GPIB_H
+ #define SCM_GPIB_H 1
+
+-#if defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 5) && \
+- defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION >= 1)
++#if defined (SCM_MAJOR_VERSION) && ((SCM_MAJOR_VERSION > 1) || ((SCM_MAJOR_VERSION == 1) && \
++ defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 5)))
+ #define SCM_VERSION_15X 1
+ #endif
+-#if defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 7) && \
+- defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION >= 1)
++#if defined (SCM_MAJOR_VERSION) && ((SCM_MAJOR_VERSION > 1) || ((SCM_MAJOR_VERSION == 1) && \
++ defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 7)))
+ #define SCM_VERSION_17X 1
+ #endif
+
+--- linux-gpib-4.0.3/language/guile/gpib.c.orig 2016-04-09 15:33:09.000000000 +0200
++++ linux-gpib-4.0.3/language/guile/gpib.c 2016-07-06 18:07:48.129926301 +0200
+@@ -23,7 +23,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include <guile/gh.h>
++#include <libguile.h>
+ #include <gpib/ib.h>
+
+ #include "gpib.h"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/linux-gpib.git/commitdiff/91dbb87421ab5f80e2b55a27d3dc39942a442a44
More information about the pld-cvs-commit
mailing list