Source: deja-dup
Version: 34.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that deja-dup could not be built reproducibly.
It ships an embedded and outdated copy of help2man, which doesn't
support SOURCE_DATE_EPOCH yet. This leads to the current build date
getting embedded into the manpages.

The attached patch fixes this by adding a build dependency for help2man
and using it instead of the included version.

Regards,
 Reiner

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

diff --git a/debian/control.in b/debian/control.in
index 78296b0..2564823 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -9,6 +9,7 @@ Build-Depends: cmake,
                gnome-pkg-tools,
                intltool (>= 0.40),
                yelp-tools,
+               help2man,
                libglib2.0-dev (>= 2.34),
                libgtk-3-dev (>= 3.6),
                libnautilus-extension-dev,
diff --git a/debian/patches/help2man.patch b/debian/patches/help2man.patch
new file mode 100644
index 0000000..9434a3b
--- /dev/null
+++ b/debian/patches/help2man.patch
@@ -0,0 +1,32 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Use system help2man instead of embedded copy
+ The included help2man is outdated and lacks support for
+ SOURCE_DATE_EPOCH, which leads to unreproducible manpages,
+ because the current build date will be embedded.
+
+Index: deja-dup-34.0/man/CMakeLists.txt
+===================================================================
+--- deja-dup-34.0.orig/man/CMakeLists.txt
++++ deja-dup-34.0/man/CMakeLists.txt
+@@ -21,8 +21,8 @@ string(REPLACE ".po" "" LINGUAS "${POFIL
+ 
+ add_custom_command(OUTPUT C/deja-dup.1 C/deja-dup-preferences.1
+                    COMMAND mkdir -p C
+-                   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.main -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/deja-dup -o C/deja-dup.1
+-                   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.pref -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/preferences/deja-dup-preferences -o C/deja-dup-preferences.1
++                   COMMAND help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.main -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/deja-dup -o C/deja-dup.1
++                   COMMAND help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.pref -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/preferences/deja-dup-preferences -o C/deja-dup-preferences.1
+                    DEPENDS deja-dup deja-dup-preferences)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/C/deja-dup.1 ${CMAKE_CURRENT_BINARY_DIR}/C/deja-dup-preferences.1 DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/man/man1")
+ list(APPEND MAN_TARGETS C/deja-dup.1 C/deja-dup-preferences.1)
+@@ -31,8 +31,8 @@ foreach(LINGUA ${LINGUAS})
+   add_custom_command(OUTPUT ${LINGUA}/deja-dup.1 ${LINGUA}/deja-dup-preferences.1
+                      COMMAND mkdir -p ${LINGUA} locales/${LINGUA}/LC_MESSAGES
+                      COMMAND ln -sf ${CMAKE_BINARY_DIR}/po/${LINGUA}.gmo locales/${LINGUA}/LC_MESSAGES/deja-dup.mo
+-                     COMMAND env DEJA_DUP_LOCALEDIR=${CMAKE_CURRENT_BINARY_DIR}/locales DEJA_DUP_LANGUAGE=${LINGUA} ${CMAKE_CURRENT_SOURCE_DIR}/help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.main -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/deja-dup -o ${LINGUA}/deja-dup.1
+-                     COMMAND env DEJA_DUP_LOCALEDIR=${CMAKE_CURRENT_BINARY_DIR}/locales DEJA_DUP_LANGUAGE=${LINGUA} ${CMAKE_CURRENT_SOURCE_DIR}/help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.main -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/preferences/deja-dup-preferences -o ${LINGUA}/deja-dup-preferences.1
++                     COMMAND env DEJA_DUP_LOCALEDIR=${CMAKE_CURRENT_BINARY_DIR}/locales DEJA_DUP_LANGUAGE=${LINGUA} help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.main -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/deja-dup -o ${LINGUA}/deja-dup.1
++                     COMMAND env DEJA_DUP_LOCALEDIR=${CMAKE_CURRENT_BINARY_DIR}/locales DEJA_DUP_LANGUAGE=${LINGUA} help2man -N -i ${CMAKE_CURRENT_SOURCE_DIR}/include.main -L en_US.UTF-8 ${CMAKE_BINARY_DIR}/deja-dup/preferences/deja-dup-preferences -o ${LINGUA}/deja-dup-preferences.1
+                      DEPENDS translations deja-dup deja-dup-preferences)
+ 
+   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LINGUA}/deja-dup.1 ${CMAKE_CURRENT_BINARY_DIR}/${LINGUA}/deja-dup-preferences.1 DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/man/${LINGUA}/man1")
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..74b00be
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+help2man.patch

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
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