[packages/calibre] - rediff patches

baggins baggins at pld-linux.org
Wed Jun 23 14:09:49 CEST 2021


commit d770c02271d42f305a618f5dfe67c2b102ae5a66
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Jun 23 14:09:22 2021 +0200

    - rediff patches

 calibre-env_module.patch  |  7 ++++---
 calibre-locales.patch     | 48 +++++++++++++++++++++--------------------------
 calibre-prefix.patch      | 16 +++++++++-------
 desktop-integration.patch | 11 ++++++-----
 shebang-python-fix.patch  | 16 +++++++++-------
 5 files changed, 49 insertions(+), 49 deletions(-)
---
diff --git a/calibre-env_module.patch b/calibre-env_module.patch
index ed00a0f..660d879 100644
--- a/calibre-env_module.patch
+++ b/calibre-env_module.patch
@@ -1,6 +1,7 @@
---- calibre-4.14.0/setup/install.py~	2020-04-25 17:50:17.000000000 +0200
-+++ calibre-4.14.0/setup/install.py	2020-04-25 17:50:31.379931989 +0200
-@@ -142,7 +142,6 @@
+diff -urNp -x '*.orig' calibre-4.20.0.org/setup/install.py calibre-4.20.0/setup/install.py
+--- calibre-4.20.0.org/setup/install.py	2021-06-23 14:08:55.902867594 +0200
++++ calibre-4.20.0/setup/install.py	2021-06-23 14:08:57.906270435 +0200
+@@ -142,7 +142,6 @@ class Develop(Command):
          self.consolidate_paths()
          self.install_files()
          self.write_templates()
diff --git a/calibre-locales.patch b/calibre-locales.patch
index 24b76fe..5db0419 100644
--- a/calibre-locales.patch
+++ b/calibre-locales.patch
@@ -1,25 +1,23 @@
---- calibre/setup/translations.py.wiget	2013-12-06 05:13:34.000000000 +0100
-+++ calibre/setup/translations.py	2013-12-09 09:28:32.349958101 +0100
-@@ -143,7 +143,7 @@ class Translations(POT):  # {{{
+diff -urNp -x '*.orig' calibre-4.20.0.org/setup/translations.py calibre-4.20.0/setup/translations.py
+--- calibre-4.20.0.org/setup/translations.py	2020-07-03 04:11:13.000000000 +0200
++++ calibre-4.20.0/setup/translations.py	2021-06-23 14:08:43.642418411 +0200
+@@ -304,12 +304,11 @@ class Translations(POT):  # {{{
  
      def mo_file(self, po_file):
          locale = os.path.splitext(os.path.basename(po_file))[0]
 -        return locale, os.path.join(self.DEST, locale, 'messages.mo')
 +        return locale, os.path.join(self.DEST, locale, 'LC_MESSAGES', 'messages.mo')
  
-     def run(self, opts):
-         self.iso639_errors = []
-@@ -174,7 +175,6 @@ class Translations(POT):  # {{{
      def run(self, opts):
          self.compile_main_translations()
          self.compile_content_server_translations()
 -        self.freeze_locales()
          self.compile_user_manual_translations()
- 
-     def compile_group(self, files, handle_stats=None, file_ok=None, action_per_file=None):
-@@ -198,15 +198,6 @@ class Translations(POT):  # {{{
-                     # raise SystemExit(1)
+         self.compile_website_translations()
+         self.compile_changelog_translations()
+@@ -539,15 +538,6 @@ class Translations(POT):  # {{{
                  rmap[msgstr] = msgid
+         return not has_errors
  
 -    def freeze_locales(self):
 -        zf = self.DEST + '.zip'
@@ -32,10 +30,11 @@
 -
      @property
      def stats(self):
-         return self.j(self.d(self.DEST), 'stats.pickle')
---- calibre/src/calibre/translations/dynamic.py.wiget	2013-12-06 05:13:34.000000000 +0100
-+++ calibre/src/calibre/translations/dynamic.py	2013-12-09 09:28:32.349958101 +0100
-@@ -21,15 +21,10 @@ def translate(lang, text):
+         return self.j(self.d(self.DEST), 'stats.calibre_msgpack')
+diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/translations/dynamic.py calibre-4.20.0/src/calibre/translations/dynamic.py
+--- calibre-4.20.0.org/src/calibre/translations/dynamic.py	2020-07-03 04:11:13.000000000 +0200
++++ calibre-4.20.0/src/calibre/translations/dynamic.py	2021-06-23 14:08:43.642418411 +0200
+@@ -24,15 +24,10 @@ def translate(lang, text):
      else:
          mpath = get_lc_messages_path(lang)
          if mpath is not None:
@@ -54,10 +53,11 @@
 +               _CACHE[lang] = trans
      if trans is None:
          return getattr(__builtins__, '_', lambda x: x)(text)
-     return trans.ugettext(text)
---- calibre/src/calibre/utils/localization.py.wiget	2013-12-06 05:13:34.000000000 +0100
-+++ calibre/src/calibre/utils/localization.py	2013-12-09 09:31:05.694326467 +0100
-@@ -74,21 +74,20 @@ def get_lang():
+     f = getattr(trans, 'gettext' if ispy3 else 'ugettext')
+diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/utils/localization.py calibre-4.20.0/src/calibre/utils/localization.py
+--- calibre-4.20.0.org/src/calibre/utils/localization.py	2020-07-03 04:11:13.000000000 +0200
++++ calibre-4.20.0/src/calibre/utils/localization.py	2021-06-23 14:08:43.642418411 +0200
+@@ -104,51 +104,42 @@ def is_rtl():
      return get_lang()[:2].lower() in {'he', 'ar'}
  
  
@@ -89,11 +89,10 @@
 +        return messages_path(hlang)
 +    return None
  
- _lang_trans = None
  
-@@ -99,13 +99,14 @@
  _lang_trans = None
  
+ 
  def get_all_translators():
 -    from zipfile import ZipFile
 -    with ZipFile(P('localization/locales.zip', allow_user_override=False), 'r') as zf:
@@ -101,20 +100,15 @@
 -            mpath = get_lc_messages_path(lang)
 -            if mpath is not None:
 -                buf = io.BytesIO(zf.read(mpath + '/messages.mo'))
--                yield lang, GNUTranslations(buf)
 +    for lang in available_translations():
 +        mpath = get_lc_messages_path(lang)
 +        if mpath is not None:
 +            try:
 +                buf = open(os.path.join(mpath, 'calibre.mo'), 'rb')
-+                yield lang, GNUTranslations(buf)
+                 yield lang, GNUTranslations(buf)
 +            except:
 +                pass
  
- lcdata = {
-     u'abday': (u'Sun', u'Mon', u'Tue', u'Wed', u'Thu', u'Fri', u'Sat'),
-@@ -134,20 +134,11 @@
- 
  
  def get_single_translator(mpath, which='messages'):
 -    from zipfile import ZipFile
@@ -136,7 +130,7 @@
  
  
  def get_iso639_translator(lang):
-@@ -145,22 +145,21 @@
+@@ -219,22 +210,21 @@ def translator_for_lang(lang):
          buf = load_po(mpath + '.po')
  
      if mpath is not None:
diff --git a/calibre-prefix.patch b/calibre-prefix.patch
index cb4fa73..c719147 100644
--- a/calibre-prefix.patch
+++ b/calibre-prefix.patch
@@ -1,6 +1,7 @@
---- calibre/setup/install.py~	2010-05-16 05:55:33.000000000 +0200
-+++ calibre/setup/install.py	2010-05-20 12:00:42.483014835 +0200
-@@ -91,15 +91,10 @@
+diff -urNp -x '*.orig' calibre-4.20.0.org/setup/install.py calibre-4.20.0/setup/install.py
+--- calibre-4.20.0.org/setup/install.py	2020-07-03 04:11:13.000000000 +0200
++++ calibre-4.20.0/setup/install.py	2021-06-23 14:08:38.902233250 +0200
+@@ -100,15 +100,10 @@ class Develop(Command):
              self.sharedir = self.j(opts.prefix, 'share')
          if not getattr(opts, 'staging_root', None):
              opts.staging_root = opts.prefix
@@ -20,9 +21,10 @@
  
          self.staging_libdir = opts.staging_libdir = self.j(self.staging_libdir, 'calibre')
          self.staging_sharedir = opts.staging_sharedir = self.j(self.staging_sharedir, 'calibre')
---- calibre-3.44.0/src/calibre/linux.py~	2019-06-09 19:23:04.000000000 +0200
-+++ calibre-3.44.0/src/calibre/linux.py	2019-06-09 19:27:46.476130247 +0200
-@@ -685,10 +685,10 @@
+diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/linux.py calibre-4.20.0/src/calibre/linux.py
+--- calibre-4.20.0.org/src/calibre/linux.py	2020-07-03 04:11:13.000000000 +0200
++++ calibre-4.20.0/src/calibre/linux.py	2021-06-23 14:08:38.902233250 +0200
+@@ -737,10 +737,10 @@ class PostInstall:
              self.warn = self.warning
  
          if not self.opts.staging_bindir:
@@ -35,7 +37,7 @@
              'share', 'calibre')
          self.opts.staging_etc = '/etc' if self.opts.staging_root == '/usr' else \
                  os.path.join(self.opts.staging_root, 'etc')
-@@ -696,7 +696,7 @@
+@@ -748,7 +748,7 @@ class PostInstall:
          prefix = getattr(self.opts, 'prefix', None)
          if prefix and prefix != self.opts.staging_root:
              self.opts.staged_install = True
diff --git a/desktop-integration.patch b/desktop-integration.patch
index 5daf2f5..458fe5e 100644
--- a/desktop-integration.patch
+++ b/desktop-integration.patch
@@ -1,6 +1,7 @@
---- calibre-2.44.1/src/calibre/linux.py.orig	2015-11-21 11:22:06.420641478 +0100
-+++ calibre-2.44.1/src/calibre/linux.py	2015-11-21 11:20:41.000000000 +0100
-@@ -781,7 +781,7 @@
+diff -urNp -x '*.orig' calibre-4.20.0.org/src/calibre/linux.py calibre-4.20.0/src/calibre/linux.py
+--- calibre-4.20.0.org/src/calibre/linux.py	2021-06-23 14:08:51.192699952 +0200
++++ calibre-4.20.0/src/calibre/linux.py	2021-06-23 14:08:53.186104962 +0200
+@@ -875,7 +875,7 @@ class PostInstall:
                  def install_single_icon(iconsrc, basename, size, context, is_last_icon=False):
                      filename = '%s-%s.png' % (basename, size)
                      render_img(iconsrc, filename, width=int(size), height=int(size))
@@ -9,7 +10,7 @@
                      if is_last_icon:
                          del cmd[2]
                      cc(cmd)
-@@ -850,7 +850,7 @@
+@@ -941,7 +941,7 @@ class PostInstall:
  
                  APPDATA = get_appdata()
                  for x in des:
@@ -18,7 +19,7 @@
                      cc(' '.join(cmd), shell=True)
                      self.menu_resources.append(x)
                      ak = x.partition('.')[0]
-@@ -856,8 +856,7 @@
+@@ -951,8 +951,7 @@ class PostInstall:
                  MIME = P(MIME_BASE)
                  self.mime_resources.append(MIME_BASE)
                  if not getattr(self.opts, 'staged_install', False):
diff --git a/shebang-python-fix.patch b/shebang-python-fix.patch
index 163ff90..31baa20 100644
--- a/shebang-python-fix.patch
+++ b/shebang-python-fix.patch
@@ -1,15 +1,17 @@
---- calibre/recipes/nrc-nl-epub.recipe~	2011-03-26 02:30:09.000000000 +0100
-+++ calibre/recipes/nrc-nl-epub.recipe	2011-03-29 09:31:15.404987337 +0200
+diff -urNp -x '*.orig' calibre-4.20.0.org/recipes/nrc-nl-epub.recipe calibre-4.20.0/recipes/nrc-nl-epub.recipe
+--- calibre-4.20.0.org/recipes/nrc-nl-epub.recipe	2020-07-03 04:11:13.000000000 +0200
++++ calibre-4.20.0/recipes/nrc-nl-epub.recipe	2021-06-23 14:08:48.429265433 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env  python2
 +#!/usr/bin/env  python
  # -*- coding: utf-8 -*-
- #Based on veezh's original recipe and Kovid Goyal's New York Times recipe
+ # Based on veezh's original recipe and Kovid Goyal's New York Times recipe
  
---- calibre/setup/install.py~	2011-03-29 09:28:50.238365816 +0200
-+++ calibre/setup/install.py	2011-03-29 09:32:00.301640042 +0200
-@@ -12,7 +12,7 @@
-         __appname__, __version__
+diff -urNp -x '*.orig' calibre-4.20.0.org/setup/install.py calibre-4.20.0/setup/install.py
+--- calibre-4.20.0.org/setup/install.py	2021-06-23 14:08:46.395856286 +0200
++++ calibre-4.20.0/setup/install.py	2021-06-23 14:08:48.429265433 +0200
+@@ -20,7 +20,7 @@ from setup import (
+ )
  
  HEADER = '''\
 -#!/usr/bin/env python{py_major_version}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/calibre.git/commitdiff/d770c02271d42f305a618f5dfe67c2b102ae5a66



More information about the pld-cvs-commit mailing list