Accepting request 566624 from openSUSE:Factory:Staging:O

- Really conditionalize the python3 option to allow us building
  without any python2 present
  * u_build_python3.patch
- Convert to pkgconfig style deps
- Format bit with spec-cleaner

OBS-URL: https://build.opensuse.org/request/show/566624
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libxcb?expand=0&rev=50
This commit is contained in:
Stefan Dirsch 2018-01-17 14:10:23 +00:00 committed by Git OBS Bridge
parent aae4bce3eb
commit f41d2129c3
3 changed files with 143 additions and 152 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Jan 17 11:22:29 UTC 2018 - tchvatal@suse.com
- Really conditionalize the python3 option to allow us building
without any python2 present
* u_build_python3.patch
- Convert to pkgconfig style deps
- Format bit with spec-cleaner
-------------------------------------------------------------------
Mon Jan 8 13:53:53 UTC 2018 - msrb@suse.com

View File

@ -16,21 +16,19 @@
#
%if %suse_version >= 1500
%define have_python2 0
%else
%define have_python2 1
%endif
Name: libxcb
%define lname libxcb1
%if 0%{?suse_version} >= 1500
%bcond_with python2
%else
%bcond_without python2
%endif
Name: libxcb
Version: 1.12
Release: 0
Summary: X11 core protocol C library
License: MIT
Group: Development/Libraries/C and C++
Url: http://xcb.freedesktop.org/
#Git-Clone: git://anongit.freedesktop.org/xcb/libxcb
#Git-Web: http://cgit.freedesktop.org/xcb/libxcb/
#DL-URL: http://xcb.freedesktop.org/dist/
@ -39,28 +37,25 @@ Source1: baselibs.conf
Patch1: bug-262309_xcb-xauthlocalhostname.diff
Patch2: n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch
Patch3: U_add-support-for-eventstruct.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Patch4: u_build_python3.patch
BuildRequires: autoconf >= 2.57
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: python-base >= 2.6
BuildRequires: python-xml
BuildRequires: xsltproc
BuildRequires: pkgconfig(check) >= 0.9.4
BuildRequires: pkgconfig(pthread-stubs)
BuildRequires: pkgconfig(xau) >= 0.99.2
BuildRequires: pkgconfig(xcb-proto) >= 1.12
BuildRequires: pkgconfig(xorg-macros) >= 1.18
#optional#BuildRequires: pkgconfig(xdmcp)
%if 0%{?suse_version} >= 1210
BuildRequires: xsltproc
%else
BuildRequires: libxslt
%endif
%if %{have_python2}
%if %{with python2}
BuildRequires: python-base >= 2.6
BuildRequires: python-xcb-proto-devel >= 7.6_1.12
BuildRequires: python-xml
%else
BuildRequires: python3-base
BuildRequires: python3-xcb-proto-devel >= 7.6_1.12
BuildRequires: python3-xml
%endif
%description
@ -70,10 +65,9 @@ protocol, improved threading support, and extensibility.
%package -n libxcb1
Summary: X11 core protocol C library
# O/P added for 12.2
Group: System/Libraries
Provides: xorg-x11-libxcb = 7.6_%version-%release
Obsoletes: xorg-x11-libxcb < 7.6_%version-%release
Provides: xorg-x11-libxcb = 7.6_%{version}-%{release}
Obsoletes: xorg-x11-libxcb < 7.6_%{version}-%{release}
%description -n libxcb1
The X protocol C-language Binding (XCB) is a replacement for Xlib
@ -346,32 +340,32 @@ video-hardware.
%package devel
Summary: Development files for the X11 protocol C library
Group: Development/Libraries/C and C++
Requires: libxcb-composite0 = %version
Requires: libxcb-damage0 = %version
Requires: libxcb-dpms0 = %version
Requires: libxcb-dri2-0 = %version
Requires: libxcb-dri3-0 = %version
Requires: libxcb-glx0 = %version
Requires: libxcb-present0 = %version
Requires: libxcb-randr0 = %version
Requires: libxcb-record0 = %version
Requires: libxcb-render0 = %version
Requires: libxcb-res0 = %version
Requires: libxcb-screensaver0 = %version
Requires: libxcb-shape0 = %version
Requires: libxcb-shm0 = %version
Requires: libxcb-sync1 = %version
Requires: libxcb-xf86dri0 = %version
Requires: libxcb-xfixes0 = %version
Requires: libxcb-xinerama0 = %version
Requires: libxcb-xinput0 = %version
Requires: libxcb-xkb1 = %version
Requires: libxcb-xtest0 = %version
Requires: libxcb-xv0 = %version
Requires: libxcb-xvmc0 = %version
Requires: libxcb-composite0 = %{version}
Requires: libxcb-damage0 = %{version}
Requires: libxcb-dpms0 = %{version}
Requires: libxcb-dri2-0 = %{version}
Requires: libxcb-dri3-0 = %{version}
Requires: libxcb-glx0 = %{version}
Requires: libxcb-present0 = %{version}
Requires: libxcb-randr0 = %{version}
Requires: libxcb-record0 = %{version}
Requires: libxcb-render0 = %{version}
Requires: libxcb-res0 = %{version}
Requires: libxcb-screensaver0 = %{version}
Requires: libxcb-shape0 = %{version}
Requires: libxcb-shm0 = %{version}
Requires: libxcb-sync1 = %{version}
Requires: libxcb-xf86dri0 = %{version}
Requires: libxcb-xfixes0 = %{version}
Requires: libxcb-xinerama0 = %{version}
Requires: libxcb-xinput0 = %{version}
Requires: libxcb-xkb1 = %{version}
Requires: libxcb-xtest0 = %{version}
Requires: libxcb-xv0 = %{version}
Requires: libxcb-xvmc0 = %{version}
# O/P added for 12.2
Provides: xorg-x11-libxcb-devel = 7.6_%version-%release
Obsoletes: xorg-x11-libxcb-devel < 7.6_%version-%release
Provides: xorg-x11-libxcb-devel = 7.6_%{version}-%{release}
Obsoletes: xorg-x11-libxcb-devel < 7.6_%{version}-%{release}
%description devel
The X protocol C-language Binding (XCB) is a replacement for Xlib
@ -379,7 +373,7 @@ featuring a small footprint, latency hiding, direct access to the
protocol, improved threading support, and extensibility.
This package contains the development headers for the library found
in %lname.
in %{lname}.
%package devel-doc
Summary: Documentation for libxcb
@ -396,13 +390,14 @@ libxcb.
%prep
%setup -q
%patch -P 1 -p0
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
./autogen.sh
%configure --docdir=%_docdir/%name \
%configure --docdir=%{_docdir}/%{name} \
--disable-static \
--enable-xinput \
--enable-xkb \
@ -410,209 +405,137 @@ libxcb.
make %{?_smp_mflags}
%install
make install DESTDIR="%buildroot"
rm -f "%buildroot/%_libdir"/*.la
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
%post -n libxcb1 -p /sbin/ldconfig
%postun -n libxcb1 -p /sbin/ldconfig
%post -n libxcb-composite0 -p /sbin/ldconfig
%postun -n libxcb-composite0 -p /sbin/ldconfig
%post -n libxcb-damage0 -p /sbin/ldconfig
%postun -n libxcb-damage0 -p /sbin/ldconfig
%post -n libxcb-dpms0 -p /sbin/ldconfig
%postun -n libxcb-dpms0 -p /sbin/ldconfig
%post -n libxcb-dri2-0 -p /sbin/ldconfig
%postun -n libxcb-dri2-0 -p /sbin/ldconfig
%post -n libxcb-dri3-0 -p /sbin/ldconfig
%postun -n libxcb-dri3-0 -p /sbin/ldconfig
%post -n libxcb-glx0 -p /sbin/ldconfig
%postun -n libxcb-glx0 -p /sbin/ldconfig
%post -n libxcb-randr0 -p /sbin/ldconfig
%postun -n libxcb-randr0 -p /sbin/ldconfig
%post -n libxcb-record0 -p /sbin/ldconfig
%postun -n libxcb-record0 -p /sbin/ldconfig
%post -n libxcb-render0 -p /sbin/ldconfig
%postun -n libxcb-render0 -p /sbin/ldconfig
%post -n libxcb-res0 -p /sbin/ldconfig
%postun -n libxcb-res0 -p /sbin/ldconfig
%post -n libxcb-screensaver0 -p /sbin/ldconfig
%postun -n libxcb-screensaver0 -p /sbin/ldconfig
%post -n libxcb-shape0 -p /sbin/ldconfig
%postun -n libxcb-shape0 -p /sbin/ldconfig
%post -n libxcb-shm0 -p /sbin/ldconfig
%postun -n libxcb-shm0 -p /sbin/ldconfig
%post -n libxcb-sync1 -p /sbin/ldconfig
%postun -n libxcb-sync1 -p /sbin/ldconfig
%post -n libxcb-present0 -p /sbin/ldconfig
%postun -n libxcb-present0 -p /sbin/ldconfig
%post -n libxcb-xf86dri0 -p /sbin/ldconfig
%postun -n libxcb-xf86dri0 -p /sbin/ldconfig
%post -n libxcb-xfixes0 -p /sbin/ldconfig
%postun -n libxcb-xfixes0 -p /sbin/ldconfig
%post -n libxcb-xkb1 -p /sbin/ldconfig
%postun -n libxcb-xkb1 -p /sbin/ldconfig
%post -n libxcb-xinerama0 -p /sbin/ldconfig
%postun -n libxcb-xinerama0 -p /sbin/ldconfig
%post -n libxcb-xinput0 -p /sbin/ldconfig
%postun -n libxcb-xinput0 -p /sbin/ldconfig
%post -n libxcb-xtest0 -p /sbin/ldconfig
%postun -n libxcb-xtest0 -p /sbin/ldconfig
%post -n libxcb-xv0 -p /sbin/ldconfig
%postun -n libxcb-xv0 -p /sbin/ldconfig
%post -n libxcb-xvmc0 -p /sbin/ldconfig
%postun -n libxcb-xvmc0 -p /sbin/ldconfig
%files -n libxcb1
%defattr(-,root,root)
%_libdir/libxcb.so.1*
%{_libdir}/libxcb.so.1*
%files -n libxcb-composite0
%defattr(-,root,root)
%_libdir/libxcb-composite.so.0*
%{_libdir}/libxcb-composite.so.0*
%files -n libxcb-damage0
%defattr(-,root,root)
%_libdir/libxcb-damage.so.0*
%{_libdir}/libxcb-damage.so.0*
%files -n libxcb-dpms0
%defattr(-,root,root)
%_libdir/libxcb-dpms.so.0*
%{_libdir}/libxcb-dpms.so.0*
%files -n libxcb-dri2-0
%defattr(-,root,root)
%_libdir/libxcb-dri2.so.0*
%{_libdir}/libxcb-dri2.so.0*
%files -n libxcb-dri3-0
%defattr(-,root,root)
%_libdir/libxcb-dri3.so.0*
%{_libdir}/libxcb-dri3.so.0*
%files -n libxcb-glx0
%defattr(-,root,root)
%_libdir/libxcb-glx.so.0*
%{_libdir}/libxcb-glx.so.0*
%files -n libxcb-randr0
%defattr(-,root,root)
%_libdir/libxcb-randr.so.0*
%{_libdir}/libxcb-randr.so.0*
%files -n libxcb-record0
%defattr(-,root,root)
%_libdir/libxcb-record.so.0*
%{_libdir}/libxcb-record.so.0*
%files -n libxcb-render0
%defattr(-,root,root)
%_libdir/libxcb-render.so.0*
%{_libdir}/libxcb-render.so.0*
%files -n libxcb-res0
%defattr(-,root,root)
%_libdir/libxcb-res.so.0*
%{_libdir}/libxcb-res.so.0*
%files -n libxcb-screensaver0
%defattr(-,root,root)
%_libdir/libxcb-screensaver.so.0*
%{_libdir}/libxcb-screensaver.so.0*
%files -n libxcb-shape0
%defattr(-,root,root)
%_libdir/libxcb-shape.so.0*
%{_libdir}/libxcb-shape.so.0*
%files -n libxcb-shm0
%defattr(-,root,root)
%_libdir/libxcb-shm.so.0*
%{_libdir}/libxcb-shm.so.0*
%files -n libxcb-sync1
%defattr(-,root,root)
%_libdir/libxcb-sync.so.1*
%{_libdir}/libxcb-sync.so.1*
%files -n libxcb-present0
%defattr(-,root,root)
%_libdir/libxcb-present.so.0*
%{_libdir}/libxcb-present.so.0*
%files -n libxcb-xf86dri0
%defattr(-,root,root)
%_libdir/libxcb-xf86dri.so.*
%{_libdir}/libxcb-xf86dri.so.*
%files -n libxcb-xfixes0
%defattr(-,root,root)
%_libdir/libxcb-xfixes.so.*
%{_libdir}/libxcb-xfixes.so.*
%files -n libxcb-xkb1
%_libdir/libxcb-xkb.so.1*
%{_libdir}/libxcb-xkb.so.1*
%files -n libxcb-xinerama0
%defattr(-,root,root)
%_libdir/libxcb-xinerama.so.0*
%{_libdir}/libxcb-xinerama.so.0*
%files -n libxcb-xinput0
%defattr(-,root,root)
%_libdir/libxcb-xinput.so.0*
%{_libdir}/libxcb-xinput.so.0*
%files -n libxcb-xtest0
%defattr(-,root,root)
%_libdir/libxcb-xtest.so.0*
%{_libdir}/libxcb-xtest.so.0*
%files -n libxcb-xv0
%defattr(-,root,root)
%_libdir/libxcb-xv.so.0*
%{_libdir}/libxcb-xv.so.0*
%files -n libxcb-xvmc0
%defattr(-,root,root)
%_libdir/libxcb-xvmc.so.0*
%{_libdir}/libxcb-xvmc.so.0*
%files devel
%defattr(-,root,root)
%_includedir/xcb
%_libdir/libxcb*.so
%_libdir/pkgconfig/xcb*.pc
%{_includedir}/xcb
%{_libdir}/libxcb*.so
%{_libdir}/pkgconfig/xcb*.pc
%files devel-doc
%defattr(-,root,root)
%_docdir/%name
%_mandir/man3/xcb*
%{_docdir}/%{name}
%{_mandir}/man3/xcb*
%changelog

59
u_build_python3.patch Normal file
View File

@ -0,0 +1,59 @@
Index: libxcb-1.12/src/c_client.py
===================================================================
--- libxcb-1.12.orig/src/c_client.py
+++ libxcb-1.12/src/c_client.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import getopt
import os
import sys
@@ -350,7 +350,7 @@ def build_collision_table():
global namecount
namecount = {}
- for v in module.types.values():
+ for v in list(module.types.values()):
name = _t(v[0])
namecount[name] = (namecount.get(name) or 0) + 1
@@ -1368,7 +1368,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_align_to = 0;')
if self.is_switch:
_c(' unsigned int xcb_padding_offset = %d;',
- self.get_align_offset() )
+ self.get_align_offset() )
prefix = [('_aux', '->', self)]
aux_ptr = 'xcb_out'
@@ -1394,7 +1394,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_align_to = 0;')
if self.is_switch:
_c(' unsigned int xcb_padding_offset = %d;',
- self.get_align_offset() )
+ self.get_align_offset() )
elif 'sizeof' == context:
param_names = [p[2] for p in params]
@@ -1934,14 +1934,14 @@ def _c_accessors_list(self, field):
# from the request size and divide that by the member size
return '(((R->length * 4) - sizeof('+ self.c_type + '))/'+'sizeof('+field.type.member.c_wiretype+'))'
else:
- # use the accessor to get the start of the list, then
- # compute the length of it by subtracting it from
+ # use the accessor to get the start of the list, then
+ # compute the length of it by subtracting it from
# the adress of the first byte after the end of the
# request
- after_end_of_request = '(((char*)R) + R->length * 4)'
- start_of_list = '%s(R)' % (field.c_accessor_name)
+ after_end_of_request = '(((char*)R) + R->length * 4)'
+ start_of_list = '%s(R)' % (field.c_accessor_name)
bytesize_of_list = '%s - (char*)(%s)' % (after_end_of_request, start_of_list)
- return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype)
+ return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype)
else:
raise Exception(
"lengthless lists with varsized members are not supported. Fieldname '%s'"