Hello,
there is some effort to rename 'python' to 'python2' in the
distributions, but SyncEvolution still uses 'python' (without the
version number) in its scripts. I made a change for Fedora to detect
the installed python 2 binary name and use it in the scripts.

I know, an ideal solution would be to port to python3 at the same time,
but it's out of my knowledge, I do not speak pythonish and simple
change to /usr/bin/python3 makes the provided scripts not to run with a
runtime error about syntax and such, thus I decided to offer at least
this change to you. Maybe I'll convince someone with python knowledge
to port the scripts to python3, in which case I'd return back to you
with a follow up change, if you are interested.
        Bye,
        Milan
diff -up syncevolution-1.5.3/configure.ac.python2 syncevolution-1.5.3/configure.ac
--- syncevolution-1.5.3/configure.ac.python2	2018-01-09 16:53:28.000000000 +0100
+++ syncevolution-1.5.3/configure.ac	2018-07-16 18:31:06.970413427 +0200
@@ -62,6 +62,11 @@ dnl check for programs.
 AC_PROG_CXX
 AC_PROG_MAKE_SET
 
+AC_PATH_PROGS(PYTHON, python2 python, "")
+if test "x$PYTHON" = "x" ; then
+   AC_ERROR([python not found])
+fi
+
 dnl Use the most recent C++ standard that is supported by the code.
 dnl We can fall back to older versions, but not below C++11.
 dnl Akonadi/Qt don't work with C++17 yet, so we can't enable that.
diff -up syncevolution-1.5.3/src/src.am.python2 syncevolution-1.5.3/src/src.am
--- syncevolution-1.5.3/src/src.am.python2	2018-01-05 16:10:27.000000000 +0100
+++ syncevolution-1.5.3/src/src.am	2018-07-16 18:30:04.703414288 +0200
@@ -42,12 +42,12 @@ if COND_DBUS
 nodist_bin_SCRIPTS += src/syncevo-http-server
 endif
 src/syncevo-http-server: $(top_srcdir)/test/syncevo-http-server.py
-	$(AM_V_GEN)cp $< $@
+	$(AM_V_GEN)sed -e 's|\@PYTHON\@|$(PYTHON)|' $< > $@
 CLEANFILES += src/syncevo-http-server
 
 nodist_bin_SCRIPTS += src/syncevo-phone-config
 src/syncevo-phone-config: $(top_srcdir)/test/syncevo-phone-config.py
-	$(AM_V_GEN)cp $< $@
+	$(AM_V_GEN)sed -e 's|\@PYTHON\@|$(PYTHON)|' $< > $@
 CLEANFILES += src/syncevo-phone-config
 
 SYNCEVOLUTION_DEP =
@@ -72,7 +72,7 @@ src/synccompare : $(top_srcdir)/test/Alg
 bin_SCRIPTS += src/synclog2html
 CLEANFILES += src/synclog2html
 src/synclog2html: $(top_srcdir)/test/log2html.py
-	$(AM_V_GEN)cp $< $@ && chmod u+x $@
+	$(AM_V_GEN)sed -e 's|\@PYTHON\@|$(PYTHON)|' $< > $@ && chmod u+x $@
 
 CORE_SOURCES =
 
@@ -367,7 +367,7 @@ testcase2patch: $(TEST_FILES_GENERATED)
 nodist_noinst_DATA += src/ClientTest.cpp.html
 CLEANFILES += src/ClientTest.cpp.html
 src/ClientTest.cpp.html: build/source2html.py test/ClientTest.cpp
-	$(AM_V_GEN)python $+ >$@
+	$(AM_V_GEN)$(PYTHON) $+ >$@
 
 # copy base test files
 $(filter-out %.tem, $(filter src/testcases/%, $(subst $(top_srcdir)/test/,src/,$(CLIENT_LIB_TEST_FILES)))) : src/% : $(top_srcdir)/test/%
diff -up syncevolution-1.5.3/test/log2html.py.python2 syncevolution-1.5.3/test/log2html.py
--- syncevolution-1.5.3/test/log2html.py.python2	2014-04-25 09:55:47.000000000 +0200
+++ syncevolution-1.5.3/test/log2html.py	2018-07-16 18:30:04.703414288 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!@PYTHON@
 
 """
 Converts the .log output for a client-test test into HTML, with
diff -up syncevolution-1.5.3/test/syncevo-http-server.py.python2 syncevolution-1.5.3/test/syncevo-http-server.py
--- syncevolution-1.5.3/test/syncevo-http-server.py.python2	2016-09-26 13:20:05.000000000 +0200
+++ syncevolution-1.5.3/test/syncevo-http-server.py	2018-07-16 18:30:04.703414288 +0200
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!@PYTHON@
 
 '''Usage: syncevo-http-server.py <URL>
 Runs a SyncML HTTP server under the given base URL.'''
diff -up syncevolution-1.5.3/test/syncevo-phone-config.py.python2 syncevolution-1.5.3/test/syncevo-phone-config.py
--- syncevolution-1.5.3/test/syncevo-phone-config.py.python2	2014-04-25 09:55:48.000000000 +0200
+++ syncevolution-1.5.3/test/syncevo-phone-config.py	2018-07-16 18:30:04.704414288 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!@PYTHON@
 #
 # Copyright (C) 2010 Intel Corporation
 #
_______________________________________________
SyncEvolution mailing list
[email protected]
https://lists.syncevolution.org/mailman/listinfo/syncevolution

Reply via email to