diff --git a/build-release.sh b/build-release.sh index e479ac7..25eebc9 100755 --- a/build-release.sh +++ b/build-release.sh @@ -73,7 +73,7 @@ for _mingw in ${ARCH_INSTALLS}; do if [ -z ${_msystem} ]; then ${_python} setup-cli.linux.cx_freeze.py build_exe -b ${_dist} if [ $? -eq 0 ]; then - # some PIL files are copied twice + # clean after cx_Freeze for file in ${_dist}/lib/.libs/*; do rm ${_dist}/lib/`basename $file` done @@ -106,6 +106,18 @@ EOF cp -R ${u_work_dir}/${_dist} ${_dist} rm -rf ${u_work_dir} + # clean after cx_Freeze + mv ${_dist}/imageformats/Qt5* ${_dist}/lib/. + rm ${_dist}/imageformats/VCRUNTIME140.dll + rm ${_dist}/imageformats/MSVCP140.dll + + mv ${_dist}/platforms/Qt5* ${_dist}/lib/. + rm ${_dist}/platforms/VCRUNTIME140.dll + rm ${_dist}/platforms/MSVCP140.dll + + mv ${_dist}/lib/VCRUNTIME140.dll ${_dist}/. + mv ${_dist}/lib/MSVCP140.dll ${_dist}/. + cd ${_dist} 7z a -r ../fb2mobi_all_${_arch} fi diff --git a/profiles/default.css b/profiles/default.css index 43af0db..13b3ef0 100644 --- a/profiles/default.css +++ b/profiles/default.css @@ -1,299 +1,327 @@ - -@page { - margin-left: 20px; - margin-right:20px; - margin-top:20px; - margin-bottom:5px; -} - -.h0 { - font-size: 140%; - font-weight: bold; - margin-bottom: 1em; -} - -.h1 { - font-size: 120%; - font-weight: bold; - margin-bottom: 1em; -} - -.h2 { - font-size: 120%; - font-weight: bold; - margin-bottom: 1em; -} - -.h3 { - font-size: 120%; - font-weight: bold; - margin-bottom: 1em; -} - -.h4 { - font-size: 120%; - font-weight: bold; - text-align: center; - margin-bottom: 1em; -} - -.h5 { - font-size: 120%; - font-weight: bold; - text-align: center; - margin-bottom: 1em; -} - -.h6 { - font-size: 120%; - font-weight: bold; - text-align: center; - margin-bottom: 1em; -} - -.titleblock { - text-indent: 0em; - page-break-before: always; - margin-top: 2em; - margin-bottom: 1em; -} - -.titleblock_nobreak { - text-indent: 0em; - margin-top: 2em; - margin-bottom: 1em; -} - -.titlenotes { - font-size: 100%; - font-weight: bold; - margin-top: 1em; - margin-bottom: 0.5em; - page-break-after: avoid; -} - -.titlenotes p { - text-indent: 0; - text-align: center; -} - -.indent0 { margin-left: 0pt; text-align: left; } -.indent1 { margin-left: 10pt; text-align: left; } -.indent2 { margin-left: 20pt; text-align: left; } -.indent3 { margin-left: 30pt; text-align: left; } -.indent4 { margin-left: 40pt; text-align: left; } -.indent5 { margin-left: 40pt; text-align: left; } -.indent6 { margin-left: 40pt; text-align: left; } - -.anchor { - vertical-align: super; - font-size: 70%; -} - -.linkanchor { - font-size: 80%; -} - -.inlineanchor { - display: none; -} - -.blockanchor { - vertical-align: super; - font-size: 70%; -} - -.emphasis { - font-style: italic; -} - -.emptyline { - margin-top: 2em; -} - -.strong { - font-weight: bold; -} -.strike { - text-decoration: line-through; -} - -.epigraph { - margin-left: 4em; - text-align: right; - margin-top: 0.4em; - margin-bottom: 0.2em; - font-style: italic; -} -.text-author { - page-break-before: avoid; - text-align: right; - font-weight: bold; -} - -.subtitle { - page-break-after: avoid; - text-align: center; - font-weight: bold; - margin-bottom: 0.5em; - margin-top: 1em; -} - -p.subtitle { - text-indent: 0em; -} - -p { - text-indent: 1em; - margin-bottom: 0pt; - margin-top: 0pt; - text-align: justify; - padding-bottom: 0.5em; -} - -p.title { - text-indent: 0em; - text-align: center; -} - -.cite { - font-style: italic; - text-indent: 1em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} - -.image { - text-indent: 0em; - text-align: center; -} - -.image img { - max-width:100%; - max-height:100%; -} - -.poem { - text-indent: 0em; - margin-left: 3em; - margin-bottom: 0em; - margin-top: 0em; - font-style: italic; -} - -.stanza { - margin-bottom: 0.5em; -} - -.poem p { - margin-bottom: 0em; - margin-top: 0em; -} - -.table { - width: 100%; - border: 1px solid black; - border-collapse: collapse; -} - -.table th { - border: 1px solid black; - background: #ccc; -} - -.table td { - border: 1px solid black; -} - -.code { - margin-bottom: 0em; - margin-top: 0em; -} - -.inlineimage {} - -.inlinenote { - font-style: italic; - font-size: 80%; - color: #6e6e6e; -} - -.inlinenote::before { - content: "["; -} - -.inlinenote::after { - content: "]"; -} - -.blocknote { - font-style: italic; - font-size: 80%; - border-radius: 4px; - background: #e6e6fa; - padding: 2px; - border: 1px #505050 solid; -} - -.floatnote { - font-size: 80%; - text-indent: 0em; -} - -.notenum { - font-weight: bold; -} - -.annotation { - margin-right: 1em; - margin-left: 1em; - font-size: 80%; - text-align: center; - margin-top: 2em; - margin-bottom: 1em; -} - -span.dropcaps { - font-weight: bold; - font-size: 4em; - float: left; - margin-top: -.1em; - margin-bottom: -.1em; - margin-right: .1em; - padding-right: .1em; -} - -p.dropcaps { - text-indent: 0; -} - -.vignette_title_before { - text-indent: 0; - text-align: center; - page-break-after: avoid; - margin-bottom: 0; -} - -.vignette_title_after { - text-indent: 0; - text-align: center; - page-break-before: avoid; - margin-top: 0; - margin-bottom: 0; -} - -.vignette_chapter_end { - text-indent: 0; - font-size: 200%; - text-align: center; - page-break-before: avoid; - page-break-inside: avoid; - margin-top: 2em; - margin-bottom: 0; -} - -.chapter_end { - page-break-before: avoid; - page-break-inside: avoid; - page-break-after: always; -} +@page { + margin-left: 20px; + margin-right: 20px; + margin-top: 20px; + margin-bottom: 5px; +} + +.h0 { + font-size: 140%; + font-weight: bold; + margin-bottom: 1em; +} + +.h1 { + font-size: 120%; + font-weight: bold; + margin-bottom: 1em; +} + +.h2 { + font-size: 120%; + font-weight: bold; + margin-bottom: 1em; +} + +.h3 { + font-size: 120%; + font-weight: bold; + margin-bottom: 1em; +} + +.h4 { + font-size: 120%; + font-weight: bold; + text-align: center; + margin-bottom: 1em; +} + +.h5 { + font-size: 120%; + font-weight: bold; + text-align: center; + margin-bottom: 1em; +} + +.h6 { + font-size: 120%; + font-weight: bold; + text-align: center; + margin-bottom: 1em; +} + +.titleblock { + text-indent: 0em; + page-break-before: always; + margin-top: 2em; + margin-bottom: 1em; +} + +.titleblock_nobreak { + text-indent: 0em; + margin-top: 2em; + margin-bottom: 1em; +} + +.titlenotes { + font-size: 100%; + font-weight: bold; + margin-top: 1em; + margin-bottom: 0.5em; + page-break-after: avoid; +} + +.titlenotes p { + text-indent: 0; + text-align: center; +} + +.indent0 { + margin-left: 0pt; + text-align: left; +} + +.indent1 { + margin-left: 10pt; + text-align: left; +} + +.indent2 { + margin-left: 20pt; + text-align: left; +} + +.indent3 { + margin-left: 30pt; + text-align: left; +} + +.indent4 { + margin-left: 40pt; + text-align: left; +} + +.indent5 { + margin-left: 40pt; + text-align: left; +} + +.indent6 { + margin-left: 40pt; + text-align: left; +} + +.anchor { + vertical-align: super; + font-size: 70%; +} + +.linkanchor { + font-size: 80%; +} + +.inlineanchor { + display: none; +} + +.blockanchor { + vertical-align: super; + font-size: 70%; +} + +.emphasis { + font-style: italic; +} + +.emptyline { + margin-top: 2em; +} + +.strong { + font-weight: bold; +} + +.strike { + text-decoration: line-through; +} + +.epigraph { + margin-left: 4em; + text-align: right; + margin-top: 0.4em; + margin-bottom: 0.2em; + font-style: italic; +} + +.text-author { + page-break-before: avoid; + text-align: right; + font-weight: bold; +} + +.subtitle { + page-break-after: avoid; + text-align: center; + font-weight: bold; + margin-bottom: 0.5em; + margin-top: 1em; +} + +p.subtitle { + text-indent: 0em; +} + +p { + text-indent: 1em; + margin-bottom: 0pt; + margin-top: 0pt; + text-align: justify; + padding-bottom: 0.5em; +} + +p.title { + text-indent: 0em; + text-align: center; +} + +.cite { + font-style: italic; + text-indent: 1em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} + +.image { + text-indent: 0em; + text-align: center; +} + +.image img { + max-width: 100%; + max-height: 100%; +} + +.inlineimage {} + +.poem { + text-indent: 0em; + margin-left: 3em; + margin-bottom: 0em; + margin-top: 0em; + font-style: italic; +} + +.stanza { + margin-bottom: 0.5em; +} + +.poem p { + margin-bottom: 0em; + margin-top: 0em; +} + +.table { + width: 100%; + border: 1px solid black; + border-collapse: collapse; +} + +.table th { + border: 1px solid black; + background: #ccc; +} + +.table td { + border: 1px solid black; +} + +.code { + margin-bottom: 0em; + margin-top: 0em; +} + +.inlinenote { + font-style: italic; + font-size: 80%; + color: #6e6e6e; +} + +.inlinenote::before { + content: "["; +} + +.inlinenote::after { + content: "]"; +} + +.blocknote { + font-style: italic; + font-size: 80%; + border-radius: 4px; + background: #e6e6fa; + padding: 2px; + border: 1px #505050 solid; +} + +.floatnote { + font-size: 80%; + text-indent: 0em; +} + +.notenum { + font-weight: bold; +} + +.annotation { + margin-right: 1em; + margin-left: 1em; + font-size: 80%; + text-align: center; + margin-top: 2em; + margin-bottom: 1em; +} + +span.dropcaps { + font-weight: bold; + font-size: 4em; + float: left; + margin-top: -.1em; + margin-bottom: -.1em; + margin-right: .1em; + padding-right: .1em; +} + +p.dropcaps { + text-indent: 0; +} + +.vignette_title_before { + text-indent: 0; + text-align: center; + page-break-after: avoid; + margin-bottom: 0; +} + +.vignette_title_after { + text-indent: 0; + text-align: center; + page-break-before: avoid; + margin-top: 0; + margin-bottom: 0; +} + +.vignette_chapter_end { + text-indent: 0; + font-size: 200%; + text-align: center; + page-break-before: avoid; + page-break-inside: avoid; + margin-top: 2em; + margin-bottom: 0; +} + +.chapter_end { + page-break-before: avoid; + page-break-inside: avoid; + page-break-after: always; +} \ No newline at end of file diff --git a/setup-all.linux.cx_freeze.py b/setup-all.linux.cx_freeze.py deleted file mode 100644 index 5342bca..0000000 --- a/setup-all.linux.cx_freeze.py +++ /dev/null @@ -1,76 +0,0 @@ -from cx_Freeze import setup, Executable - -import sys -import os -import shutil -import version -import PIL, glob - -base_dir = os.path.abspath(os.path.dirname(sys.argv[0])) -sys.argv.append('build_exe') - -try: - shutil.rmtree(os.path.join(base_dir, 'build')) -except: - pass - -try: - shutil.rmtree(os.path.join(base_dir, 'dist')) -except: - pass - -includes = [ - 'modules.default_css' -] - -excludes = [ - 'pywin', - 'Tkconstants', - 'Tkinter', - 'tcl' -] - -data_files = [ - (os.path.join(base_dir, 'modules', 'dictionaries'), 'dictionaries'), - (os.path.join(base_dir, 'profiles'), 'profiles'), - (os.path.join(base_dir, 'fb2mobi.config'), 'fb2mobi.config'), - (os.path.join(base_dir, 'spaces.xsl'), 'spaces.xsl'), - (os.path.join(base_dir, 'default_cover.jpg'), 'default_cover.jpg'), - (os.path.join(base_dir, 'kindlegen'), 'kindlegen'), - (os.path.join(base_dir, 'ui/locale/qtbase_ru.qm'), 'ui/locale/qtbase_ru.qm'), - (os.path.join(base_dir, 'ui/locale/fb2mobi_ru.qm'), 'ui/locale/fb2mobi_ru.qm') -] - -pil_libs = glob.glob(os.path.join(PIL.__path__[0], '.libs/*')) -if len(pil_libs) > 0: - data_files = pil_libs + data_files - -qt5_libs = glob.glob(os.path.join("/usr/lib/", 'libQt5*.so.5.8.0')) -if len(qt5_libs) > 0: - data_files = qt5_libs + data_files - -icu_libs = glob.glob(os.path.join("/usr/lib/", 'libicu*.so.58.2')) -if len(icu_libs) > 0: - data_files = icu_libs + data_files - -setup( - name = "fb2mobi", - version = version.VERSION, - options={ - 'build_exe': { -# 'silent': 1, - 'build_exe': 'dist', - 'zip_exclude_packages': '', - 'zip_include_packages': '*', - 'packages': 'lxml,PIL,PyQt5', - 'include_files': data_files, - 'includes': includes, - 'excludes': excludes, - } - }, - executables = [ - Executable('fb2mobi-gui.py'), - Executable('fb2mobi.py'), - Executable('synccovers.py') - ] -) diff --git a/setup-all.win32.cx_freeze.py b/setup-all.win32.cx_freeze.py index b8318aa..d17c9a8 100644 --- a/setup-all.win32.cx_freeze.py +++ b/setup-all.win32.cx_freeze.py @@ -9,6 +9,9 @@ base_dir = os.path.abspath(os.path.dirname(sys.argv[0])) sys.argv.append('build_exe') +os.environ['TCL_LIBRARY'] = os.path.join(base_dir, 'tcl', 'tcl8.6') +os.environ['TK_LIBRARY'] = os.path.join(base_dir, 'tcl', 'tk8.6') + try: shutil.rmtree(os.path.join(base_dir, 'build')) except: @@ -20,18 +23,17 @@ pass includes = [ - 'lxml._elementpath', + 'atexit', 'modules.default_css', - 'PyQt5.QtCore', - 'PyQt5.QtGui', - 'PyQt5.QtWidgets' ] excludes = [ + 'olefile', + 'distutils', 'pywin', - 'Tkconstants', - 'Tkinter', - 'tcl' + 'tkconstants', + 'tkinter', + 'tcl', ] data_files = [ @@ -44,7 +46,6 @@ (os.path.join(base_dir, 'kindlegen.exe'), 'kindlegen.exe'), (os.path.join(base_dir, 'ui/locale/qtbase_ru.qm'), 'ui/locale/qtbase_ru.qm'), (os.path.join(base_dir, 'ui/locale/fb2mobi_ru.qm'), 'ui/locale/fb2mobi_ru.qm'), - (os.path.join(site.getsitepackages()[1], 'PyQt5/Qt/plugins/platforms/qwindows.dll'), "platforms/qwindows.dll") ] setup( @@ -52,11 +53,10 @@ version = version.VERSION, options={ 'build_exe': { -# 'silent': 1, -# 'build_exe': 'dist', 'zip_exclude_packages': '', 'zip_include_packages': '*', 'include_files': data_files, + 'packages': 'json,lxml,PIL', 'includes': includes, 'excludes': excludes, } @@ -65,6 +65,6 @@ Executable('fb2mobi.py'), Executable('fb2mobi.py',targetName='fb2epub.exe'), Executable('synccovers.py'), - Executable('fb2mobi-gui.py', base='Win32GUI', icon='ui/fb2mobi.ico') + Executable('fb2mobi-gui.py', base='Win32GUI', icon='ui/fb2mobi.ico'), ] )