[packages/poldek] - fix building and installing python bindings

baggins baggins at pld-linux.org
Sun Apr 16 14:48:51 CEST 2017


commit 9b77d5f3cd9c7767448197e1da33368b3b12ea32
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Apr 16 14:48:33 2017 +0200

    - fix building and installing python bindings

 poldek.spec      | 10 +++++++--
 python-fix.patch | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 2 deletions(-)
---
diff --git a/poldek.spec b/poldek.spec
index 2b70655..18e1add 100644
--- a/poldek.spec
+++ b/poldek.spec
@@ -65,6 +65,7 @@ Patch1:		%{name}-config.patch
 Patch2:		pm-hooks.patch
 Patch3:		WTERMSIG.patch
 Patch4:		%{name}-multiproto.patch
+Patch5:		python-fix.patch
 URL:		http://poldek.pld-linux.org/
 BuildRequires:	%{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
 BuildRequires:	autoconf
@@ -230,6 +231,7 @@ Moduły języka Python dla poldka.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %{__rm} m4/libtool.m4 m4/lt*.m4
 
@@ -268,6 +270,10 @@ CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
 %{__make} -j1
 #	--enable-trace
 
+%if %{with python}
+%{__make} -C python
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/var/cache/%{name}
@@ -280,7 +286,7 @@ install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
 %if %{with python}
 %{__make} -C python -j1 install \
 	DESTDIR=$RPM_BUILD_ROOT \
-	libdir=%{py_sitedir}
+	py_sitedir=%{py_sitedir}
 %endif
 
 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
@@ -405,7 +411,7 @@ cp -a conf configs
 
 %if %{with python}
 %py_postclean
-%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so}
 %endif
 
 %find_lang %{name}
diff --git a/python-fix.patch b/python-fix.patch
new file mode 100644
index 0000000..f5b4c3f
--- /dev/null
+++ b/python-fix.patch
@@ -0,0 +1,66 @@
+In file included from /usr/include/stdint.h:27:0,
+                 from /usr/lib64/gcc/x86_64-pld-linux/6.3.0/include/stdint.h:9,
+                 from local_stdint.c:2,
+                 from wrap_poldekmod.c:3066:
+/usr/include/bits/types.h:143:34: error: conflicting types for ‘__fsid_t’
+ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs.  */
+                                  ^~~~~~~~
+In file included from /usr/include/stdio.h:36:0,
+                 from /usr/include/python2.7/Python.h:33,
+                 from wrap_poldekmod.c:149:
+/usr/include/bits/types.h:143:26: note: previous declaration of ‘__fsid_t’ was here
+ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs.  */
+                          ^~~~~~~~
+make: *** [Makefile:487: wrap_poldekmod.lo] Error 1
+
+--- poldek-0.32.2/python/Makefile.am~	2016-01-30 15:05:57.000000000 +0100
++++ poldek-0.32.2/python/Makefile.am	2017-04-16 14:28:51.269840377 +0200
+@@ -3,8 +3,8 @@
+ py_prefix  = $(shell python -c "import sys; print sys.prefix")
+ py_incdir  = $(py_prefix)/include/python$(py_ver)
+ 
+-EXTRA_DIST = poldekmod.i local_stdint.c pyldek.py run.sh
+-CLEANFILES = wrap_* poldekmod.py local_stdint.h
++EXTRA_DIST = poldekmod.i pyldek.py run.sh
++CLEANFILES = wrap_* poldekmod.py
+ 
+ AM_CPPFLAGS = @TRURL_INCLUDE@ @TNDB_INCLUDE@ -I$(top_srcdir) -I$(py_incdir) -I.
+ 
+@@ -21,16 +21,12 @@
+ CFLAGS=
+ CPPFLAGS += -DSWIG -DPOCLIDEK_ITSELF 
+ 
+-poldekmod.i: local_stdint.h
+-
+-#install-exec-hook:
+-#	$(mkinstalldirs) "$(DESTDIR)$(py_sitedir)"
++install-exec-hook:
++	$(mkinstalldirs) "$(DESTDIR)$(py_sitedir)"
++	$(install_sh) .libs/_poldekmod.so "$(DESTDIR)$(py_sitedir)"
+ 
+ poldekmod.py: wrap_poldekmod.c
+ 
+-local_stdint.h: local_stdint.c
+-	$(CPP) $< > $@
+-
+ #wrap_poldekmod.c: poldekmod.i
+ #	$(SWIG) $(SWIG_PYTHON_OPT) $(INCLUDES) -I/usr/include -o $@ $<
+ 
+--- poldek-0.32.2/python/poldekmod.i~	2016-01-30 15:05:57.000000000 +0100
++++ poldek-0.32.2/python/poldekmod.i	2017-04-16 14:27:50.169060494 +0200
+@@ -1,7 +1,6 @@
+ %module poldekmod
+ 
+ %{
+-#include "local_stdint.h"
+ #include "poldek.h"
+ #include "trurl/narray.h"
+ #include "trurl/nhash.h"
+@@ -32,7 +32,6 @@
+ %}
+ 
+ %include exception.i
+-%include "local_stdint.h"
+ %include "trurl/narray.h"
+ %include "capreq.h"
+ %include "pkg.h"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/poldek.git/commitdiff/9b77d5f3cd9c7767448197e1da33368b3b12ea32



More information about the pld-cvs-commit mailing list