Package: rkward
Severity: wishlist
Tags: upstream patch

Hi,

while working on the "reproducible builds" effort [1], it has been discovered
that rkward could not be built reproducibly. GNU R leaves a build timestamp
(showing date + time + timezone) in the /usr/lib/R/library/*/Description files
it generates.

The attached patch fixes the build timestamp to the timestamp of the last dch
entry. Thisis the default now for all GNUR packagesin Debian, see
https://bugs.debian.org/782764 for reference.

[1]: https://wiki.debian.org/ReproduibleBuilds

Best,
Philip
diff -u -r rkward-0.6.2~rc1/debian/rules rkward-0.6.2~rc1.R/debian/rules
--- rkward-0.6.2~rc1/debian/rules	2015-04-25 13:34:47.000000000 +0200
+++ rkward-0.6.2~rc1.R/debian/rules	2015-04-25 13:38:47.905295483 +0200
@@ -26,6 +26,9 @@
 RMAJOR = $(shell echo $(RVERS) | awk -F. '{print $$1}')
 RMINOR = $(shell echo $(RVERS) | awk -F. '{print $$2}')
 
+# set built-time of GNUR packages to time of created binary package based on stamp in changelog
+builttime = $(shell dpkg-parsechangelog -l$(CURDIR)/debian/changelog | awk -F': ' '/Date/ {print $$2}')
+
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 	CFLAGS += -O0
 else
@@ -65,7 +68,8 @@
 		-DCMAKE_VERBOSE_MAKEFILE=ON \
 		-DKDE4_DISABLE_MULTIMEDIA=ON \
 		-DR_EXECUTABLE=/usr/bin/R/ \
-		-DR_LIBDIR=/usr/lib/R/site-library/
+		-DR_LIBDIR=/usr/lib/R/site-library/ \
+		-DBUILD_TIMESTAMP="$(builttime)"
 
 	# Add here commands to compile the package.
 	cd $(CURDIR)/build && $(MAKE)
diff -u -r rkward-0.6.2~rc1/rkward/rbackend/rpackages/CMakeLists.txt rkward-0.6.2~rc1.R/rkward/rbackend/rpackages/CMakeLists.txt
--- rkward-0.6.2~rc1/rkward/rbackend/rpackages/CMakeLists.txt	2014-10-13 21:22:08.000000000 +0200
+++ rkward-0.6.2~rc1.R/rkward/rbackend/rpackages/CMakeLists.txt	2015-04-25 13:09:53.004937231 +0200
@@ -5,4 +5,4 @@
 	"${CMAKE_CURRENT_BINARY_DIR}/rpackage_install.cmake"
 	@ONLY)
 
-INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/rpackage_install.cmake -DDESTDIR=${DESTDIR})
+INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/rpackage_install.cmake -DDESTDIR=${DESTDIR} -DBUILD_TIMESTAMP=${BUILD_TIMESTAMP})
diff -u -r rkward-0.6.2~rc1/rkward/rbackend/rpackages/rpackage_install.cmake.in rkward-0.6.2~rc1.R/rkward/rbackend/rpackages/rpackage_install.cmake.in
--- rkward-0.6.2~rc1/rkward/rbackend/rpackages/rpackage_install.cmake.in	2014-10-13 21:22:06.000000000 +0200
+++ rkward-0.6.2~rc1.R/rkward/rbackend/rpackages/rpackage_install.cmake.in	2015-04-25 13:09:57.412966334 +0200
@@ -20,7 +20,7 @@
 		COMMAND mkdir -p @CMAKE_CURRENT_BINARY_DIR@/tmp ${DESTDIR}/@R_LIBDIR@
 	)
 	EXECUTE_PROCESS(
-		COMMAND env TMPDIR=@CMAKE_CURRENT_BINARY_DIR@/tmp @R_EXECUTABLE@ CMD INSTALL -c -l ${DESTDIR}/@R_LIBDIR@ "@CMAKE_CURRENT_SOURCE_DIR@/rkward" "@CMAKE_CURRENT_SOURCE_DIR@/rkwardtests"
+		COMMAND env TMPDIR=@CMAKE_CURRENT_BINARY_DIR@/tmp @R_EXECUTABLE@ CMD INSTALL --built-timestamp=${BUILD_TIMESTAMP} -c -l ${DESTDIR}/@R_LIBDIR@ "@CMAKE_CURRENT_SOURCE_DIR@/rkward" "@CMAKE_CURRENT_SOURCE_DIR@/rkwardtests"
 		WORKING_DIRECTORY @CMAKE_CURRENT_BINARY_DIR@
 		RESULT_VARIABLE R_LIB_INSTALL_EXIT_CODE
 	)
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to