From cce65aa6d3995b1f8c87ebf561d4da49031a4f57 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Fri, 29 Sep 2017 18:41:39 +0200 Subject: [PATCH 1/3] Sort list of files used in generated table --- docs/06-appearance.md.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/06-appearance.md.lua b/docs/06-appearance.md.lua index 21e08de1..48fe4325 100644 --- a/docs/06-appearance.md.lua +++ b/docs/06-appearance.md.lua @@ -95,6 +95,7 @@ local function get_link(file, element) end local all_files = get_all_files("./lib/", "lua") +table.sort(all_files) local beautiful_vars = {} From 9d7eaf020d75a970c216e95f6c7cd256e7300d4b Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Fri, 29 Sep 2017 20:00:21 +0200 Subject: [PATCH 2/3] Use reproducible timestamp during build During build svg images of the calendar widget are generated, which differ based on the current date. By honouring the environment variable SOURCE_DATE_EPOCH, which is set by distributions during build, a deterministic date can be used at build time while keeping the normal behaviour during runtime. See also: https://reproducible-builds.org/specs/source-date-epoch/ --- tests/examples/shims/_date.lua | 11 +++++++++++ .../examples/wibox/widget/calendar/fn_embed_cell.lua | 1 + tests/examples/wibox/widget/calendar/font.lua | 1 + .../examples/wibox/widget/calendar/long_weekdays.lua | 1 + tests/examples/wibox/widget/calendar/month.lua | 1 + tests/examples/wibox/widget/calendar/start_sunday.lua | 1 + tests/examples/wibox/widget/calendar/week_numbers.lua | 1 + tests/examples/wibox/widget/calendar/year.lua | 1 + tests/examples/wibox/widget/defaults/calendar.lua | 1 + 9 files changed, 19 insertions(+) create mode 100644 tests/examples/shims/_date.lua diff --git a/tests/examples/shims/_date.lua b/tests/examples/shims/_date.lua new file mode 100644 index 00000000..8236b327 --- /dev/null +++ b/tests/examples/shims/_date.lua @@ -0,0 +1,11 @@ +local source_date_epoch = os.getenv("SOURCE_DATE_EPOCH") +if source_date_epoch then + local old_osdate = os.date + os.date = function(format, timestamp) -- luacheck: ignore + if timestamp then + return old_osdate(format, timestamp) + end + format = "!" .. format + return old_osdate(format, source_date_epoch) + end +end diff --git a/tests/examples/wibox/widget/calendar/fn_embed_cell.lua b/tests/examples/wibox/widget/calendar/fn_embed_cell.lua index 91155e8c..0a56d3c0 100644 --- a/tests/examples/wibox/widget/calendar/fn_embed_cell.lua +++ b/tests/examples/wibox/widget/calendar/fn_embed_cell.lua @@ -3,6 +3,7 @@ local wibox = require("wibox") --DOC_HIDE local gears = require("gears") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE diff --git a/tests/examples/wibox/widget/calendar/font.lua b/tests/examples/wibox/widget/calendar/font.lua index 5c42571f..35542121 100644 --- a/tests/examples/wibox/widget/calendar/font.lua +++ b/tests/examples/wibox/widget/calendar/font.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("sans 12") --DOC_HIDE diff --git a/tests/examples/wibox/widget/calendar/long_weekdays.lua b/tests/examples/wibox/widget/calendar/long_weekdays.lua index a4a671bc..cad855c8 100644 --- a/tests/examples/wibox/widget/calendar/long_weekdays.lua +++ b/tests/examples/wibox/widget/calendar/long_weekdays.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE diff --git a/tests/examples/wibox/widget/calendar/month.lua b/tests/examples/wibox/widget/calendar/month.lua index 38167f28..0a77a343 100644 --- a/tests/examples/wibox/widget/calendar/month.lua +++ b/tests/examples/wibox/widget/calendar/month.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE_ALL local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE diff --git a/tests/examples/wibox/widget/calendar/start_sunday.lua b/tests/examples/wibox/widget/calendar/start_sunday.lua index 346b587b..3f21ee6e 100644 --- a/tests/examples/wibox/widget/calendar/start_sunday.lua +++ b/tests/examples/wibox/widget/calendar/start_sunday.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE diff --git a/tests/examples/wibox/widget/calendar/week_numbers.lua b/tests/examples/wibox/widget/calendar/week_numbers.lua index b319a756..5d4a163a 100644 --- a/tests/examples/wibox/widget/calendar/week_numbers.lua +++ b/tests/examples/wibox/widget/calendar/week_numbers.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE diff --git a/tests/examples/wibox/widget/calendar/year.lua b/tests/examples/wibox/widget/calendar/year.lua index 4274a0e2..dbb5a8a1 100644 --- a/tests/examples/wibox/widget/calendar/year.lua +++ b/tests/examples/wibox/widget/calendar/year.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE diff --git a/tests/examples/wibox/widget/defaults/calendar.lua b/tests/examples/wibox/widget/defaults/calendar.lua index ea57daad..67e8b487 100644 --- a/tests/examples/wibox/widget/defaults/calendar.lua +++ b/tests/examples/wibox/widget/defaults/calendar.lua @@ -2,6 +2,7 @@ local parent = ... --DOC_HIDE local wibox = require("wibox") --DOC_HIDE local beautiful = require( "beautiful" ) --DOC_HIDE local Pango = require("lgi").Pango --DOC_HIDE +require("_date") --DOC_HIDE -- Beautiful fake get_font --DOC_HIDE local f = Pango.FontDescription.from_string("monospace 10") --DOC_HIDE From a9b65833e78296301faf12884decd193b126c13f Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sat, 7 Oct 2017 13:47:10 +0200 Subject: [PATCH 3/3] Travis: export SOURCE_DATE_EPOCH in one build job --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1d73eb87..47edc3c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ env: matrix: - LUA=5.2 LUANAME=lua5.2 DO_COVERAGE=coveralls # Lua 5.3 isn't available in Ubuntu Trusty, so some magic below installs it. - - LUA=5.3 LUANAME=lua5.3 LUALIBRARY=/usr/lib/liblua.so DO_COVERAGE=codecov + - LUA=5.3 LUANAME=lua5.3 LUALIBRARY=/usr/lib/liblua.so DO_COVERAGE=codecov EXPORT_SDE=true # luajit: installed from source. - LUA=5.1 LUANAME=luajit-2.0 LUALIBRARY=/usr/lib/libluajit-5.1.so LUAROCKS_ARGS=--lua-suffix=jit-2.0.5 TEST_PREV_COMMITS=1 # Note: luarocks does not work with Lua 5.0. @@ -156,6 +156,7 @@ install: } script: - export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -DSTRICT_TESTS=true -D DO_COVERAGE=$DO_COVERAGE" + - if [ "$EXPORT_SDE" = "true" ]; then export SOURCE_DATE_EPOCH=$(date -u -r docs/89-NEWS.md +%s); fi - | if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then # Break beautiful so that trying to access the theme before beautiful.init() causes an error