diff --git a/src/filters/rclhwp.py b/src/filters/rclhwp.py index 0bb63b3d..15fedaf7 100755 --- a/src/filters/rclhwp.py +++ b/src/filters/rclhwp.py @@ -24,6 +24,7 @@ # import sys +import os from io import BytesIO import subprocess @@ -48,14 +49,18 @@ def metafields(summaryinfo): # Extractor class. We use hwp summaryinfo to extract metadata and code # extracted from hwp.hwp5txt.py to extract the text. class HWP5Dump(RclBaseHandler): - def __init__(self, em): + def __init__(self, em, td): + self.execdir = td super(HWP5Dump, self).__init__(em) def html_text(self, fn): # hwp wants str filenames. This is unfortunate fn = fn.decode('utf-8') - - hwpfile = fs_Hwp5File(fn) + try: + hwpfile = fs_Hwp5File(fn) + except Exception as ex: + self.em.rclog("hwpfile open failed: %s" % ex) + raise ex try: tt = hwpfile.summaryinfo.title.strip() if tt: @@ -78,10 +83,13 @@ class HWP5Dump(RclBaseHandler): # the hwp5 module (no subproc). But this apparently mishandled # tables. Switched to executing hwp5html instead. See 1st git # version for the old approach. - html = subprocess.check_output(["hwp5html", "--html", fn]) + cmd = [sys.executable, os.path.join(self.execdir, "hwp5html"), + "--html", fn] + html = subprocess.check_output(cmd) return html if __name__ == '__main__': + execdir = os.path.dirname(sys.argv[0]) proto = rclexecm.RclExecM() - extract = HWP5Dump(proto) + extract = HWP5Dump(proto, execdir) rclexecm.main(proto, extract) diff --git a/src/qtgui/recoll-win.pro b/src/qtgui/recoll-win.pro index e319758d..cffa3155 100644 --- a/src/qtgui/recoll-win.pro +++ b/src/qtgui/recoll-win.pro @@ -5,10 +5,10 @@ TEMPLATE = app LANGUAGE = C++ TARGET = recoll -#QT += webkit -#DEFINES += USING_WEBKIT -QT += widgets webenginewidgets -DEFINES += USING_WEBENGINE +DEFINES += USING_WEBKIT +QT += webkit webkitwidgets +#QT += widgets webenginewidgets +#DEFINES += USING_WEBENGINE QT += xml printsupport @@ -119,7 +119,7 @@ windows { contains(QMAKE_CC, cl){ # MSVC - RECOLLDEPS = ../../../recolldeps-vc + RECOLLDEPS = ../../../recolldeps/msvc DEFINES += USING_STATIC_LIBICONV LIBS += \ -L../windows/build-librecoll-Desktop_Qt_5_14_1_MSVC2017_32bit-Release/release \ diff --git a/src/windows/mkinstdir.sh b/src/windows/mkinstdir.sh index 1032cf80..0c1b3b6a 100644 --- a/src/windows/mkinstdir.sh +++ b/src/windows/mkinstdir.sh @@ -22,8 +22,8 @@ test -d $DESTDIR || mkdir $DESTDIR || fatal cant create $DESTDIR ################################ # Local values (to be adjusted) -BUILD=MSVC -#BUILD=MINGW +#BUILD=MSVC +BUILD=MINGW if test $BUILD = MSVC ; then # Recoll src tree @@ -36,17 +36,19 @@ if test $BUILD = MSVC ; then LIBICONV=${RCLDEPS}/msvc/build-libiconv-${QTA}/libiconv.dll ZLIB=${RCLDEPS}/msvc/zlib-1.2.11 QTBIN=C:/Qt/5.14.1/msvc2017/bin + MINGWBIN=c:/Qt/5.14.1/mingw73_32/bin/ else # Recoll src tree RCL=c:/recoll/src/ # Recoll dependancies RCLDEPS=c:/recolldeps/ - QTA=Desktop_Qt_5_8_0_MinGW_32bit/release + QTA=Desktop_Qt_5_8_0_MinGW_32bit-Release/release LIBXAPIAN=${RCLDEPS}/mingw/xapian-core-1.4.11/.libs/libxapian-30.dll ZLIB=${RCLDEPS}/mingw/zlib-1.2.8 ASPELL=${RCLDEPS}/mingw/aspell-0.60.7/aspell-installed QTGCCBIN=C:/qt/Qt5.8.0/Tools/mingw530_32/bin/ QTBIN=C:/Qt/Qt5.8.0/5.8/mingw53_32/bin + MINGWBIN=$QTBIN PATH=$MINGWBIN:$QTGCCBIN:$PATH export PATH fi @@ -54,8 +56,7 @@ fi # Where to find libgcc_s_dw2-1.dll et all for progs compiled with # c:/MinGW (as opposed to the mingw bundled with qt). This is the same # for either a msvc or mingw build of recoll itself. -MINGWBIN=C:/MinGW/bin -MINGWBIN=c:/Qt/5.14.1/mingw73_32/bin/ +#MINGWBIN=C:/MinGW/bin RCLW=$RCL/windows/ # Only used for mingw, the msvc one is static @@ -129,6 +130,7 @@ copypython() mkdir -p $DESTDIR/Share/filters/python cp -rp $PYTHON/* $DESTDIR/Share/filters/python chkcp $PYTHON/python.exe $DESTDIR/Share/filters/python/python.exe + chkcp $MISC/hwp5html $FILTERS } copyrecoll() diff --git a/src/windows/qmkrecoll/librecoll.pro b/src/windows/qmkrecoll/librecoll.pro index d48f5814..f2b75da9 100644 --- a/src/windows/qmkrecoll/librecoll.pro +++ b/src/windows/qmkrecoll/librecoll.pro @@ -138,28 +138,28 @@ windows { RECOLLDEPS = C:/recolldeps QMAKE_CXXFLAGS += -std=c++11 -pthread -Wno-unused-parameter LIBS += \ - $$RECOLLDEPS/libxslt/libxslt-1.1.29/win32/bin.mingw/libxslt.a \ - $$RECOLLDEPS/libxml2/libxml2-2.9.4+dfsg1/win32/bin.mingw/libxml2.a \ - $$RECOLLDEPS/xapian-core-1.4.11/.libs/libxapian-30.dll \ - $$RECOLLDEPS/zlib-1.2.8/zlib1.dll \ + $$RECOLLDEPS/mingw/libxslt/libxslt-1.1.29/win32/bin.mingw/libxslt.a \ + $$RECOLLDEPS/mingw/libxml2/libxml2-2.9.4+dfsg1/win32/bin.mingw/libxml2.a \ + $$RECOLLDEPS/mingw/xapian-core-1.4.11/.libs/libxapian-30.dll \ + $$RECOLLDEPS/mingw/zlib-1.2.8/zlib1.dll \ -liconv -lshlwapi -lpsapi -lkernel32 INCLUDEPATH += ../../windows \ - $$RECOLLDEPS/xapian-core-1.4.15/include \ - $$RECOLLDEPS/libxslt/libxslt-1.1.29/ \ - $$RECOLLDEPS/libxml2/libxml2-2.9.4+dfsg1/include + $$RECOLLDEPS/mingw/xapian-core-1.4.11/include \ + $$RECOLLDEPS/mingw/libxslt/libxslt-1.1.29/ \ + $$RECOLLDEPS/mingw/libxml2/libxml2-2.9.4+dfsg1/include } contains(QMAKE_CC, cl){ - # Visual Studio - RECOLLDEPS = ../../../../recolldeps-vc + # MSVC + RECOLLDEPS = ../../../../recolldeps CONFIG += staticlib DEFINES += USING_STATIC_LIBICONV INCLUDEPATH += ../../windows \ - $$RECOLLDEPS/xapian-core-1.4.15/include \ - $$RECOLLDEPS/zlib-1.2.11/ \ - $$RECOLLDEPS/libxslt/libxslt-1.1.29/ \ - $$RECOLLDEPS/libxml2/libxml2-2.9.4+dfsg1/include \ - $$RECOLLDEPS/wlibiconv/include + $$RECOLLDEPS/msvc/xapian-core-1.4.15/include \ + $$RECOLLDEPS/msvc/zlib-1.2.11/ \ + $$RECOLLDEPS/msvc/libxslt/libxslt-1.1.29/ \ + $$RECOLLDEPS/msvc/libxml2/libxml2-2.9.4+dfsg1/include \ + $$RECOLLDEPS/msvc/wlibiconv/include QMAKE_CXXFLAGS_WARN_ON -= -w34100 QMAKE_CXXFLAGS += -wd4100 } diff --git a/src/windows/qmkrecoll/recollindex.pro b/src/windows/qmkrecoll/recollindex.pro index 48bcfa33..2e9b4606 100644 --- a/src/windows/qmkrecoll/recollindex.pro +++ b/src/windows/qmkrecoll/recollindex.pro @@ -27,12 +27,13 @@ windows { # MingW QMAKE_CXXFLAGS += -std=c++11 -pthread -Wno-unused-parameter LIBS += \ - C:/recoll/src/windows/build-librecoll-Desktop_Qt_5_8_0_MinGW_32bit-Release/release/librecoll.dll \ - -lshlwapi -lpsapi -lkernel32 + ../build-librecoll-Desktop_Qt_5_8_0_MinGW_32bit-Release/release/librecoll.dll \ + -lshlwapi -lpsapi -lkernel32 } + contains(QMAKE_CC, cl){ # MSVC - RECOLLDEPS = ../../../../recolldeps-vc + RECOLLDEPS = ../../../../recolldeps/msvc DEFINES += USING_STATIC_LIBICONV LIBS += \ -L../build-librecoll-Desktop_Qt_5_14_1_MSVC2017_32bit-Release/release \ diff --git a/src/windows/qmkrecoll/recollq.pro b/src/windows/qmkrecoll/recollq.pro index 8cef0b7a..258219bd 100644 --- a/src/windows/qmkrecoll/recollq.pro +++ b/src/windows/qmkrecoll/recollq.pro @@ -23,7 +23,7 @@ windows { MingW QMAKE_CXXFLAGS += -std=c++11 -Wno-unused-parameter LIBS += \ - C:/recoll/src/windows/build-librecoll-Desktop_Qt_5_8_0_MinGW_32bit-Release/release/librecoll.dll \ + ../build-librecoll-Desktop_Qt_5_8_0_MinGW_32bit-Release/release/librecoll.dll \ -lshlwapi -lpsapi -lkernel32 } contains(QMAKE_CC, cl){