[sword-devel] python3 module ?

pierre amadio amadio.pierre at gmail.com
Wed Jun 12 10:04:02 MST 2019


Hello !

I do not have access to the debian box i had trouble with when i wrote
the mail (i should have access to it again in some weeks or monthes),
but it was a debian stable with sword 1.8.1

i kept note on the way i build things usually with python2 here:
https://github.com/pierre-amadio/SwordSandBox/blob/master/notes.txt

as well as how i try to do thing with python3:
https://github.com/pierre-amadio/SwordSandBox/blob/master/python/ankistuff/notes.txt

When i succeed building something that worked in an ugly way (changing
stuff manually) as above, it was on a RHEL7.5 with sword 1.8.1, on a
box i have still access to (my main laptop).

I did not use any configure switched to mention i wanted python3
binding, so i guess this is what i missed, but i m still puzzled:

- On the sword-1.8.1-3.el7.src.rpm that comes with epel, the spec file
is set to build a python module indeed, but i do not undertsand how it
is supposed to pick python3 (i must admit i m not really used to
cmake).

%cmake -DLIBSWORD_LIBRARY_TYPE=Shared \
       -DSWORD_BINDINGS="Python" \
...
...
and later, in the files section, it looks like a macro speciffically
mention python2:

%files python
%{python2_sitearch}/Sword.py

- I try to see what switch was available with the build process i was used to:

cd sword-1.8.1
./autogen.sh
#not finding python3 specific stuff here
./configure --prefix=/usr/local/sword --with-clucene --with-curl_sftp
--enable-examples
make
make install
make install_config

And then building the python module:

cd ~/tmp/sword-1.8.1/bindings/swig/package
./autogen.sh
#Here the configure let me specify with python version i m interested
in. Let s try:
./configure PKG_CONFIG_PATH=/usr/local/sword/lib/pkgconfig
CPPFLAGS="-I/usr/local/sword/include/" --with-python=/usr/bin/python3

But it does not look good:

#######################
checking for Python prefix...
checking for Python exec-prefix...
checking for Python version...   File "<string>", line 1
    import string,operator; print
operator.getitem(string.split(string.__file__,'/'),-2)
                                         ^
SyntaxError: invalid syntax

checking for Python header files...
checking for Python library... Not found
########################

So i cannot continue with the expected:

make pythonswig
PKG_CONFIG_PATH=/usr/local/sword/lib/pkgconfig
CPPFLAGS="-I/usr/local/sword/include/" make python_make

Is it having problem with system where both python2 and python3 are installed ?



On Wed, 12 Jun 2019 at 00:46, Greg Hellings <greg.hellings at gmail.com> wrote:
>
> What version are you trying with? What error message are you getting?
>
> The bindings have supported python2/3 for quite some time using nothing more than a configure time switch. I build both for Fedora/EPEL, as can be seen in the official spec file.
>
> --Greg
>
> On Sun, Jun 9, 2019, 13:03 pierre amadio <amadio.pierre at gmail.com> wrote:
>>
>> Hello.
>>
>> Some times ago, i managed to build a python3 sword module with some
>> hack (changing manually the content of the setup.py genrated by make
>> pythonswig because subprocess.run does not work in python3).
>> This was on a Red Hat based box.
>> Now that i try again on Debian, the make pythonswig process itself fail.
>>
>> Is there any plan to have official support for python3 in a future release ?
>>
>> Is there by any chance already a branch of some devel tree i could
>> clone and get a local version of sword with pyton3 module ?
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list