[packages/gpgme] - explicit selection of python2/3 is not supported for over 5 years - allow building without docs

hawk hawk at pld-linux.org
Sun Dec 10 14:20:09 CET 2023


commit 8f43307cea6cfa3955dd1eff358031ae74fdf4c5
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Sun Dec 10 13:28:37 2023 +0100

    - explicit selection of python2/3 is not supported for over 5 years
    - allow building without docs

 gpgme.spec    | 14 +++++++++++---
 no_docs.patch | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/gpgme.spec b/gpgme.spec
index 617244f..3e15b6f 100644
--- a/gpgme.spec
+++ b/gpgme.spec
@@ -9,6 +9,7 @@
 %bcond_without	python2		# Python 2 interface (PyME)
 %bcond_without	python3		# Python 3 interface (PyME)
 %bcond_without	tests		# perform tests
+%bcond_without	docs		# Qt binding docs
 #
 %if %{without python}
 %undefine	with_python2
@@ -36,6 +37,7 @@ Patch1:		orig-version.patch
 Patch2:		%{name}-largefile.patch
 Patch3:		%{name}-python.patch
 Patch4:		0001-fix-stupid-ax_python_devel.patch
+Patch5:		no_docs.patch
 URL:		http://www.gnupg.org/gpgme.html
 BuildRequires:	autoconf >= 2.69
 BuildRequires:	automake >= 1:1.14
@@ -57,15 +59,19 @@ BuildRequires:	texinfo
 %if %{with qt5}
 BuildRequires:	Qt5Core-devel >= 5.0.0
 %{?with_tests:BuildRequires:	Qt5Test-devel >= 5.8.0}
+%if %{with docs}
 BuildRequires:	doxygen
 BuildRequires:	graphviz
+%endif
 BuildRequires:	qt5-build >= 5.0.0
 %endif
 %if %{with qt6}
 BuildRequires:	Qt6Core-devel >= 6.4.0
 %{?with_tests:BuildRequires:	Qt6Test-devel >= 6.4.0}
+%if %{with docs}
 BuildRequires:	doxygen
 BuildRequires:	graphviz
+%endif
 BuildRequires:	qt6-build >= 6.4.0
 %endif
 BuildConflicts:	gnupg < 1.3.0
@@ -291,6 +297,7 @@ PyME to interfejs Pythona do biblioteki GPGME.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%{!?with_docs:%patch5 -p1}
 
 %build
 %{__libtoolize}
@@ -299,8 +306,9 @@ PyME to interfejs Pythona do biblioteki GPGME.
 %{__autoheader}
 %{__automake}
 # in enable-languages:
-# "python" means both pythons (if available), "python2" just python2, "python3" just python3
-# (cannot specify "python2 python3" due to script limitations)
+# "python" means all installed python version (if any)
+# option to choose python2 and/or python3 explicitly was removed long time ago
+# https://github.com/gpg/gpgme/commit/ff6ff616aea6f59b7f2ce1176492850ecdf3851e
 %configure \
 	PACKAGE_VERSION=%{version} \
 %if %{without tests}
@@ -309,7 +317,7 @@ PyME to interfejs Pythona do biblioteki GPGME.
 	--disable-gpgconf-test \
 	--disable-gpgsm-test \
 %endif
-	--enable-languages="%{?with_commonlisp:cl} %{?with_cxx:cpp} %{?with_python2:python%{!?with_python3:2}} %{?with_python3:%{!?with_python2:python3}} %{?with_qt5:qt5} %{?with_qt6:qt6}" \
+	--enable-languages="%{?with_commonlisp:cl} %{?with_cxx:cpp} %{?with_python:python} %{?with_qt5:qt5} %{?with_qt6:qt6}" \
 	%{?with_static_libs:--enable-static}
 
 %{__make}
diff --git a/no_docs.patch b/no_docs.patch
new file mode 100644
index 0000000..4e7577a
--- /dev/null
+++ b/no_docs.patch
@@ -0,0 +1,40 @@
+--- gpgme-1.23.2/configure.ac.orig	2023-12-10 13:18:29.793064885 +0100
++++ gpgme-1.23.2/configure.ac	2023-12-10 13:21:03.640010838 +0100
+@@ -545,28 +545,7 @@
+ 
+ AM_CONDITIONAL(WANT_QT5, test "$want_qt5" = yes)
+ AM_CONDITIONAL(WANT_QT6, test "$want_qt6" = yes)
+-
+-# Check for tools for building the Qt binding docs
+-if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
+-    AC_CHECK_PROGS([DOXYGEN], [doxygen])
+-    if test -z "$DOXYGEN"; then
+-        # This is not highlighted because it's not really important.
+-        AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
+-    fi
+-    AC_CHECK_PROGS([GRAPHVIZ], [dot])
+-    if test -z "$GRAPHVIZ"; then
+-        AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
+-    fi
+-fi
+-
+-AM_CONDITIONAL([HAVE_DOXYGEN],
+-               [test -n "$DOXYGEN"])
+-if test -n "$GRAPHVIZ"; then
+-    HAVE_DOT="YES"
+-else
+-    HAVE_DOT="NO"
+-fi
+-AC_SUBST(HAVE_DOT)
++AM_CONDITIONAL([HAVE_DOXYGEN], 0)
+ 
+ # Python bindings.
+ LIST_MEMBER("python", $enabled_languages)
+@@ -1135,7 +1114,6 @@
+ AC_CONFIG_FILES(lang/qt/tests/Makefile)
+ AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
+ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
+-AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([lang/qt/doc/Doxyfile])])
+ AC_CONFIG_FILES([lang/js/Makefile lang/js/src/Makefile
+                  lang/js/BrowserTestExtension/Makefile
+                  lang/js/DemoExtension/Makefile])
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gpgme.git/commitdiff/8f43307cea6cfa3955dd1eff358031ae74fdf4c5



More information about the pld-cvs-commit mailing list