[packages/libical] - updated to 3.0.20, build also python3 module
qboosh
qboosh at pld-linux.org
Fri Apr 11 18:40:18 CEST 2025
commit fd6d8ccaaa4ce3e89955aa588093a857c7fc6141
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Apr 11 18:17:07 2025 +0200
- updated to 3.0.20, build also python3 module
libical-cmake-python.patch | 7 ++--
libical-python.patch | 18 +++++++++-
libical.spec | 89 ++++++++++++++++++++++++++++++++++------------
3 files changed, 88 insertions(+), 26 deletions(-)
---
diff --git a/libical.spec b/libical.spec
index f051599..830f359 100644
--- a/libical.spec
+++ b/libical.spec
@@ -2,19 +2,25 @@
#
# Conditional build:
%bcond_without apidocs # API documentation
-%bcond_without python # Python binding
+%bcond_without python # Python binding (any)
+%bcond_without python2 # CPython 2.x binding
+%bcond_without python3 # CPython 3.x binding
%bcond_without static_libs # static libraries
#
+%if %{without python}
+%undefine with_python2
+%undefine with_python3
+%endif
Summary: libical library
Summary(pl.UTF-8): Biblioteka libical
Name: libical
-Version: 3.0.19
-Release: 2
+Version: 3.0.20
+Release: 1
License: MPL v1.0 or LGPL v2.1
Group: Libraries
#Source0Download: https://github.com/libical/libical/releases
Source0: https://github.com/libical/libical/releases/download/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: f671e38e804bf467347807d8c8d057f7
+# Source0-md5: 539a8a293d344e7aa8ccf3740494a46d
Patch0: %{name}-cmake-python.patch
Patch1: %{name}-python.patch
Patch2: %{name}-gtkdocdir.patch
@@ -31,14 +37,13 @@ BuildRequires: libstdc++-devel
BuildRequires: libxml2-devel >= 1:2.7.3
BuildRequires: perl-base
BuildRequires: pkgconfig
+%{?with_python2:BuildRequires: python-devel >= 1:2.3}
+%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
BuildRequires: rpm-build >= 4.6
-BuildRequires: rpmbuild(macros) >= 1.742
+%{?with_python:BuildRequires: rpm-pythonprov}
+BuildRequires: rpmbuild(macros) >= 2.047
+%{?with_python:BuildRequires: swig-python >= 2}
BuildRequires: vala
-%if %{with python}
-BuildRequires: python-devel >= 1:2.3
-BuildRequires: rpm-pythonprov
-BuildRequires: swig-python
-%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -198,16 +203,28 @@ Vala API for libical-glib library.
API języka Vala do biblioteki libical-glib.
%package -n python-libical
-Summary: Python binding for libical
-Summary(pl.UTF-8): Wiązanie Pythona do biblioteki libical
+Summary: Python 2 binding for libical
+Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki libical
Group: Libraries/Python
Requires: %{name} = %{version}-%{release}
%description -n python-libical
-Python binding for libical.
+Python 2 binding for libical.
%description -n python-libical -l pl.UTF-8
-Wiązanie Pythona do biblioteki libical.
+Wiązanie Pythona 2 do biblioteki libical.
+
+%package -n python3-libical
+Summary: Python 3 binding for libical
+Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki libical
+Group: Libraries/Python
+Requires: %{name} = %{version}-%{release}
+
+%description -n python3-libical
+Python 3 binding for libical.
+
+%description -n python3-libical -l pl.UTF-8
+Wiązanie Pythona 3 do biblioteki libical.
%prep
%setup -q
@@ -218,37 +235,58 @@ Wiązanie Pythona do biblioteki libical.
%patch -P2 -p1
%build
+%if %{with python2}
+install -d build-py2
+cd build-py2
+%cmake .. \
+ -DICAL_BUILD_DOCS=OFF \
+ -DSHARED_ONLY=ON \
+ -DICAL_GLIB=OFF \
+ -DPYTHON_EXECUTABLE=%{__python} \
+ -DPY_SITEDIR=%{py_sitedir}
+
+%{__make} -j1
+cd ..
+%endif
+
install -d build
cd build
%cmake .. \
- %{cmake_on_off apidocs ICAL_BUILD_DOCS} \
- -DSHARED_ONLY:BOOL=%{?with_static_libs:OFF}%{!?with_static_libs:ON} \
+ -DICAL_BUILD_DOCS:BOOL=%{__ON_OFF apidocs} \
+ -DSHARED_ONLY:BOOL=%{__ON_OFF_not static_libs} \
-DGOBJECT_INTROSPECTION=ON \
-DICAL_GLIB=ON \
-DICAL_GLIB_VAPI=ON \
- -DPYTHON_EXECUTABLE=%{__python} \
- -DPY_SITEDIR=%{py_sitedir}
-
-%{__make} -j1
+ -DPYTHON_EXECUTABLE=%{__python3} \
+ -DPY_SITEDIR=%{py3_sitedir}
%{?with_apidocs:%{__make} -j1 docs}
%install
rm -rf $RPM_BUILD_ROOT
+%{__make} -C build-py2 install \
+ DESTDIR=$RPM_BUILD_ROOT
+
%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
# disable completeness check incompatible with split packaging
%{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_libdir}/cmake/LibIcal/{IcalGlibSrcGenerator,LibIcalTargets}.cmake
-%if %{with python}
+%if %{with python2}
# not installed by cmake build system
install -d $RPM_BUILD_ROOT%{py_sitescriptdir}/libical
cp -p src/python/*.py build/src/python/*.py $RPM_BUILD_ROOT%{py_sitescriptdir}/libical
%py_postclean
%endif
+%if %{with python3}
+# not installed by cmake build system
+install -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/libical
+cp -p src/python/*.py build/src/python/*.py $RPM_BUILD_ROOT%{py3_sitescriptdir}/libical
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -404,9 +442,16 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%{_datadir}/vala/vapi/libical-glib.vapi
-%if %{with python}
+%if %{with python2}
%files -n python-libical
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/_LibicalWrap.so
%{py_sitescriptdir}/libical
%endif
+
+%if %{with python3}
+%files -n python3-libical
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/_LibicalWrap.so
+%{py3_sitescriptdir}/libical
+%endif
diff --git a/libical-cmake-python.patch b/libical-cmake-python.patch
index 6d56584..4f86f2b 100644
--- a/libical-cmake-python.patch
+++ b/libical-cmake-python.patch
@@ -1,6 +1,6 @@
--- libical-3.0.16/src/python/CMakeLists.txt.orig 2023-03-04 19:38:26.490595543 +0100
+++ libical-3.0.16/src/python/CMakeLists.txt 2023-03-04 19:41:03.049747390 +0100
-@@ -6,8 +6,19 @@ include_directories(
+@@ -6,18 +6,28 @@ include_directories(
########### next target ###############
@@ -21,8 +21,9 @@
)
add_library(LibicalWrap ${LIBRARY_TYPE} ${LibicalWrap_LIB_SRCS})
-@@ -15,9 +26,8 @@ add_library(LibicalWrap ${LIBRARY_TYPE}
- target_link_libraries(LibicalWrap)
+
+-target_link_libraries(LibicalWrap)
++target_link_libraries(LibicalWrap icalss ical)
set_target_properties(LibicalWrap PROPERTIES
- VERSION ${LIBICAL_LIB_VERSION_STRING}
diff --git a/libical-python.patch b/libical-python.patch
index 8e3741d..83966a6 100644
--- a/libical-python.patch
+++ b/libical-python.patch
@@ -9,13 +9,29 @@
%{
#include "libical/ical.h"
-@@ -45,6 +45,9 @@
+@@ -45,6 +45,14 @@
typedef int time_t;
+// Can't wrap va_list
+%ignore icalproperty_add_parameters(struct icalproperty_impl *prop, va_list args);
++// not exported
++%ignore icalfileset_options_default;
++%ignore print_date_to_string;
++%ignore print_datetime_to_string;
++%ignore icaltimezone_tzid_prefix;
+
#ifndef _DLOPEN_TEST
%ignore icalset_register_class(icalset *set);
#endif
+--- libical-3.0.20/src/libicalss/icalbdbset.h.orig 2025-03-10 17:08:27.000000000 +0100
++++ libical-3.0.20/src/libicalss/icalbdbset.h 2025-04-10 22:32:41.961141924 +0200
+@@ -144,8 +144,6 @@ LIBICAL_ICALSS_EXPORT icalcomponent *ica
+
+ LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbsetiter_to_next(icalset *set, icalsetiter *i);
+
+-LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbsetiter_to_prior(icalset *set, icalsetiter *i);
+-
+ /* Return a reference to the internal component. You probably should
+ not be using this. */
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libical.git/commitdiff/fd6d8ccaaa4ce3e89955aa588093a857c7fc6141
More information about the pld-cvs-commit
mailing list