Windows build: use embedded python distribution. Build recoll extension for multiple python versions. Clean up windows build dir

This commit is contained in:
Jean-Francois Dockes 2021-04-21 08:19:18 +01:00
parent 3fe1612bff
commit c54ee06489
18 changed files with 43 additions and 14 deletions

View File

@ -1 +0,0 @@
/c/Program\ Files\ \(x86\)/Python37-32/python.exe setup-win.py bdist_wheel

View File

@ -73,7 +73,8 @@ RCLIDX=$RCLW/build-recollindex-${QTA}/${qtsdir}/recollindex.exe
RCLQ=$RCLW/build-recollq-${QTA}/${qtsdir}/recollq.exe RCLQ=$RCLW/build-recollq-${QTA}/${qtsdir}/recollq.exe
RCLS=$RCLW/build-rclstartw-${QTA}/${qtsdir}/rclstartw.exe RCLS=$RCLW/build-rclstartw-${QTA}/${qtsdir}/rclstartw.exe
PYTHON=${RCLDEPS}py-python3 #PYTHON=${RCLDEPS}py-python3
PYTHON=${RCLDEPS}python-3.7.9-embed-win32
UNRTF=${RCLDEPS}unrtf UNRTF=${RCLDEPS}unrtf
ANTIWORD=${RCLDEPS}antiword ANTIWORD=${RCLDEPS}antiword
PYXSLT=${RCLDEPS}pyxslt PYXSLT=${RCLDEPS}pyxslt
@ -138,6 +139,9 @@ copyqt()
fi fi
} }
# Note that pychm and pyhwp are pre-copied into the py-python3 python
# distribution directory. The latter also needs olefile and six (also
# copied to the python tree
copypython() copypython()
{ {
set -x set -x
@ -217,6 +221,7 @@ copymutagen()
chkcp $MUTAGEN/build/lib/mutagen/mp3.py $FILTERS/mutagen chkcp $MUTAGEN/build/lib/mutagen/mp3.py $FILTERS/mutagen
} }
# Not used any more, the epub python code is bundled with recoll
copyepub() copyepub()
{ {
cp -rp $EPUB/build/lib/epub $FILTERS cp -rp $EPUB/build/lib/epub $FILTERS
@ -235,12 +240,14 @@ copyfuture()
chkcp $FUTURE/future/builtins/newsuper.pyc $FILTERS/future/builtins chkcp $FUTURE/future/builtins/newsuper.pyc $FILTERS/future/builtins
} }
# Replaced by mutagen
copypyexiv2() copypyexiv2()
{ {
cp -rp $PYEXIV2/pyexiv2 $FILTERS cp -rp $PYEXIV2/pyexiv2 $FILTERS
chkcp $PYEXIV2/libexiv2python.pyd $FILTERS/ chkcp $PYEXIV2/libexiv2python.pyd $FILTERS/
} }
# Replaced by lxml for python3
copypyxslt() copypyxslt()
{ {
chkcp $PYXSLT/libxslt.py $FILTERS/ chkcp $PYXSLT/libxslt.py $FILTERS/
@ -319,11 +326,17 @@ copyaspell()
copypyrecoll() copypyrecoll()
{ {
if test $BUILD = MSVC ; then if test $BUILD = MSVC ; then
PYRCLWHEEL=${PYRECOLL}/dist/Recoll-${VERSION}-cp37-cp37m-win32.whl
DEST=${DESTDIR}/Share/dist DEST=${DESTDIR}/Share/dist
test -d $DEST || mkdir $DEST || fatal cant create $DEST test -d $DEST || mkdir $DEST || fatal cant create $DEST
rm -f ${DEST}/* rm -f ${DEST}/*
chkcp ${PYRCLWHEEL} $DEST for v in 37;do
PYRCLWHEEL=${PYRECOLL}/dist/Recoll-${VERSION}-cp${v}-cp${v}m-win32.whl
chkcp ${PYRCLWHEEL} $DEST
done
for v in 38 39;do
PYRCLWHEEL=${PYRECOLL}/dist/Recoll-${VERSION}-cp${v}-cp${v}-win32.whl
chkcp ${PYRCLWHEEL} $DEST
done
fi fi
} }
@ -349,21 +362,11 @@ copyrecoll
copypyrecoll copypyrecoll
copyqt copyqt
copyaspell copyaspell
copypyxslt
copypoppler copypoppler
copyantiword copyantiword
copyunrtf copyunrtf
# Copied into python3 and installed with it
#copyfuture
copymutagen copymutagen
# Switched to perl for lack of python3 version
#copypyexiv2
copywpd copywpd
# Chm is now copied into the python tree, which is installed by copypython
#copychm
copypff copypff
# Note that pychm and pyhwp are pre-copied into the py-python3 python
# distribution directory. The latter also needs olefile and six (also
# copied)
copypython copypython

View File

@ -0,0 +1,27 @@
#!/bin/sh
pythondirs="Python37-32 Python38-32 Python39-32"
fatal()
{
echo $*
exit 1
}
test -f ../python/recoll/pyrecoll.cpp || fatal must be run in src/windows
cd ../python/recoll || exit 1
test -f pyrecoll.cpp || fatal Not seeing pyrecoll.cpp
rm -rf dist build || exit 1
# Note that the wheel format is the preferred distribution format (vs
# egg), but it requires installation of the wheel package, which does
# not come with the base Python installation. E.g.:
# /c/Program\ Files\ \(x86\)/Python38-32/python -m pip install wheel
for p in $pythondirs; do
/c/Program\ Files\ \(x86\)/${p}/python.exe setup-win.py bdist_wheel
done
rm -rf build Recoll.egg-info