On 04/17/2018 08:23 AM, Josef Ridky wrote:
Hi,
thanks a lot for that!
I have pushed new version to Fedora Rawhide and found, that there should be
done a little more, due I wasn't able to build it with python3 only.
So I had to have done following changes (some are Fedora specific, but I
believe, it could help you with improvement):
Thanks, there were a few improvement I have taken, and I have some more
comments.
diff -urNp a/configure b/configure
--- a/configure 2018-04-17 08:47:58.528284066 +0200
+++ b/configure 2018-04-17 10:00:24.091372864 +0200
@@ -13406,7 +13406,7 @@ if test "x$pythoncflags" = "x" -o "x$pyt
pythonprog=
if test "x$trypython" != "xno"; then
# Extract the first word of "python", so it can be a program name with
args.
-set dummy python; ac_word=$2
+set dummy python3; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_pythonprog+:} false; then :
@@ -13474,7 +13474,7 @@ fi
$as_echo "#define HAVE_PYTHON /**/" >>confdefs.h
- PYTHON_DIR=python
+ PYTHON_DIR=python3.6
This is wrong. This sets the directory under "swig" in that will be
processed. It's put into SUBDIRS in swig/Makefile.am. It has no other
purpose. It's to allow python to be disabled.
PYTHON_CFLAGS="$pythoncflags"
PYTHON_INSTALL_DIR="$pythoninstalldir"
PYTHON_INSTALL_LIB_DIR="$pythoninstalllibdir"
@@ -13491,7 +13491,7 @@ else
$as_echo "#define HAVE_PYTHON /**/" >>confdefs.h
- PYTHON_DIR=python
+ PYTHON_DIR=python3.6
ditto
PYTHON_CFLAGS="$pythoncflags"
PYTHON_INSTALL_DIR="$pythoninstalldir"
PYTHON_INSTALL_LIB_DIR="$pythoninstalllibdir"
@@ -13500,12 +13500,12 @@ if test "x$pythonprog" != "x"; then
if test "x$pythonusepthreads" = "x"; then
cat - <<_ACEOF >conftest.py
try:
- import thread
+ import threading
I missed this, got it.
print('yes')
except:
print('no')
_ACEOF
- pythonusepthreads=`python conftest.py`
+ pythonusepthreads=`python3 conftest.py`
If the default python on the system is python3, why do you need this
change?
For now, I'd prefer that it use the default python on the system for the
release.
rm -f conftest.py
fi
echo "checking for python threads... $pythonusepthreads"
@@ -13537,7 +13537,7 @@ try:
except:
print('no')
_ACEOF
- tkinter=`python conftest.py`
+ tkinter=`python3 conftest.py`
rm -f conftest.py
fi
fi
diff -urNp a/configure.ac b/configure.ac
--- a/configure.ac 2018-04-17 08:47:58.529284062 +0200
+++ b/configure.ac 2018-04-17 10:01:02.115576922 +0200
@@ -526,7 +526,7 @@ AC_SUBST(PERL_POSIX_SO)
if test "x$pythoncflags" = "x" -o "x$pythoninstalldir" = "x"; then
pythonprog=
if test "x$trypython" != "xno"; then
- AC_PATH_PROG(pythonprog, python)
+ AC_PATH_PROG(pythonprog, python3)
fi
if test "x$pythonprog" != "x"; then
# Now find a proper installation location.
@@ -578,12 +578,12 @@ if test "x$pythonprog" != "x"; then
if test "x$pythonusepthreads" = "x"; then
cat - <<_ACEOF >conftest.py
try:
- import thread
+ import threading
print('yes')
except:
print('no')
_ACEOF
- pythonusepthreads=`python conftest.py`
+ pythonusepthreads=`python3 conftest.py`
rm -f conftest.py
fi
echo "checking for python threads... $pythonusepthreads"
@@ -615,7 +615,7 @@ try:
except:
print('no')
_ACEOF
- tkinter=`python conftest.py`
+ tkinter=`python3 conftest.py`
rm -f conftest.py
fi
fi
diff -urNp a/swig/python/Makefile.am b/swig/python/Makefile.am
--- a/swig/python/Makefile.am 2018-04-17 08:47:58.547283986 +0200
+++ b/swig/python/Makefile.am 2018-04-17 14:43:01.703963727 +0200
@@ -22,19 +22,14 @@ EXTRA_DIST = OpenIPMI_lang.i OpenIPMI.h
OpenIPMI.pyc: OpenIPMI.py _OpenIPMI.la
-PYTHONPATH=$(PYPATH) $(pythonprog) -c 'import OpenIPMI.py'
-OpenIPMI.pyo: OpenIPMI.py _OpenIPMI.la
- -PYTHONPATH=$(PYPATH) $(pythonprog) -O -c 'import OpenIPMI.py'
-
Yeah, installing the pyc and pyo files is a bad idea. I've removed that.
OpenIPMI_wrap.c OpenIPMI.py: $(top_srcdir)/swig/OpenIPMI.i OpenIPMI_lang.i
- $(SWIG) $(DEFS) -python -o OpenIPMI_wrap.c -I$(top_srcdir)/swig/python
$<
+ $(SWIG) $(DEFS) -python -py3 -o OpenIPMI_wrap.c
-I$(top_srcdir)/swig/python $<
-CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py OpenIPMI.pyo OpenIPMI.pyc
+CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py
You do want the pyo and pyc changed removed by CLEANFILES, though, so
clean works properly.
-install-exec-local: _OpenIPMI.la OpenIPMI.py OpenIPMI.pyc OpenIPMI.pyo
+install-exec-local: _OpenIPMI.la OpenIPMI.py
$(INSTALL) -d $(DESTDIR)$(PYTHON_INSTALL_DIR)
$(INSTALL_DATA) OpenIPMI.py "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
- $(INSTALL_DATA) OpenIPMI.pyc "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
- $(INSTALL_DATA) OpenIPMI.pyo "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
if test "x$(PYTHON_GUI_DIR)" = "xopenipmigui"; then \
$(INSTALL) -d $(DESTDIR)$(bindir); \
$(INSTALL_SCRIPT) $(srcdir)/openipmigui.py
"$(DESTDIR)$(bindir)/openipmigui";\
@@ -43,8 +38,6 @@ install-exec-local: _OpenIPMI.la OpenIPM
uninstall-local:
$(LIBTOOL) --mode=uninstall rm -f
"$(DESTDIR)$(PYTHON_INSTALL_LIB_DIR)/_OpenIPMI.so"
rm -f "$(DESTDIR)$(PYTHON_INSTALL_DIR)/OpenIPMI.py"
- rm -f "$(DESTDIR)$(PYTHON_INSTALL_DIR)/OpenIPMI.pyc"
- rm -f "$(DESTDIR)$(PYTHON_INSTALL_DIR)/OpenIPMI.pyo"
rm -f "$(DESTDIR)$(bindir)/openipmigui"
rungui:
diff -urNp a/swig/python/Makefile.in b/swig/python/Makefile.in
--- a/swig/python/Makefile.in 2018-04-17 08:47:58.547283986 +0200
+++ b/swig/python/Makefile.in 2018-04-17 14:43:28.969899859 +0200
@@ -443,7 +443,7 @@ nodist__OpenIPMI_la_SOURCES = OpenIPMI_w
_OpenIPMI_la_LDFLAGS = -module -avoid-version
_OpenIPMI_la_LIBADD = $(OPENIPMI_SWIG_LIBS) $(PYTHON_POSIX_LIB)
EXTRA_DIST = OpenIPMI_lang.i OpenIPMI.h openipmigui.py sample.py sample2.py
-CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py OpenIPMI.pyo OpenIPMI.pyc
+CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py
all: all-recursive
.SUFFIXES:
@@ -837,20 +837,12 @@ uninstall-am: uninstall-local uninstall-
.PRECIOUS: Makefile
-OpenIPMI.pyc: OpenIPMI.py _OpenIPMI.la
- -PYTHONPATH=$(PYPATH) $(pythonprog) -c 'import OpenIPMI.py'
-
-OpenIPMI.pyo: OpenIPMI.py _OpenIPMI.la
- -PYTHONPATH=$(PYPATH) $(pythonprog) -O -c 'import OpenIPMI.py'
-
OpenIPMI_wrap.c OpenIPMI.py: $(top_srcdir)/swig/OpenIPMI.i OpenIPMI_lang.i
- $(SWIG) $(DEFS) -python -o OpenIPMI_wrap.c -I$(top_srcdir)/swig/python
$<
+ $(SWIG) $(DEFS) -python -py3 -o OpenIPMI_wrap.c
-I$(top_srcdir)/swig/python $<
Is the -py3 thing required? It make no difference in the generated C
file. The only thing it
does to the generated python file is add return values to functions.
I can add this, but I will have to add a version detector and only use
it if python3 is the
default python.
-corey
-install-exec-local: _OpenIPMI.la OpenIPMI.py OpenIPMI.pyc OpenIPMI.pyo
+install-exec-local: _OpenIPMI.la OpenIPMI.py
$(INSTALL) -d $(DESTDIR)$(PYTHON_INSTALL_DIR)
$(INSTALL_DATA) OpenIPMI.py "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
- $(INSTALL_DATA) OpenIPMI.pyc "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
- $(INSTALL_DATA) OpenIPMI.pyo "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
if test "x$(PYTHON_GUI_DIR)" = "xopenipmigui"; then \
$(INSTALL) -d $(DESTDIR)$(bindir); \
$(INSTALL_SCRIPT) $(srcdir)/openipmigui.py
"$(DESTDIR)$(bindir)/openipmigui";\
@@ -859,8 +851,6 @@ install-exec-local: _OpenIPMI.la OpenIPM
uninstall-local:
$(LIBTOOL) --mode=uninstall rm -f
"$(DESTDIR)$(PYTHON_INSTALL_LIB_DIR)/_OpenIPMI.so"
rm -f "$(DESTDIR)$(PYTHON_INSTALL_DIR)/OpenIPMI.py"
- rm -f "$(DESTDIR)$(PYTHON_INSTALL_DIR)/OpenIPMI.pyc"
- rm -f "$(DESTDIR)$(PYTHON_INSTALL_DIR)/OpenIPMI.pyo"
rm -f "$(DESTDIR)$(bindir)/openipmigui"
rungui:
Regards
Josef Ridky
Associate Software Engineer
Core Services Team
Red Hat Czech, s.r.o.
----- Original Message -----
| From: "Corey Minyard" <miny...@acm.org>
| To: openipmi-developer@lists.sourceforge.net
| Sent: Monday, April 16, 2018 8:48:01 PM
| Subject: [Openipmi-developer] OpenIPMI-2.0.25 released
|
| This function fixes a lot of little issues.
|
| The big change is python3 support. That was hard.
|
| -corey
|
|
| ------------------------------------------------------------------------------
| Check out the vibrant tech community on one of the world's most
| engaging tech sites, Slashdot.org! http://sdm.link/slashdot
| _______________________________________________
| Openipmi-developer mailing list
| Openipmi-developer@lists.sourceforge.net
| https://lists.sourceforge.net/lists/listinfo/openipmi-developer
|
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer