[packages/cwiid] - build cleanup/fixes, added python2 and static_libs bconds

qboosh qboosh at pld-linux.org
Sat Aug 30 07:43:32 CEST 2025


commit c8c61e45e2c6fe504b54a2e0d200927c850d7a3d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Aug 30 07:46:01 2025 +0200

    - build cleanup/fixes, added python2 and static_libs bconds

 cwiid-format.patch | 11 +++++++++
 cwiid.spec         | 66 +++++++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 61 insertions(+), 16 deletions(-)
---
diff --git a/cwiid.spec b/cwiid.spec
index 7d5c3a4..207864f 100644
--- a/cwiid.spec
+++ b/cwiid.spec
@@ -1,3 +1,8 @@
+#
+# Conditional build:
+%bcond_without	python2		# python (2.x) binding
+%bcond_without	static_libs	# static library
+
 %define gitref	fadf11e
 %define	snap	20100222
 %define rel	1
@@ -13,17 +18,18 @@ Source0:	https://github.com/abstrakraft/cwiid/archive/%{gitref}/%{name}-%{versio
 # Source0-md5:	2d5430a465357242514942ae82139609
 Source1:	wmgui.desktop
 Patch0:		wmdemo-lib.patch
+Patch1:		%{name}-format.patch
 URL:		https://github.com/abstrakraft/cwiid
-BuildRequires:	autoconf
+BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
 BuildRequires:	bison
 BuildRequires:	bluez-libs-devel
 BuildRequires:	desktop-file-utils
 BuildRequires:	flex
 BuildRequires:	gawk
-BuildRequires:	gtk+2-devel
+BuildRequires:	gtk+2-devel >= 1:2.0.0
 BuildRequires:	pkgconfig
-BuildRequires:	python-devel >= 2.4
+%{?with_python2:BuildRequires:	python-devel >= 2.4}
 BuildRequires:	rpm-pythonprov
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -50,6 +56,18 @@ use CWiiD.
 Ten pakiet zaweira pliki nagłówkowe do tworzenia aplikacji
 wykorzystujących CWiiD.
 
+%package static
+Summary:	Static CWiiD library
+Summary(pl.UTF-8):	Statyczna biblioteka CWiiD
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static CWiiD library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka CWiiD.
+
 %package -n python-%{name}
 Summary:	Python binding for CWiiD library
 Summary(pl.UTF-8):	Wiązania Pythona do biblioteki CWiiD
@@ -98,25 +116,33 @@ Ten program pozwala użytkownikowi używać wiimote do emulacji zwykłych
 
 %prep
 %setup -qc
-mv %{name}-*/* .
+%{__mv} %{name}-*/* .
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %{__aclocal}
 %{__autoconf}
-CC="%{__cc} %{rpmcflags}"
 %configure \
-	--disable-ldconfig
-%{__make}
+	PYTHON=%{__python} \
+	--disable-ldconfig \
+	%{!?with_python:--without-python}
+
+LDFLAGS="%{rpmldflags}" \
+%{__make} \
+	WARNFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -W"
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
-rm -v $RPM_BUILD_ROOT%{_libdir}/libcwiid.a
+%if %{without static_libs}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libcwiid.a
+%endif
 
 desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE1}
 
@@ -134,14 +160,29 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%{_includedir}/cwiid.h
 %{_libdir}/libcwiid.so
+%{_includedir}/cwiid.h
 %{_pkgconfigdir}/cwiid.pc
 
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libcwiid.a
+%endif
+
+%if %{with python2}
 %files -n python-%{name}
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py_sitedir}/cwiid.so
 %{py_sitedir}/cwiid-%{version}-py*.egg-info
+%endif
+
+%files utils
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/lswm
+%attr(755,root,root) %{_bindir}/wmgui
+%{_mandir}/man1/wmgui.1*
+%{_desktopdir}/wmgui.desktop
 
 %files wminput
 %defattr(644,root,root,755)
@@ -166,10 +207,3 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/%{name}/plugins/led.so
 %attr(755,root,root) %{_libdir}/%{name}/plugins/nunchuk_acc.so
 %attr(755,root,root) %{_libdir}/%{name}/plugins/nunchuk_stick2btn.so
-
-%files utils
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/lswm
-%attr(755,root,root) %{_bindir}/wmgui
-%{_mandir}/man1/wmgui.1*
-%{_desktopdir}/wmgui.desktop
diff --git a/cwiid-format.patch b/cwiid-format.patch
new file mode 100644
index 0000000..d99353d
--- /dev/null
+++ b/cwiid-format.patch
@@ -0,0 +1,11 @@
+--- cwiid-0.6.00/wmgui/main.c.orig	2010-02-21 16:56:59.000000000 +0100
++++ cwiid-0.6.00/wmgui/main.c	2025-08-29 21:46:59.713822746 +0200
+@@ -442,7 +442,7 @@ void message(GtkMessageType type, const
+ {
+ 	GtkWidget *dialog;
+ 
+-	dialog = gtk_message_dialog_new(parent, 0, type, GTK_BUTTONS_OK, message);
++	dialog = gtk_message_dialog_new(parent, 0, type, GTK_BUTTONS_OK, "%s", message);
+ 	gtk_dialog_run(GTK_DIALOG(dialog));
+ 	gtk_widget_destroy(dialog);
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cwiid.git/commitdiff/c8c61e45e2c6fe504b54a2e0d200927c850d7a3d



More information about the pld-cvs-commit mailing list