1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: gtk: Make reproducible.

* gnu/packages/patches/gtk4-demo-reproducible.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gtk.scm (gtk) [source]: Apply it.

Change-Id: I03ef58f324a84151a681988a18aa1ab986aeba79
This commit is contained in:
Maxim Cournoyer
2026-03-17 17:22:56 +09:00
parent 98b6cd4fa7
commit e5469a5848
3 changed files with 82 additions and 1 deletions

View File

@@ -1580,6 +1580,7 @@ dist_patch_DATA = \
%D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \ %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \
%D%/packages/patches/gtk-doc-respect-xml-catalog.patch \ %D%/packages/patches/gtk-doc-respect-xml-catalog.patch \
%D%/packages/patches/gtk-doc-mkhtml-test-fix.patch \ %D%/packages/patches/gtk-doc-mkhtml-test-fix.patch \
%D%/packages/patches/gtk4-demo-reproducible.patch \
%D%/packages/patches/gtk4-needs-udmabuf.patch \ %D%/packages/patches/gtk4-needs-udmabuf.patch \
%D%/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch \ %D%/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch \
%D%/packages/patches/gtkglext-disable-disable-deprecated.patch \ %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \

View File

@@ -1133,7 +1133,8 @@ application suites.")
(sha256 (sha256
(base32 "1z2mkmazc2d51jbg3qwwdycycqiwswm88nhw6bxscz8j86f5lyyd")) (base32 "1z2mkmazc2d51jbg3qwwdycycqiwswm88nhw6bxscz8j86f5lyyd"))
(patches (patches
(search-patches "gtk4-needs-udmabuf.patch" (search-patches "gtk4-demo-reproducible.patch"
"gtk4-needs-udmabuf.patch"
"gtk4-respect-GUIX_GTK4_PATH.patch")) "gtk4-respect-GUIX_GTK4_PATH.patch"))
(modules '((guix build utils))))) (modules '((guix build utils)))))
(build-system meson-build-system) (build-system meson-build-system)

View File

@@ -0,0 +1,79 @@
Upstream-status: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9675
diff --git a/demos/gtk-demo/geninclude.py b/demos/gtk-demo/geninclude.py
index 2ebfaeb625..5864a608f5 100755
--- a/demos/gtk-demo/geninclude.py
+++ b/demos/gtk-demo/geninclude.py
@@ -2,19 +2,20 @@
# -*- coding: utf-8 -*-
import sys
-import re
-import os
from collections import *
+
def add_quotes(s):
return "\"" + s.lower() + "\""
+
def wordify(s):
return s.strip().rstrip(".,;:")
+
def is_keyword(s):
if s == "GTK":
- return False
+ return False
elif s.startswith(("Gtk", "Gdk", "Pango")):
return True
elif s.startswith("G") and s[1].isupper():
@@ -22,6 +23,7 @@ def is_keyword(s):
else:
return False
+
out_file = sys.argv[1]
in_files = sys.argv[2:]
@@ -82,6 +84,10 @@ for demo in demos:
parent_index = parent_index + 1
+# Sort demos by title
+demos = sorted(demos, key=lambda x: x[1])
+
+
# For every child with a parent, generate a list of child demos
i = 0
for parent in parents:
@@ -91,15 +97,12 @@ for parent in parents:
for child in demos:
if child[1].startswith(parent + "/"):
title = child[1][child[1].rfind('/') + 1:]
- file_output += " { \"" + child[0] + "\", \"" + title + "\", " + "(const char*[]) {" + ", ".join(list(map(add_quotes, child[2])) + ["NULL"]) + " }, \"" + child[3] + "\", " + child[4] + ", NULL },\n"
+ file_output += " { \"" + child[0] + "\", \"" + title + "\", " + "(const char*[]) {" + ", ".join(list(map(add_quotes, sorted(child[2]))) + ["NULL"]) + " }, \"" + child[3] + "\", " + child[4] + ", NULL },\n"
file_output += " { NULL }\n};\n"
i = i + 1
-# Sort demos by title
-demos = sorted(demos, key=lambda x: x[1])
-
file_output += "\nDemoData gtk_demos[] = {\n"
for demo in demos:
# Do not generate one of these for demos with a parent demo
@@ -118,10 +121,10 @@ for demo in demos:
if demo[5] != -1:
child_array = "child" + str(demo[5])
- file_output += " { " + name + ", " + title + ", " + "(const char*[]) {" + ", ".join(list(map(add_quotes, keywords)) + ["NULL"]) + " }, " + file + ", " + demo[4] + ", " + child_array + " },\n"
+ file_output += " { " + name + ", " + title + ", " + "(const char*[]) {" + ", ".join(list(map(add_quotes, sorted(keywords))) + ["NULL"]) + " }, " + file + ", " + demo[4] + ", " + child_array + " },\n"
-file_output += " { NULL }\n};\n"
+file_output += " { NULL }\n};\n"
ofile = open(out_file, "w")
ofile.write(file_output)
ofile.close()