SHA256
1
0
forked from pool/calibre
Files
calibre/calibre-setup.install.py.diff
Eric Schirra 4ffedfbef9 Accepting request 885945 from home:ecsos
- Update to 5.15.0
  * New Features
    - Allow auto scrolling through the list of books by pressing 
      the X key or right clicking on the cover browser
    - E-book viewer: Speed up first time open for EPUB files with 
      lots of styling
    - E-book viewer preferences: Allow searching for keyboard
      shortcuts
    - Edit book: Allow editing WEBP images
    - Various improvements to the template language, see 
      https://www.mobileread.com/forums/showthread.php?t=337573
    - E-book viewer: Show the current progress percentage in the 
      bottom bar of the viewer controls. This can be customized in 
      the viewer preferences under Headers and footers
    - E-book viewer: Add an option under Preferences->Miscellaneous
      to not restore open panels such as Search, Table of Contents
      etc on restart
    - When exporting highlights as text or markdown also output top
      level chapter titles
    - Allow downloading metadata from amazon.se
    - Preferences->Tweaks: Allow specifying that calibre should
      open the book details window when double clicking on a book
    - MOBI Output: Convert WebP images to PNG so they work with
      Amazon's software
    - DOCX Input: When converting embedded fonts, replace spaces in
      the filename with underscores to keep the execrable epubcheck
      happy
    - E-book viewer: Selection bar: Add keyboard shortcuts for all
      buttons. Hover over a button in the bar to see the shortcut
  * Bug Fixes
    - FB2 Output: Fix a regression in calibre 5 that caused
      paragraphs containing only non-breaking spaces to be removed
    - Metadata comments editor: Fix setting block alignment
      destroying other block level properties
    - E-book viewer: Fix margins not being adjusted immediately
      when preferences are changed
    - Edit book: Upgrade book internals: Fix skipping the NCX
      removal dialog not remembering the chosen option
    - Conversion: When specifying a line-height do not apply it to
      the tag, as it is pointless and causes the execrable
      epubcheck to complain
    - E-book viewer: Improve scrolling behavior when extending the
      selection using keyboard shortcuts
    - E-book viewer: Fix read percent for HTML files that are
      rendered in a single screen being 0% rather than 100%
    - E-book viewer: Highlights panel: Do not expand all sections
      when adding/deleting/modifying highlights
    - CHM Input: Fix a regression in calibre 5.0 that broke opening
      of some files that dont specify a character encoding
    - EPUB2 metadata: Read ISBNs in identifier elements without
      schemes if they are valid ISBNs and no properly identified
      isbns are present
    - Update Amazon metadata plugin for changes to amazon websites
    - Edit book: Fix detection of class names containing
      hyphens/underscores
- Rebase calibre-setup.install.py.diff.

OBS-URL: https://build.opensuse.org/request/show/885945
OBS-URL: https://build.opensuse.org/package/show/Documentation:Tools/calibre?expand=0&rev=616
2021-04-16 11:29:04 +00:00

117 lines
5.7 KiB
Diff

diff -Pdpru calibre-5.15.0.orig/setup/install.py calibre-5.15.0/setup/install.py
--- calibre-5.15.0.orig/setup/install.py 2021-04-16 04:20:00.000000000 +0200
+++ calibre-5.15.0/setup/install.py 2021-04-16 11:51:25.550511789 +0200
@@ -87,10 +87,12 @@ class Develop(Command):
if not opts.prefix:
opts.prefix = sys.prefix
for x in ('prefix', 'libdir', 'bindir', 'sharedir', 'staging_root',
- 'staging_libdir', 'staging_bindir', 'staging_sharedir'):
+ 'staging_libdir', 'staging_bindir', 'staging_sharedir',
+ 'mandir', 'locale_dir'):
o = getattr(opts, x, None)
if o:
setattr(opts, x, os.path.abspath(o))
+ self.info( "****", opts, self )
self.libdir = getattr(opts, 'libdir', None)
if self.libdir is None:
self.libdir = self.j(opts.prefix, 'lib')
@@ -98,6 +100,9 @@ class Develop(Command):
if self.bindir is None:
self.bindir = self.j(opts.prefix, 'bin')
self.sharedir = getattr(opts, 'sharedir', None)
+ self.mandir = getattr(opts, 'mandir', None)
+ if self.mandir is None:
+ self.mandir = self.j(opts.prefix, 'share')
if self.sharedir is None:
self.sharedir = self.j(opts.prefix, 'share')
if not getattr(opts, 'staging_root', None):
@@ -111,9 +116,17 @@ class Develop(Command):
self.staging_sharedir = getattr(opts, 'staging_sharedir', None)
if self.staging_sharedir is None:
self.staging_sharedir = opts.staging_sharedir = self.j(opts.staging_root, 'share')
+ self.staging_mandir = getattr(opts, 'staging_mandir', None)
+ if self.staging_mandir is None:
+ self.staging_mandir = opts.staging_mandir = self.j(opts.staging_root, 'man')
+ self.staging_localedir = getattr(opts, 'staging_localedir', None)
+ if self.staging_localedir is None:
+ self.staging_localedir = opts.staging_localedir = self.j(opts.staging_root, 'usr/share/locale')
self.staging_libdir = opts.staging_libdir = self.j(self.staging_libdir, 'calibre')
self.staging_sharedir = opts.staging_sharedir = self.j(self.staging_sharedir, 'calibre')
+ self.staging_mandir = opts.staging_mandir = self.j(self.staging_mandir, '')
+ self.staging_localedir = opts.staging_localedir = self.j(self.staging_localedir, '')
self.system_plugins_loc = opts.system_plugins_location
if self.__class__.__name__ == 'Develop':
@@ -125,6 +138,8 @@ class Develop(Command):
self.info('INSTALL paths:')
self.info('\tLIB:', self.staging_libdir)
self.info('\tSHARE:', self.staging_sharedir)
+ self.staging_mandir =self.j(self.mandir, '')
+ # self.mandir = self.j(opts.staging_root, 'man')
def pre_sub_commands(self, opts):
if not (islinux or isbsd or ishaiku):
@@ -250,6 +265,11 @@ class Install(Develop):
'the launcher scripts. This option controls the prefix '
'to which the install will actually copy files. By default '
'it is set to the value of --prefix.'))
+ parser.add_option('--staging-mandir',
+ help='Where to put the calibre manpage files. Default is <root>/man')
+ parser.add_option('--staging-locale-dir',
+ dest="staging_localedir",
+ help="Where to put the calibre locale files. Default is <root>/share/locale")
parser.add_option('--staging-libdir',
help='Where to put calibre library files. Default is <root>/lib')
parser.add_option('--staging-bindir',
@@ -260,6 +280,49 @@ class Install(Develop):
help='Path to a directory from which the installed calibre will load plugins')
self.add_postinstall_options(parser)
+ def install_localefiles(self):
+ """Install the .mo files"""
+ #if not self.locale_dir.startswith( sys.prefix ):
+ # # We don't want to disturb installation when option --locale-dir is not set
+ # return
+ locale = os.path.join(self.RESOURCES, "localization/locales")
+ dest = self.staging_localedir
+ self.info("Installing locale files...")
+ self.info("*** locale_dir:", dest)
+ self.info("*** SRC:", self.SRC)
+ self.info("*** DEST:", dest)
+ if not os.path.exists(dest):
+ os.makedirs(dest)
+ for lang in os.listdir( locale ):
+ j = os.path.join(locale, lang)
+ dd = os.path.join(dest, lang)
+ if os.path.exists(dd):
+ shutil.rmtree(dd)
+ lc_message_dest = os.path.join(dest, lang, 'LC_MESSAGES')
+ lc_message = os.path.join(locale, lang, "LC_MESSAGES")
+ self.info("Creating locale directory %s " % lc_message_dest)
+ os.makedirs( lc_message_dest )
+ filedict = {
+ 'iso639.mo': 'iso639.mo',
+ 'messages.mo': 'calibre.mo',
+ 'qt.qm': '',
+ }
+ for f in os.listdir(lc_message):
+ destfile = filedict.get(f)
+ if destfile != '':
+ self.info("Moving %s -> %s" % (lang, dd))
+ shutil.move(os.path.join(lc_message, f),
+ os.path.join(dest, lang, 'LC_MESSAGES', destfile ))
+
+
+ #shutil.move(os.path.join(locale,i), dest)
+ # Rename that beast:
+ #shutil.move(os.path.join(dest, i, 'LC_MESSAGES/messages.mo'),
+ # os.path.join(dest, i, 'LC_MESSAGES/calibre.mo'))
+ #os.remove( os.path.join(dest, i, 'LC_MESSAGES/qt.qm' )
+ #shutil.copytree(j, dd )
+ shutil.rmtree(os.path.join(self.RESOURCES, "localization/locales") )
+
def install_files(self):
dest = self.staging_libdir
if os.path.exists(dest):