Source: gpick
Version: 0.2.6~rc1-3
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: buildpath
X-Debbugs-Cc: [email protected]

Hi,

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

This is because it embeds the absolute build directory via a LOCALEDIR
definition:

 -  0x000a98c0 00000000 00000000 2f627569 6c642f31 ......../build/1
 -  0x000a98d0 73742f67 7069636b 2d302e32 2e367e72 st/gpick-0.2.6~r
 -  0x000a98e0 63312f64 65626961 6e2f6770 69636b2f c1/debian/gpick/
 -  0x000a98f0 7573722f 73686172 652f6c6f 63616c65 usr/share/locale
 -  0x000a9900 00000000 00000000 6661696c 65642074 ........failed t
 +  0x000a98c0 00000000 00000000 2f627569 6c642f32 ......../build/2
 +  0x000a98d0 2f677069 636b2d30 2e322e36 7e726331 /gpick-0.2.6~rc1
 +  0x000a98e0 2f326e64 2f646562 69616e2f 67706963 /2nd/debian/gpic
 +  0x000a98f0 6b2f7573 722f7368 6172652f 6c6f6361 k/usr/share/loca
 +  0x000a9900 6c650000 00000000 6661696c 65642074 le......failed t

A patch is attached -- very much a proof of concept -- that hacks the
upstream SConscript file to obey the LOCALEDIR UNIX environment
variable; Scons seems to have it's own idea of what an environment is
which I don't immediately grok. (Maybe you can do it via the command-
line in debian/rules but I can't quite figure that out.)

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
--- a/debian/patches/08_reproducible_build.patch        1970-01-01 
01:00:00.000000000 +0100
--- b/debian/patches/08_reproducible_build.patch        2020-04-13 
11:49:16.474797776 +0100
@@ -0,0 +1,15 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2020-04-13
+
+--- gpick-0.2.6~rc1.orig/SConscript
++++ gpick-0.2.6~rc1/SConscript
+@@ -10,7 +10,7 @@ env = GpickEnvironment(ENV=os.environ, B
+ 
+ vars = Variables(os.path.join(env.GetLaunchDir(), 'user-config.py'))
+ vars.Add('DESTDIR', 'Directory to install under', '/usr/local')
+-vars.Add('LOCALEDIR', 'Path to locale directory', '')
++vars.Add('LOCALEDIR', 'Path to locale directory', os.environ.get('LOCALEDIR', 
''))
+ vars.Add('DEBARCH', 'Debian package architecture', 'i386')
+ vars.Add(BoolVariable('ENABLE_NLS', 'Compile with gettext support', True))
+ vars.Add(BoolVariable('DEBUG', 'Compile with debug information', False))
--- a/debian/patches/series     2020-04-13 10:37:49.183261253 +0100
--- b/debian/patches/series     2020-04-13 11:49:15.734785870 +0100
@@ -4,3 +4,4 @@
 05_scons_python3.patch
 06_fix_python_indentation.patch
 07_environment_variable_version.patch
+08_reproducible_build.patch
--- a/debian/rules      2020-04-13 10:37:49.183261253 +0100
--- b/debian/rules      2020-04-13 11:48:11.581744647 +0100
@@ -7,6 +7,8 @@
 CXXFLAGS+=$(CPPFLAGS)
 LDFLAGS += -Wl,--as-needed
 
+export LOCALEDIR = /usr/share/locale
+
 debian_destdir :=$(CURDIR)/debian/gpick/usr
 
 %:
@@ -15,7 +17,7 @@
 override_dh_clean:
        dh_testdir
        dh_testroot
-       scons -c -C src
+       scons -c -C src LOCALE_DIR=loldongs
        find -name "*.pyc" -delete
        rm -f build-stamp configure-stamp
        rm -rf .sconsign.dblite config.log .sconf_temp/ build/
--- a/debian/source/include-binaries    1970-01-01 01:00:00.000000000 +0100
--- b/debian/source/include-binaries    2020-04-13 11:48:40.018208428 +0100
@@ -0,0 +1,10 @@
+.sconf_temp/conftest_5
+.sconf_temp/conftest_5.o
+tools/__pycache__/__init__.cpython-38.pyc
+tools/__pycache__/flex.cpython-38.pyc
+tools/__pycache__/gettext.cpython-38.pyc
+tools/__pycache__/gpick.cpython-38.pyc
+tools/__pycache__/lemon.cpython-38.pyc
+tools/__pycache__/ragel.cpython-38.pyc
+tools/__pycache__/resource_template.cpython-38.pyc
+tools/__pycache__/template.cpython-38.pyc

Reply via email to