xserver: Branch 'master' - 4 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed Sep 13 15:15:53 UTC 2017
configure.ac | 10 ++++++++--
hw/xfree86/common/meson.build | 6 ++----
hw/xfree86/common/xf86Build.sh | 13 ++++++++++---
3 files changed, 20 insertions(+), 9 deletions(-)
New commits:
commit 5abaa50b292798370a665ace5eec56fd830be226
Author: Eric Anholt <eric at anholt.net>
Date: Fri Sep 1 12:22:59 2017 -0700
meson: Move the BUILD_DATE/TIME setup to configure time.
By having it as a custom_target with build_always, every "ninja -C
build" would rebuild Xorg for the new date/time, even if the rest of
Xorg didn't change.
We could build the rest of Xorg into a static lib, and regenerate
date/time when the static lib changes and link that into a final Xorg,
but BUILD_DATE/TIME is such a dubious feature (compared to including a
git sha, which is easy with meson) it doesn't seem worth the build
time cost.
Signed-off-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/common/meson.build b/hw/xfree86/common/meson.build
index 6ed3f5124..e734b3ce2 100644
--- a/hw/xfree86/common/meson.build
+++ b/hw/xfree86/common/meson.build
@@ -65,11 +65,9 @@ if get_option('pciaccess')
srcs_xorg_common += ['xf86pciBus.c', 'xf86VGAarbiter.c']
endif
-srcs_xorg_common += custom_target(
- 'xf86Build.h',
+srcs_xorg_common += configure_file(
output: 'xf86Build.h',
- command: [join_paths(meson.current_source_dir(), 'xf86Build.sh'), '@OUTPUT@'],
- build_always: true,
+ command: ['sh', join_paths(meson.current_source_dir(), 'xf86Build.sh'), '@OUTPUT@'],
)
srcs_xorg_common += custom_target(
commit 05e7e8b587dd9d37e8beadc72ab993f028c47fa1
Author: Eric Anholt <eric at anholt.net>
Date: Fri Sep 1 12:22:58 2017 -0700
meson: Include BUILD_DATE in the meson xf86Build.h.
Due to a typo, I only had BUILD_TIME present.
Signed-off-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/common/xf86Build.sh b/hw/xfree86/common/xf86Build.sh
index e1b14cec5..5f859a5d8 100755
--- a/hw/xfree86/common/xf86Build.sh
+++ b/hw/xfree86/common/xf86Build.sh
@@ -10,4 +10,4 @@ fi
output=$1
echo "#define BUILD_DATE $BUILD_DATE" > $output
-echo "#define BUILD_TIME $BUILD_TIME" > $output
+echo "#define BUILD_TIME $BUILD_TIME" >> $output
commit 2b080a14c87fc9e5f77fc3361297ac332aa04f02
Author: Eric Anholt <eric at anholt.net>
Date: Fri Sep 1 12:22:57 2017 -0700
meson: Respect SOURCE_DATE_EPOCH for reproducible builds.
This just copies over Chris Lamb's code from autotools.
Signed-off-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/common/xf86Build.sh b/hw/xfree86/common/xf86Build.sh
index ae4a55132..e1b14cec5 100755
--- a/hw/xfree86/common/xf86Build.sh
+++ b/hw/xfree86/common/xf86Build.sh
@@ -1,5 +1,12 @@
-BUILD_DATE=`date +'%Y%m%d'`
-BUILD_TIME=`date +'1%H%M%S'`
+DATE_FMT="%Y%m%d"
+TIME_FMT="1%H%M%S"
+
+BUILD_DATE="`date "+$DATE_FMT"`"
+BUILD_TIME="`date "+$TIME_FMT"`"
+if test "x$SOURCE_DATE_EPOCH" != "x"; then
+ BUILD_DATE="`date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT"`"
+ BUILD_TIME="`date -u -d "@$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u "+$TIME_FMT"`"
+fi
output=$1
echo "#define BUILD_DATE $BUILD_DATE" > $output
commit 937ed782ae5e4e0da739f0630d1681b3754f0281
Author: Chris Lamb <lamby at debian.org>
Date: Fri Sep 1 12:22:56 2017 -0700
configure.ac: Make BUILD_{DATE, TIME} respect SOURCE_DATE_EPOCH if set
Whilst working on the Reproducible Builds effort [0], we noticed that
xorg-server could not be built reproducibly. One reason is because it
embeds a "current" build and date time.
This should be compatible with both GNU and BSD date(1).
[0] https://reproducible-builds.org/
v2: Fix change in Y-M-D format that broke the build.
Signed-off-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/configure.ac b/configure.ac
index eee1257a9..f13a54ab9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2402,9 +2402,15 @@ AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [sysconfdir])
AC_SUBST([RELEASE_DATE])
-BUILD_DATE="`date +'%Y%m%d'`"
+DATE_FMT="%Y%m%d"
+TIME_FMT="1%H%M%S"
+BUILD_DATE="`date "+$DATE_FMT"`"
+BUILD_TIME="`date "+$TIME_FMT"`"
+if test "x$SOURCE_DATE_EPOCH" != "x"; then
+ BUILD_DATE="`date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT"`"
+ BUILD_TIME="`date -u -d "@$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u "+$TIME_FMT"`"
+fi
AC_SUBST([BUILD_DATE])
-BUILD_TIME="`date +'1%H%M%S'`"
AC_SUBST([BUILD_TIME])
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
More information about the xorg-commit
mailing list