Skip to content

wrapGAppsHook: don't add superfluous inputs#227825

Draft
alyssais wants to merge 2 commits intoNixOS:stagingfrom
alyssais:wrapGAppsHook
Draft

wrapGAppsHook: don't add superfluous inputs#227825
alyssais wants to merge 2 commits intoNixOS:stagingfrom
alyssais:wrapGAppsHook

Conversation

@alyssais
Copy link
Member

Description of changes

As noted in the comments, there's no reason for wrapGAppsHook to propagate gtk3 at all, or librsvg as a native build input. This also means we can get rid of wrapGAppsHook4, as it's now identical to wrapGAppsHook.

It's finally time to do this, because I noticed the extra gtk build input was breaking cross compilation of gcr_4.

Draft while I search for build regressions.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: pantheon The Pantheon desktop environment 6.topic: vim Advanced text editor 8.has: documentation This PR adds or changes documentation labels Apr 23, 2023
@alyssais alyssais marked this pull request as draft April 23, 2023 15:17
As noted in the comments, there's no reason for wrapGAppsHook to
propagate gtk3 at all, or librsvg as a native build input.  This also
means we can get rid of wrapGAppsHook4, as it's now identical to
wrapGAppsHook.

It's finally time to do this, because I noticed the extra gtk build
input was breaking cross compilation of gcr_4.
Since wrapGAppsHook no longer adds GTK dependencies, there's now no
difference between wrapGAppsHook4 and wrapGAppsHook.
@ofborg ofborg bot added 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Apr 23, 2023
Fortunately, 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.

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.
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 and `librsvg` into the closure.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, `gtk3` for GSettings schemas can be removed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably also release notes worthy, since it might break (especially external) packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, now I recall why we did not do it yet:

$ comm -23 <(rg wrapGAppsHook -l|sort) <(rg 'gtk(mm)?[234]' -l|sort)
doc/builders/special/fhs-environments.section.md
doc/contributing/contributing-to-documentation.chapter.md
nixos/modules/programs/sway.nix
nixos/modules/services/x11/display-managers/account-service-util.nix
nixos/tests/installed-tests/gnome-photos.nix
pkgs/applications/audio/mopidy/mopidy.nix
pkgs/applications/audio/muso/default.nix
pkgs/applications/backup/timeshift/wrapper.nix
pkgs/applications/editors/bluefish/default.nix
pkgs/applications/editors/bluej/default.nix
pkgs/applications/editors/gnome-latex/default.nix
pkgs/applications/editors/kile/default.nix
pkgs/applications/editors/mindforger/default.nix
pkgs/applications/editors/setzer/default.nix
pkgs/applications/editors/texmaker/default.nix
pkgs/applications/editors/vim/plugins/overrides.nix
pkgs/applications/editors/vscode/generic.nix
pkgs/applications/file-managers/krusader/default.nix
pkgs/applications/finance/cryptowatch/default.nix
pkgs/applications/gis/grass/default.nix
pkgs/applications/gis/qgis/unwrapped-ltr.nix
pkgs/applications/gis/qgis/unwrapped.nix
pkgs/applications/graphics/ciano/default.nix
pkgs/applications/graphics/cloudcompare/default.nix
pkgs/applications/graphics/digikam/default.nix
pkgs/applications/graphics/freecad/default.nix
pkgs/applications/graphics/gscan2pdf/default.nix
pkgs/applications/graphics/hugin/default.nix
pkgs/applications/graphics/imagej/default.nix
pkgs/applications/graphics/kgraphviewer/default.nix
pkgs/applications/graphics/kphotoalbum/default.nix
pkgs/applications/graphics/processing/default.nix
pkgs/applications/graphics/tev/default.nix
pkgs/applications/kde/audiotube.nix
pkgs/applications/kde/kasts.nix
pkgs/applications/kde/kdenlive/default.nix
pkgs/applications/kde/plasmatube/default.nix
pkgs/applications/kde/spectacle.nix
pkgs/applications/misc/barrier/default.nix
pkgs/applications/misc/calibre/default.nix
pkgs/applications/misc/fbmenugen/default.nix
pkgs/applications/misc/feedbackd/default.nix
pkgs/applications/misc/gcstar/default.nix
pkgs/applications/misc/genxword/default.nix
pkgs/applications/misc/holochain-launcher/default.nix
pkgs/applications/misc/keepassxc/default.nix
pkgs/applications/misc/keystore-explorer/default.nix
pkgs/applications/misc/krename/default.nix
pkgs/applications/misc/mako/default.nix
pkgs/applications/misc/maliit-keyboard/default.nix
pkgs/applications/misc/openlp/default.nix
pkgs/applications/misc/pattypan/default.nix
pkgs/applications/misc/pdfsam-basic/default.nix
pkgs/applications/misc/playonlinux/default.nix
pkgs/applications/misc/printrun/default.nix
pkgs/applications/misc/rofi-top/default.nix
pkgs/applications/misc/rofi/wrapper.nix
pkgs/applications/misc/simplenote/default.nix
pkgs/applications/misc/slic3r/default.nix
pkgs/applications/misc/survex/default.nix
pkgs/applications/misc/swappy/default.nix
pkgs/applications/misc/veracrypt/default.nix
pkgs/applications/misc/xdgmenumaker/default.nix
pkgs/applications/misc/xneur/default.nix
pkgs/applications/misc/zathura/core/default.nix
pkgs/applications/networking/browsers/badwolf/default.nix
pkgs/applications/networking/browsers/qutebrowser/default.nix
pkgs/applications/networking/browsers/surf/default.nix
pkgs/applications/networking/clash-verge/default.nix
pkgs/applications/networking/cluster/lens/linux.nix
pkgs/applications/networking/cluster/openlens/default.nix
pkgs/applications/networking/feedreaders/rssguard/default.nix
pkgs/applications/networking/instant-messengers/alfaview/default.nix
pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix
pkgs/applications/networking/instant-messengers/flare-signal/default.nix
pkgs/applications/networking/instant-messengers/wire-desktop/default.nix
pkgs/applications/networking/sniffers/wireshark/default.nix
pkgs/applications/networking/termius/default.nix
pkgs/applications/office/beamerpresenter/default.nix
pkgs/applications/office/gnucash/default.nix
pkgs/applications/office/grisbi/default.nix
pkgs/applications/office/homebank/default.nix
pkgs/applications/office/timeline/default.nix
pkgs/applications/office/treesheets/default.nix
pkgs/applications/office/trilium/desktop.nix
pkgs/applications/office/wpsoffice/default.nix
pkgs/applications/radio/chirp/default.nix
pkgs/applications/radio/gnuradio/wrapper.nix
pkgs/applications/radio/gqrx/default.nix
pkgs/applications/science/astronomy/stellarium/default.nix
pkgs/applications/science/electronics/qucs-s/default.nix
pkgs/applications/science/math/rofi-calc/default.nix
pkgs/applications/science/math/wxmaxima/default.nix
pkgs/applications/terminal-emulators/germinal/default.nix
pkgs/applications/terminal-emulators/tilix/default.nix
pkgs/applications/version-management/github-desktop/default.nix
pkgs/applications/video/aegisub/default.nix
pkgs/applications/video/hypnotix/default.nix
pkgs/applications/video/jellyfin-mpv-shim/default.nix
pkgs/applications/video/obs-studio/default.nix
pkgs/applications/video/plex-mpv-shim/default.nix
pkgs/applications/video/rtabmap/default.nix
pkgs/applications/video/vlc/default.nix
pkgs/applications/virtualization/quickgui/default.nix
pkgs/applications/virtualization/virt-manager/default.nix
pkgs/build-support/setup-hooks/wrap-gapps-hook/wrap-gapps-hook.sh
pkgs/desktops/cinnamon/cinnamon-menus/default.nix
pkgs/desktops/deepin/core/dde-control-center/default.nix
pkgs/desktops/deepin/core/dde-dock/default.nix
pkgs/desktops/deepin/core/dde-file-manager/default.nix
pkgs/desktops/deepin/core/dde-launcher/default.nix
pkgs/desktops/deepin/core/dde-session-shell/default.nix
pkgs/desktops/enlightenment/rage/default.nix
pkgs/desktops/gnome/core/gnome-keyring/default.nix
pkgs/desktops/gnome/core/gnome-online-miners/default.nix
pkgs/desktops/gnome/core/gnome-remote-desktop/default.nix
pkgs/desktops/gnome/core/gnome-session/ctl.nix
pkgs/desktops/gnome/core/gnome-user-share/default.nix
pkgs/desktops/gnome/extensions/extensionOverrides.nix
pkgs/desktops/lumina/lumina/default.nix
pkgs/desktops/mate/mate-settings-daemon/wrapped.nix
pkgs/desktops/mate/mate-terminal/default.nix
pkgs/desktops/mate/pluma/default.nix
pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
pkgs/desktops/pantheon/services/contractor/default.nix
pkgs/desktops/plasma-5/kde-gtk-config/0001-gsettings-schemas-path.patch
pkgs/desktops/xfce/mkXfceDerivation.nix
pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix
pkgs/development/interpreters/gnudatalanguage/default.nix
pkgs/development/libraries/at-spi2-core/default.nix
pkgs/development/libraries/bamf/default.nix
pkgs/development/libraries/geoclue/default.nix
pkgs/development/libraries/gstreamer/viperfx/default.nix
pkgs/development/libraries/gvfs/default.nix
pkgs/development/libraries/kde-frameworks/kded.nix
pkgs/development/libraries/xdg-desktop-portal/default.nix
pkgs/development/python-modules/mat2/default.nix
pkgs/development/tools/click/default.nix
pkgs/development/tools/database/sqlitebrowser/default.nix
pkgs/development/tools/scenebuilder/default.nix
pkgs/development/tools/vala-lint/default.nix
pkgs/development/web/cog/default.nix
pkgs/games/vassal/default.nix
pkgs/os-specific/linux/firmware/fwupd/default.nix
pkgs/os-specific/linux/tiscamera/default.nix
pkgs/servers/gpsd/default.nix
pkgs/servers/pulseaudio/default.nix
pkgs/servers/rpiplay/default.nix
pkgs/servers/uxplay/default.nix
pkgs/tools/audio/mpdris2/default.nix
pkgs/tools/bluetooth/blueberry/default.nix
pkgs/tools/graphics/agi/default.nix
pkgs/tools/graphics/gromit-mpx/default.nix
pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
pkgs/tools/misc/archi/default.nix
pkgs/tools/misc/hakuneko/default.nix
pkgs/tools/misc/kronometer/default.nix
pkgs/tools/misc/partition-manager/default.nix
pkgs/tools/misc/peruse/default.nix
pkgs/tools/misc/qflipper/default.nix
pkgs/tools/misc/rmlint/default.nix
pkgs/tools/misc/system-config-printer/default.nix
pkgs/tools/misc/woeusb-ng/default.nix
pkgs/tools/networking/connman/connman-notify/default.nix
pkgs/tools/networking/openvpn3/default.nix
pkgs/tools/security/cryptomator/default.nix
pkgs/tools/system/cm-rgb/default.nix
pkgs/tools/text/kdiff3/default.nix

gobject-introspection
wrapGAppsHook4
wrapGAppsHook
] ++ lib.optional stdenv.isDarwin gtk4; # for gtk4-update-icon-cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be made unconditional.

@uninsane
Copy link
Contributor

any way i can help this effort? if we renamed wrapGAppsHook -> wrapGAppsHook3 and introduced a flavorless wrapGAppsHook, the work to move wrapGAppsHook{3,4} users to the flavorless version could be more distributed. i'd happily port all the packages i deploy to my own machines.

or maybe i should just whittle down Jan's list above by adding gtk3/gtk4 as appropriate?

@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: pantheon The Pantheon desktop environment 6.topic: vim Advanced text editor 8.has: clean-up This PR removes packages or removes other cruft 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants