This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository grass.
commit 1f46a6228043172042ccce8ea09abba3a76e45c7 Author: Bas Couwenberg <[email protected]> Date: Mon May 23 23:40:49 2016 +0200 Add patches by Alexis Bienvenüe to make the build reproducible. --- debian/changelog | 7 +++ debian/patches/binary-nad-install.patch | 17 ++++++ debian/patches/series | 5 ++ debian/patches/sort-build-modules-list.patch | 17 ++++++ debian/patches/sort-dbmscap.patch | 65 ++++++++++++++++++++++ debian/patches/sort-obj-files.patch | 23 ++++++++ .../srand48_auto-from-SOURCE_DATE_EPOCH.patch | 33 +++++++++++ 7 files changed, 167 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0501996..59913a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grass (7.0.4-2) UNRELEASED; urgency=medium + + * Add patches by Alexis Bienvenüe to make the build reproducible. + (closes: #825092) + + -- Bas Couwenberg <[email protected]> Mon, 23 May 2016 23:38:48 +0200 + grass (7.0.4-1) unstable; urgency=medium * New upstream release. diff --git a/debian/patches/binary-nad-install.patch b/debian/patches/binary-nad-install.patch new file mode 100644 index 0000000..d3fe786 --- /dev/null +++ b/debian/patches/binary-nad-install.patch @@ -0,0 +1,17 @@ +Description: Binary NAD files install + Corrects binary NAD files install rule. +Author: Alexis Bienvenüe <[email protected]> +Bug-Debian: https://bugs.debian.org/825092 +Forwarded: https://trac.osgeo.org/grass/ticket/3042 + +--- a/lib/proj/Makefile ++++ b/lib/proj/Makefile +@@ -43,7 +43,7 @@ $(FTOL_OBJ): $(OBJDIR)/ftol.o + $(INSTALL) $< $@ + endif + +-$(NAD_DSTFILES): $(NAD_DIR)/%: $(NAD_BINFILES) | $(NAD_DIR) ++$(NAD_DSTFILES): $(NAD_DIR)/%: $(OBJDIR)/% | $(NAD_DIR) + $(INSTALL_DATA) $< $@ + + $(NAD_BINFILES): $(OBJDIR)/%: %.lla diff --git a/debian/patches/series b/debian/patches/series index 70fc821..9a5fa37 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,8 @@ instdir no-fail-html.patch appstream.patch spelling-errors.patch +sort-build-modules-list.patch +sort-dbmscap.patch +sort-obj-files.patch +srand48_auto-from-SOURCE_DATE_EPOCH.patch +binary-nad-install.patch diff --git a/debian/patches/sort-build-modules-list.patch b/debian/patches/sort-build-modules-list.patch new file mode 100644 index 0000000..6f506c9 --- /dev/null +++ b/debian/patches/sort-build-modules-list.patch @@ -0,0 +1,17 @@ +Description: Sort build modules list + Sort modules in module_items.xml, to make the build reproducible. +Author: Alexis Bienvenüe <[email protected]> +Bug-Debian: https://bugs.debian.org/825092 +Forwarded: https://trac.osgeo.org/grass/ticket/3042 + +--- a/gui/wxpython/tools/build_modules_xml.py ++++ b/gui/wxpython/tools/build_modules_xml.py +@@ -51,7 +51,7 @@ def parse_modules(fd): + # TODO: what about ms windows? does gtask handle this? + mlist = list(gcore.get_commands()[0]) + indent = 4 +- for m in mlist: ++ for m in sorted(mlist): + # TODO: get rid of g.mapsets_picker.py + if m == 'g.mapsets_picker.py' or m == 'g.parser': + continue diff --git a/debian/patches/sort-dbmscap.patch b/debian/patches/sort-dbmscap.patch new file mode 100644 index 0000000..9b7cabc --- /dev/null +++ b/debian/patches/sort-dbmscap.patch @@ -0,0 +1,65 @@ +Description: Sort dbmscap list + To get reproducible results. +Author: Alexis Bienvenüe <[email protected]> +Bug-Debian: https://bugs.debian.org/825092 +Forwarded: https://trac.osgeo.org/grass/ticket/3042 + +--- a/lib/db/dbmi_base/dbmscap.c ++++ b/lib/db/dbmi_base/dbmscap.c +@@ -209,19 +209,22 @@ dbDbmscap *db_read_dbmscap(void) + return list; + } + ++static int cmp_entry(dbDbmscap *a, dbDbmscap *b) { ++ return( a->driverName && b->driverName ? strcmp(a->driverName,b->driverName) : 0 ); ++} ++ + static void add_entry(dbDbmscap ** list, char *name, char *startup, char *comment) + { +- dbDbmscap *head, *cur, *tail; ++ /* add an entry to the list, so that the list remains ordered (by driverName) */ + +- /* add this entry to the head of a linked list */ +- tail = head = *list; +- while (tail && tail->next) +- tail = tail->next; +- *list = NULL; ++ dbDbmscap *head, *cur, *tail; + + cur = (dbDbmscap *) db_malloc(sizeof(dbDbmscap)); +- if (cur == NULL) +- return; /* out of memory */ ++ if (cur == NULL) { ++ *list = NULL; ++ return; ++ /* out of memory */ ++ } + cur->next = NULL; + + /* copy each item to the dbmscap structure */ +@@ -229,11 +232,21 @@ static void add_entry(dbDbmscap ** list, + strcpy(cur->startup, startup); + strcpy(cur->comment, comment); + ++ /* find the last entry that is less than cur */ ++ tail = head = *list; ++ while (tail && tail->next && cmp_entry(tail->next,cur)<0) ++ tail = tail->next; ++ + /* handle the first call (head == NULL) */ +- if (tail) +- tail->next = cur; +- else +- head = cur; ++ if (tail && cmp_entry(tail,cur)<0) { ++ /* insert right after tail */ ++ cur->next = tail->next; ++ tail->next = cur; ++ } else { ++ /* insert at first position */ ++ cur->next = head; ++ head = cur; ++ } + + *list = head; + } diff --git a/debian/patches/sort-obj-files.patch b/debian/patches/sort-obj-files.patch new file mode 100644 index 0000000..a7f19fa --- /dev/null +++ b/debian/patches/sort-obj-files.patch @@ -0,0 +1,23 @@ +Description: Sort object files + to make the build reproducible. +Author: Alexis Bienvenüe <[email protected]> +Bug-Debian: https://bugs.debian.org/825092 +Forwarded: https://trac.osgeo.org/grass/ticket/3042 + +--- a/include/Make/Vars.make ++++ b/include/Make/Vars.make +@@ -13,10 +13,10 @@ LEX_SOURCES := $(wildcard *.l) + YACC_SOURCES := $(wildcard *.y) + + AUTO_OBJS := \ +- $(subst .c,.o,$(C_SOURCES)) \ +- $(subst .cpp,.o,$(CPP_SOURCES)) \ +- $(subst .l,.yy.o,$(LEX_SOURCES)) \ +- $(subst .y,.tab.o,$(YACC_SOURCES)) ++ $(sort $(subst .c,.o,$(C_SOURCES))) \ ++ $(sort $(subst .cpp,.o,$(CPP_SOURCES))) \ ++ $(sort $(subst .l,.yy.o,$(LEX_SOURCES))) \ ++ $(sort $(subst .y,.tab.o,$(YACC_SOURCES))) + + ifndef MOD_OBJS + MOD_OBJS = $(AUTO_OBJS) diff --git a/debian/patches/srand48_auto-from-SOURCE_DATE_EPOCH.patch b/debian/patches/srand48_auto-from-SOURCE_DATE_EPOCH.patch new file mode 100644 index 0000000..7ab28dc --- /dev/null +++ b/debian/patches/srand48_auto-from-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,33 @@ +Description: Make srand48_auto use SOURCE_DATE_EPOCH if set + If SOURCE_DATE_EPOCH is set, use it to seed the random generator when + G_srand48_auto is called. This helps makeing the build reproducible + (html/random.png) + See https://reproducible-builds.org/specs/source-date-epoch/ +Author: Alexis Bienvenüe <[email protected]> +Bug-Debian: https://bugs.debian.org/825092 +Forwarded: https://trac.osgeo.org/grass/ticket/3042 + +--- a/lib/gis/lrand48.c ++++ b/lib/gis/lrand48.c +@@ -70,7 +70,12 @@ void G_srand48(long seedval) + + long G_srand48_auto(void) + { +- unsigned long seed = (unsigned long) getpid(); ++ unsigned long seed; ++ char *source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if(source_date_epoch) { ++ seed = strtoull(source_date_epoch, NULL, 10); ++ } else { ++ seed = (unsigned long) getpid(); + + #ifdef HAVE_GETTIMEOFDAY + { +@@ -86,6 +91,7 @@ long G_srand48_auto(void) + seed += (unsigned long) t; + } + #endif ++ } + + G_srand48((long) seed); + return (long) seed; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/grass.git _______________________________________________ Pkg-grass-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

