Commit Graph

30 Commits

Author SHA1 Message Date
Alyssa Ross
f97de6d7cd wrapGAppsHook: don't clobber XDG_DATA_DIRS default
The wrapper is supposed to transparently add things to XDG_DATA_DIRS,
not to take things out of it.  But because XDG_DATA_DIRS has an
implicit default if unset, and the wrapper set XDG_DATA_DIRS without
preserving that default value if it was unset outside the wrapper,
that's what it was doing in practice.

I've tested that these default paths are not accidentally added if
XDG_DATA_DIRS is set outside the wrapper, and that the other
directories we want to add to XDG_DATA_DIRS are correctly included in
both cases.
2026-07-30 20:55:32 +02:00
Stefan Frijters
5767290bcd wrapGAppsHook: add tests for multiple outputs 2026-06-15 18:52:51 +02:00
Stefan Frijters
e858e80fb1 wrapGAppsHook: only wrap $outBin by default 2026-06-15 18:52:51 +02:00
Stefan Frijters
e64ef4b137 wrapGAppsHook: make more bash variables local 2026-06-09 10:09:11 +02:00
nixpkgs-ci[bot]
f50dc660d4 Merge staging-next into staging 2026-05-28 18:54:19 +00:00
Eman Resu
a070adc9c8 setup-hooks/wrap-gapps-hook: remove assertMsg usage 2026-05-26 14:15:03 -04:00
nixpkgs-ci[bot]
13e9f64a65 Merge staging-next into staging 2026-05-25 18:35:07 +00:00
Sigmanificient
0bbc8dffae treewide: set meta.license on hooks 2026-05-25 13:48:20 +02:00
Stefan Frijters
a0ee897044 wrapGAppsHook: prepare for structuredAttrs
This hook is called in the fixupPhase via

```
local output
for output in $(getAllOutputNames); do
  prefix="${!output}" runHook fixupOutput
done
```

Without `__structuredAttrs`, `getAllOutputNames` returns the `output` array, in order.
However, with `__structuredAttrs`, it returns the keys of the `output` associative array,
which are no longer necessarily ordered in the same way.

In the case of some packages (e.g. `mate-panel-with-applets`) this means that instead of
`[ "out" "man" ]`, we process `[ "man" "out" ]`. Running the hook for `"man"` then sets
`wrapGAppsHookHasRun` and no wrapping is done for `"out"`, which is what was really needed.

Instead, keep track of whether the hook has run on a per-output basis. That way, the order
does not matter and any executables that are spread around multiple outputs are wrapped.
2026-05-18 15:34:13 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Alyssa Ross
160c79845e wrapGAppsNoGuiHook: only use dconf if available
Better have as much as possible working than an eval failure.
2025-02-11 01:30:34 +01:00
GGG
5999408249 wrapGAppsHook: fix issues with set -u 2025-01-04 16:10:32 -03:00
Yueh-Shun Li
9e4756b686 wrapGAppsHook: append *Phases with appendToVar 2024-12-17 01:46:04 +08:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Jan Tojnar
eb04659fc2 treewide: wrapGAppsHook → wrapGAppsHook3
This was achieved using the following command:

    sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')

And then manually reverted the following changes:

- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
2024-04-27 02:23:22 +02:00
Jan Tojnar
70cf3ecaae wrapGAppsHook: Flip inheritance relationship with wrapGAppsNoGuiHook 2024-04-27 00:05:46 +02:00
Artturin
2c471e6479 wrapGAppsHook: add gtk3 to depsTargetTargetPropagated
for typelibs and girs
2023-02-17 21:38:20 +02:00
Artturin
2168611677 wrapGAppsHook: run tests with strictDeps
'nix build -f . "wrapGAppsHook.tests"' pass
2023-02-17 21:34:59 +02:00
Artturin
c4e7fb1036 wrapGAppsHook: move dconf.lib to depsTargetTargetPropagated
luckily the lib output does not contain binaries therefore its safe to
remove it from propagatedBuildInputs
2023-02-17 21:32:48 +02:00
Artturin
8be7ab60b1 wrapGAppsHook: make it work with strictDeps
remove unused input

add test for GDK_PIXBUF_MODULE_FILE

run tests with strictDeps

if the tests work with strictDeps then they work with non strictDeps
2023-02-07 21:00:18 +02:00
Robert Hensing
c078d552fe wrapGAppsHook: Set name
The previous commit, removing substitutions, causes a mass rebuild,
so we use the opportunity to set the name; also a mass rebuild.
2022-08-13 11:53:06 +02:00
Robert Hensing
4dc28e0057 setup hooks: substitutions.passthru -> passthru 2022-08-13 10:29:10 +02:00
Naïm Favier
81b9c712ce wrapGAppsHook: rename argument to makeWrapper
...and pass it makeBinaryWrapper in all-packages.nix
2022-05-10 22:07:56 +02:00
Naïm Favier
532ebf6b57 wrapGAppsHook: use makeBinaryWrapper
Reduces the likelihood of having apps wrapped twice by a shell script,
which causes problems with argv0.
2022-04-26 12:14:39 +02:00
Ilya Fedin
b1e73fa2e0 nixos/wrap-gapps-hook: don't add data directories of icon dependencies into XDG_DATA_DIRS
As discussed in https://github.com/NixOS/nixpkgs/issues/163590, it's not really required and has a side effect of adding refeferences to packages from nativeBuildInputs that aren't really required
2022-03-11 00:58:26 +04:00
Jan Tojnar
acfc45bacc wrapGAppsNoGuiHook: init 2020-11-26 14:06:07 +01:00
Jan Tojnar
0be3b18d3e wrapGAppsHook: add comments 2020-07-24 00:36:12 +02:00
Jan Tojnar
49b89afcc2 wrapGAppsHook: add tests 2020-07-24 00:36:04 +02:00
Jan Tojnar
69b89979ba wrapGAppsHook: move to a separate file 2020-07-23 22:08:18 +02:00