kitty: fix unreproducible build (manpage dates, fish completions)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
--- a/tools/cli/fish.go 2025-04-04 23:43:16
|
||||
+++ b/tools/cli/fish.go 2025-04-04 23:44:13
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
+ "sort"
|
||||
"strings"
|
||||
|
||||
"kitty/tools/cli/markup"
|
||||
@@ -22,6 +23,7 @@
|
||||
}
|
||||
if len(commands) == 0 {
|
||||
commands = append(commands, utils.Keys(all_commands)...)
|
||||
+ sort.Strings(commands)
|
||||
}
|
||||
script := strings.Builder{}
|
||||
script.WriteString(`function __ksi_completions
|
||||
@@ -0,0 +1,35 @@
|
||||
--- a/tools/cli/help.go 2025-04-04 23:55:53
|
||||
+++ b/tools/cli/help.go 2025-04-04 23:56:59
|
||||
@@ -9,6 +9,7 @@
|
||||
"os/exec"
|
||||
"slices"
|
||||
"strings"
|
||||
+ "strconv"
|
||||
"time"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -133,6 +134,15 @@
|
||||
pager.Stdout = os.Stdout
|
||||
pager.Stderr = os.Stderr
|
||||
_ = pager.Run()
|
||||
+}
|
||||
+
|
||||
+func getDeterministicTimestamp() time.Time {
|
||||
+ if epochStr, exists := os.LookupEnv("SOURCE_DATE_EPOCH"); exists {
|
||||
+ if epoch, err := strconv.ParseInt(epochStr, 10, 64); err == nil {
|
||||
+ return time.Unix(epoch, 0).UTC()
|
||||
+ }
|
||||
+ }
|
||||
+ return time.Now()
|
||||
}
|
||||
|
||||
func (self *Command) GenerateManPages(level int, recurse bool) (err error) {
|
||||
@@ -149,7 +159,7 @@
|
||||
return err
|
||||
}
|
||||
defer outf.Close()
|
||||
- fmt.Fprintf(outf, `.TH "%s" "1" "%s" "%s" "%s"`, name, time.Now().Format("Jan 02, 2006"), kitty.VersionString, "kitten Manual")
|
||||
+ fmt.Fprintf(outf, `.TH "%s" "1" "%s" "%s" "%s"`, name, getDeterministicTimestamp().Format("Jan 02, 2006"), kitty.VersionString, "kitten Manual")
|
||||
fmt.Fprintln(outf)
|
||||
fmt.Fprintln(outf, ".SH Name")
|
||||
fmt.Fprintln(outf, name, "\\-", escape_text_for_man(self.ShortDescription))
|
||||
@@ -159,6 +159,12 @@ buildPythonApplication rec {
|
||||
# Skip `test_ssh_bootstrap_with_different_launchers` when launcher is `zsh` since it causes:
|
||||
# OSError: master_fd is in error condition
|
||||
./disable-test_ssh_bootstrap_with_different_launchers.patch
|
||||
|
||||
# Makes man page generation respect SOURCE_DATE_EPOCH. Drop on next kitty release https://github.com/kovidgoyal/kitty/pull/8509
|
||||
./fix-timestamp-reproducibility.patch
|
||||
|
||||
# Ensures deterministic ordering of fish shell completions. Drop on next kitty release https://github.com/kovidgoyal/kitty/pull/8509
|
||||
./fix-fish-completion-ordering.patch
|
||||
];
|
||||
|
||||
hardeningDisable = [
|
||||
|
||||
Reference in New Issue
Block a user