···68686969Fortunately, there is [`wrapGAppsHook`]{#ssec-gnome-hooks-wrapgappshook}. It works in conjunction with other setup hooks that populate environment variables, and it will then wrap all executables in `bin` and `libexec` directories using said variables.
70707171-For convenience, it also adds `dconf.lib` for a GIO module implementing a GSettings backend using `dconf`, `gtk3` for GSettings schemas, and `librsvg` for GdkPixbuf loader to the closure. In case you are packaging a program without a graphical interface, you might want to use [`wrapGAppsNoGuiHook`]{#ssec-gnome-hooks-wrapgappsnoguihook}, which runs the same script as `wrapGAppsHook` but does not bring `gtk3` and `librsvg` into the closure.
7171+For convenience, it also adds `dconf.lib` for a GIO module implementing a GSettings backend using `dconf`, `gtk3` for GSettings schemas, and `librsvg` for GdkPixbuf loader to the closure. There is also [`wrapGAppsHook4`]{#ssec-gnome-hooks-wrapgappshook4}, which replaces GTK 3 with GTK 4. And in case you are packaging a program without a graphical interface, you might want to use [`wrapGAppsNoGuiHook`]{#ssec-gnome-hooks-wrapgappsnoguihook}, which runs the same script as `wrapGAppsHook` but does not bring `gtk3` and `librsvg` into the closure.
72727373- `wrapGAppsHook` itself will add the package’s `share` directory to `XDG_DATA_DIRS`.
7474
+13-1
maintainers/scripts/update.nix
···11{ package ? null
22, maintainer ? null
33+, predicate ? null
34, path ? null
45, max-workers ? null
56, include-overlays ? false
···6970 */
7071 packagesWith = packagesWithPath [];
71727373+ /* Recursively find all packages in `pkgs` with updateScript matching given predicate.
7474+ */
7575+ packagesWithUpdateScriptMatchingPredicate = cond:
7676+ packagesWith (path: pkg: builtins.hasAttr "updateScript" pkg && cond path pkg);
7777+7278 /* Recursively find all packages in `pkgs` with updateScript by given maintainer.
7379 */
7480 packagesWithUpdateScriptAndMaintainer = maintainer':
···7985 else
8086 builtins.getAttr maintainer' lib.maintainers;
8187 in
8282- packagesWith (path: pkg: builtins.hasAttr "updateScript" pkg &&
8888+ packagesWithUpdateScriptMatchingPredicate (path: pkg:
8389 (if builtins.hasAttr "maintainers" pkg.meta
8490 then (if builtins.isList pkg.meta.maintainers
8591 then builtins.elem maintainer pkg.meta.maintainers
···120126 packages =
121127 if package != null then
122128 [ (packageByName package pkgs) ]
129129+ else if predicate != null then
130130+ packagesWithUpdateScriptMatchingPredicate predicate pkgs
123131 else if maintainer != null then
124132 packagesWithUpdateScriptAndMaintainer maintainer pkgs
125133 else if path != null then
···138146 % nix-shell maintainers/scripts/update.nix --argstr package gnome3.nautilus
139147140148 to run update script for specific package, or
149149+150150+ % nix-shell maintainers/scripts/update.nix --arg predicate '(path: pkg: builtins.isList pkg.updateScript && builtins.length pkg.updateScript >= 1 && (let script = builtins.head pkg.updateScript; in builtins.isAttrs script && script.name == "gnome-update-script"))'
151151+152152+ to run update script for all packages matching given predicate, or
141153142154 % nix-shell maintainers/scripts/update.nix --argstr path gnome3
143155
+3
maintainers/scripts/update.py
···3939 if temp_dir is not None:
4040 worktree, _branch = temp_dir
41414242+ # Ensure the worktree is clean before update.
4343+ await check_subprocess('git', 'reset', '--hard', '--quiet', 'HEAD', cwd=worktree)
4444+4245 # Update scripts can use $(dirname $0) to get their location but we want to run
4346 # their clones in the git worktree, not in the main nixpkgs repo.
4447 update_script_command = map(lambda arg: re.sub(r'^{0}'.format(re.escape(nixpkgs_root)), worktree, arg), update_script_command)
+1-1
nixos/doc/manual/release-notes/rl-2105.xml
···2727 <para>The default Linux kernel was updated to the 5.10 LTS series, coming from the 5.4 LTS series.</para>
2828 </listitem>
2929 <listitem>
3030- <para>GNOME desktop environment was upgraded to 3.38, see its <link xlink:href="https://help.gnome.org/misc/release-notes/3.38/">release notes</link>.</para>
3030+ <para>GNOME desktop environment was upgraded to 40, see the release notes for <link xlink:href="https://help.gnome.org/misc/release-notes/40.0/">40.0</link> and <link xlink:href="https://help.gnome.org/misc/release-notes/3.38/">3.38</link>.</para>
3131 </listitem>
3232 <listitem>
3333 <para>
···33import json
44import requests
55import sys
66+from libversion import Version
77+from typing import Optional
6879810def version_to_list(version):
911 return list(map(int, version.split(".")))
101211131212-def odd_unstable(version_str, selected):
1313- version = version_to_list(version_str)
1414+def odd_unstable(version: Version, selected):
1515+ try:
1616+ version = version_to_list(version.value)
1717+ except:
1818+ # Failing to parse as a list of numbers likely means the version contains a string tag like “beta”, therefore it is not a stable release.
1919+ return selected != "stable"
2020+1421 if len(version) < 2:
1522 return True
1623···2330 return True
243125322626-def no_policy(version, selected):
3333+def tagged(version: Version, selected):
3434+ if selected == "stable":
3535+ return not ("alpha" in version.value or "beta" in version.value or "rc" in version.value)
3636+ else:
3737+ return True
3838+3939+4040+def no_policy(version: Version, selected):
2741 return True
284229433044version_policies = {
3145 "odd-unstable": odd_unstable,
4646+ "tagged": tagged,
3247 "none": no_policy,
3348}
344935503636-def make_version_policy(version_predicate, selected, upper_bound):
5151+def make_version_policy(version_predicate, selected, upper_bound: Optional[Version]):
3752 if not upper_bound:
3838- upper_bound = [math.inf, math.inf]
5353+ return lambda version: version_predicate(version, selected)
3954 else:
4040- upper_bound = version_to_list(upper_bound)
4141-4242- return lambda version: version_predicate(version, selected) and version_to_list(version) < upper_bound
5555+ return lambda version: version_predicate(version, selected) and version < upper_bound
435644574558parser = argparse.ArgumentParser(description="Find latest version for a GNOME package by crawling their release server.")
4659parser.add_argument("package-name", help="Name of the directory in https://ftp.gnome.org/pub/GNOME/sources/ containing the package.")
4747-parser.add_argument("version-policy", help="Policy determining which versions are considered stable. For most GNOME packages, odd minor versions are unstable but there are exceptions.", choices=version_policies.keys(), nargs="?", default="odd-unstable")
6060+parser.add_argument("version-policy", help="Policy determining which versions are considered stable. GNOME packages usually denote stability by alpha/beta/rc tag in the version. For older packages, odd minor versions are unstable but there are exceptions.", choices=version_policies.keys(), nargs="?", default="tagged")
4861parser.add_argument("requested-release", help="Most of the time, we will want to update to stable version but sometimes it is useful to test.", choices=["stable", "unstable"], nargs="?", default="stable")
4962parser.add_argument("--upper-bound", dest="upper-bound", help="Only look for versions older than this one (useful for pinning dependencies).")
5063···5568 package_name = getattr(args, "package-name")
5669 requested_release = getattr(args, "requested-release")
5770 upper_bound = getattr(args, "upper-bound")
7171+ if upper_bound:
7272+ upper_bound = Version(upper_bound)
5873 version_predicate = version_policies[getattr(args, "version-policy")]
5974 version_policy = make_version_policy(version_predicate, requested_release, upper_bound)
6075···6479 print("Unknown format of cache.json file.", file=sys.stderr)
6580 sys.exit(1)
66816767- versions = cache[2][package_name]
6868- versions = sorted(filter(version_policy, versions), key=version_to_list)
8282+ versions = map(Version, cache[2][package_name])
8383+ versions = sorted(filter(version_policy, versions))
69847085 if len(versions) == 0:
7186 print("No versions matched.", file=sys.stderr)
7287 sys.exit(1)
73887474- print(versions[-1])
8989+ print(versions[-1].value)
···4040 def _get_option_parser():
4141 parser = optparse.OptionParser('%prog [options] sources',
4242 version='%prog ' + giscanner.__version__)
4343-@@ -205,6 +238,10 @@ match the namespace prefix.""")
4343+@@ -214,6 +247,10 @@ match the namespace prefix.""")
4444 parser.add_option("", "--filelist",
4545 action="store", dest="filelist", default=[],
4646 help="file containing headers and sources to be scanned")
···6666 # This is a what we do for non-la files. We assume that we are on an
6767 # ELF-like system where ldd exists and the soname extracted with ldd is
6868 # a filename that can be opened with dlopen().
6969-@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries):
6969+@@ -108,7 +114,8 @@ def _resolve_non_libtool(options, binary, libraries):
7070 output = output.decode("utf-8", "replace")
71717272 shlibs = resolve_from_ldd_output(libraries, output)
···767677777878 def sanitize_shlib_path(lib):
7979-@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib):
7979+@@ -117,19 +124,18 @@ def sanitize_shlib_path(lib):
8080 # In case we get relative paths on macOS (like @rpath) then we fall
8181 # back to the basename as well:
8282 # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
···101101 if len(patterns) == 0:
102102 return []
103103104104-@@ -139,8 +145,11 @@ def resolve_from_ldd_output(libraries, output):
104104+@@ -141,8 +147,11 @@ def resolve_from_ldd_output(libraries, output):
105105 if line.endswith(':'):
106106 continue
107107 for word in line.split():
···117117 shlibs.append(m.group())
118118--- a/giscanner/utils.py
119119+++ b/giscanner/utils.py
120120-@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file):
120120+@@ -113,16 +113,11 @@ def extract_libtool_shlib(la_file):
121121 if dlname is None:
122122 return None
123123···129129- if libdir is None:
130130- return dlbasename
131131- return libdir + '/' + dlbasename
132132-- # From the comments in extract_libtool(), older libtools had
133133-- # a path rather than the raw dlname
132132+- # Older libtools had a path rather than the raw dlname
134133- return os.path.basename(dlname)
135134+ dlbasename = os.path.basename(dlname)
136135+ libdir = _extract_libdir_field(la_file)
···139138+ return libdir + '/' + dlbasename
140139141140142142- def extract_libtool(la_file):
141141+ # Returns arguments for invoking libtool, if applicable, otherwise None
143142--- a/tests/scanner/test_shlibs.py
144143+++ b/tests/scanner/test_shlibs.py
145144@@ -7,6 +7,30 @@ from giscanner.shlibs import resolve_from_ldd_output, sanitize_shlib_path
···32323333 buildInputs = [
3434 glib
3535- gsettings-desktop-schemas
3535+ gsettings-desktop-schemas # settings exposed by settings portal
3636 gtk3
3737 gnome3.gnome-desktop
3838- gnome3.gnome-settings-daemon # schemas needed for settings api (fonts, etc)
3838+ gnome3.gnome-settings-daemon # schemas needed for settings api (mostly useless now that fonts were moved to g-d-s)
3939 ];
40404141 meta = with lib; {