Source: pympress
Version: 1.8.5-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
pympress could not be built reproducibly.

This is because the generated documentation included memory references
such as the following:

  pointer = <GdkPixbuf.Pixbuf object at 0x7f2d6ee3e700 (GdkPixbuf at 0x1d4cf90)>

A patch attached that uses Python's "default = None […] if default is
None: default = realdefault" pattern.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-


--- a/debian/patches/0005-Reproducible-build.patch      1970-01-01 
01:00:00.000000000 +0100
--- b/debian/patches/0005-Reproducible-build.patch      2024-04-11 
09:53:13.602746588 +0100
@@ -0,0 +1,41 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2024-04-11
+
+--- pympress-1.8.5.orig/pympress/app.py
++++ pympress-1.8.5/pympress/app.py
+@@ -150,11 +150,14 @@ class Pympress(Gtk.Application):
+         Gtk.Application.do_startup(self)
+ 
+ 
+-    def do_activate(self, timestamp=GLib.get_current_time()):
++    def do_activate(self, timestamp=None):
+         """ Activate: show UI windows.
+ 
+         Build them if they do not exist, otherwise bring to front.
+         """
++        if timestamp is None:
++            timestamp = GLib.get_current_time()
++
+         if self.gui is None:
+             if self.auto_log_level:
+                 self.activate_action('log-level', logging.INFO)
+--- pympress-1.8.5.orig/pympress/pointer.py
++++ pympress-1.8.5/pympress/pointer.py
+@@ -57,7 +57,7 @@ class Pointer(object):
+         builder (:class:`~pympress.builder.Builder`): A builder from which to 
load widgets
+     """
+     #: :class:`~GdkPixbuf.Pixbuf` to read XML descriptions of GUIs and load 
them.
+-    pointer = GdkPixbuf.Pixbuf()
++    pointer = None
+     #: `(float, float)` of position relative to slide, where the pointer 
should appear
+     pointer_pos = (.5, .5)
+     #: `bool` indicating whether we should show the pointer
+@@ -84,6 +84,7 @@ class Pointer(object):
+ 
+     def __init__(self, config, builder):
+         super(Pointer, self).__init__()
++        self.pointer = GdkPixbuf.Pixbuf()
+         self.config = config
+ 
+         builder.load_widgets(self)
--- a/debian/patches/series     2024-04-11 09:37:21.205740724 +0100
--- b/debian/patches/series     2024-04-11 09:48:11.045127589 +0100
@@ -1,3 +1,4 @@
 0002-intersphinx.patch
 0003-README-privacy.patch
 0004-Options-privacy.patch
+0005-Reproducible-build.patch

Reply via email to