distribution/packages/sysutils/lirc/patches/lirc-0100-disable-python.patch
2022-02-05 09:23:32 -05:00

128 lines
4 KiB
Diff

diff --git a/Makefile.am b/Makefile.am
index 9f3dd143..9619a6eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,9 @@ ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = 1.5 check-news dist-bzip2 -Wno-portability \
subdir-objects
+if HAVE_PYTHON
include pylint.mak
+endif
GIT_COMMIT = $(shell git log -1 --pretty=format:%h || echo UNKNOWN)
GIT_DATE = $(shell git log -1 --pretty=format:%cd || echo UNKNOWN)
@@ -34,13 +36,17 @@ MANTAINERCLEANFILES = config.sub install-sh depcomp py-compile \
AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$${dc_install_base}/lib/systemd/system
+if HAVE_PYTHON
BUILT_SOURCES = paths.h python-pkg/lirc/config.py python-pkg/VERSION
+else
+BUILT_SOURCES = paths.h
+endif
if WITH_SYSTEMDSYSTEMUNITDIR
SYSTEMD_DIR = systemd
endif
-SUBDIRS = lib daemons tools plugins configs doc $(SYSTEMD_DIR)
+SUBDIRS = lib daemons tools plugins $(SYSTEMD_DIR)
if INSTALL_ETC
@@ -61,7 +67,9 @@ endif
dist_doc_DATA = VERSION
+if HAVE_PYTHON
nodist_pkgdata_DATA = $(PYTHON_TARBALL)
+endif
pkgconfigdir = $(libdir)/pkgconfig
dist_pkgconfig_DATA = lirc.pc lirc-driver.pc
@@ -71,6 +79,7 @@ nobase_header_HEADERS = include/media/lirc.h \
include/linux/input-event-codes.h
header_HEADERS = drivers/irpipe/irpipe.h
+if HAVE_PYTHON
py_pkgdir = $(pkgdatadir)/python-pkg
dist_py_pkg_DATA = python-pkg/setup.py \
python-pkg/README.rst
@@ -134,6 +143,8 @@ all-local:
$(if $(VERBOSE),,-q) build
endif
+endif
+
install-data-hook:
$(SED) -i -e '/^plugindir/s|/usr/lib|$(libdir)|' \
$(DESTDIR)$(lirc_confdir)/lirc_options.conf
@@ -170,6 +181,7 @@ fix-version: .phony
$(SED) -i '/DATE/s/=.*/="$(GIT_DATE)"/' $(distdir)/VERSION
$(SED) -i '/REFS/s|=.*|="$(GIT_REFS)"|' $(distdir)/VERSION
+if HAVE_PYTHON
$(abs_builddir)/python-pkg/setup.py:
cp -ar $(top_srcdir)/python-pkg $(abs_builddir)
chmod -R u+w python-pkg
@@ -193,6 +205,7 @@ python-pkg/lirc/config.py: Makefile $(abs_builddir)/python-pkg/setup.py
@echo 'DOCDIR = "$(docdir)"' >>$@
@echo 'MODINFO = "$(MODINFO)"' >>$@
@echo 'VERSION = "$(VERSION)"' >>$@
+endif
paths.h: Makefile
@echo "#ifndef PATHS_H" >paths.h
diff --git a/configure.ac b/configure.ac
index 58347d88..48ce5629 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,7 +43,8 @@ AC_CHECK_PROG([DOXYGEN],[doxygen],[yes],[no])
AM_CONDITIONAL(HAVE_DOXYGEN, test x$DOXYGEN = xyes)
LT_INIT([disable-static])
-AM_PATH_PYTHON([3.1],,)
+AM_PATH_PYTHON([3.1],,[:])
+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
PKG_CHECK_MODULES([PYTHON],[python-${PYTHON_VERSION}m],,[true])
test -z "$PYTHON_LIBS" && \
PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION],,[true])
@@ -580,6 +581,7 @@ AX_REPORT_CONDITIONAL([DEVEL])
AX_REPORT_CONDITIONAL([LINUX_KERNEL])
AX_REPORT_CONDITIONAL([HAVE_DEVINPUT])
AX_REPORT_CONDITIONAL([WITH_SYSTEMDSYSTEMUNITDIR])
+AX_REPORT_CONDITIONAL([HAVE_PYTHON])
AX_REPORT_CONDITIONAL([HAVE_PYTHON35])
echo
diff --git a/tools/Makefile.am b/tools/Makefile.am
index abfb9911..8aff1cff 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -71,12 +71,17 @@ xmode2_SOURCES = xmode2.cpp
xmode2_LDADD = @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ \
$(LIRC_LIBS)
+if HAVE_PYTHON
dist_bin_SCRIPTS = lirc-config-tool lirc-init-db
+else
+dist_bin_SCRIPTS =
+endif
if HAVE_DEVINPUT
dist_bin_SCRIPTS += lirc-make-devinput
endif
+if HAVE_PYTHON
dist_bin_SCRIPTS += pronto2lirc irdb-get irtext2udp
dist_sbin_SCRIPTS = lircd-setup
dist_noinst_SCRIPTS = make_rel_symlink.py check_configs.py
@@ -121,6 +126,7 @@ install-data-hook:
$(PYTHON) $(srcdir)/make_rel_symlink.py \
$(DESTDIR)/$(pkgdatadir)/configs \
$(DESTDIR)/$(setupdir)/configs
+endif
uninstall-hook:
rm -f $(DESTDIR)/$(bindir)/lirc-setup \