Source: fim
Version: 0.5~rc3-4
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: environment
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

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

This is because it embeds CFLAGS and CXXFLAGS in the binary and,
because these contain --f-debug-prefix-map arguments that use the
absolute build path by design.

Patch attached that simply removes the inclusion of the build flags
from the binary.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1970-01-01 01:00:00.000000000 
+0100
--- b/debian/patches/reproducible-build.patch   2019-04-29 14:04:37.163882359 
+0100
@@ -0,0 +1,30 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2019-04-29
+
+--- fim-0.5~rc3.orig/src/fim.cpp
++++ fim-0.5~rc3/src/fim.cpp
+@@ -1603,13 +1603,6 @@ fim_perr_t main(int argc,char *argv[])
+       #ifdef FIM_CONFIGURATION
+                       "Configuration invocation: " FIM_CONFIGURATION "\n" 
+       #endif /* FIM_CONFIGURATION */
+-      #ifdef CXXFLAGS
+-                      "Compile flags: CXXFLAGS=" CXXFLAGS
+-      #ifdef CFLAGS
+-                      "  CFLAGS=" CFLAGS
+-      #endif /* CFLAGS */
+-                      "\n"
+-      #endif /* CXXFLAGS */
+                       "Fim options (features included (+) or not (-)):\n"
+       #include "version.h"
+       /* i think some flags are missing .. */
+--- fim-0.5~rc3.orig/src/Makefile.am
++++ fim-0.5~rc3/src/Makefile.am
+@@ -51,7 +51,6 @@ version.h:   ../config.h
+       $(ECHO) "\"\n\"" >> $@
+       $(GREP) define $< | $(GREP) FIM.*'"' | LC_ALL=C $(SORT) | $(SED) 
's/^#//g;s/define //g;s/^\([A-Za-z0-9_]*\) "\(.*\)"$$/"\1 = \\"\2\\"\\n"/g'   
>> $@
+       $(GREP) undef $< | $(GREP) FIM | LC_ALL=C $(SORT) | $(SED) 
's/^#//g;s/.*undef //g;s/^\([A-Za-z0-9_]*\).\+$$/-\1  /g;s/^/\"/g;s/$$/\"/g' >> 
$@
+-      $(ECHO)  '"\n'CXXFLAGS=$(CXXFLAGS)'\n"' >> $@
+ 
+ help.cpp: fim.h
+       $(ECHO) -e "#ifdef FIM_WANT_INLINE_HELP\n" > $@
--- a/debian/patches/series     1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series     2019-04-29 13:56:59.337704517 +0100
@@ -0,0 +1 @@
+reproducible-build.patch

Reply via email to