Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Oct 19, 2024
2 parents 8944626 + f7db416 commit 2ab7280
Show file tree
Hide file tree
Showing 66 changed files with 2,873 additions and 9,617 deletions.
10 changes: 6 additions & 4 deletions doc/languages-frameworks/gnome.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ There are no schemas available in `XDG_DATA_DIRS`. Temporarily add a random pack

Package is missing some GSettings schemas. You can find out the package containing the schema with `nix-locate org.gnome.foo.gschema.xml` and let the hooks handle the wrapping as [above](#ssec-gnome-common-issues-no-schemas).

### When using `wrapGApps*` hook with special derivers you can end up with double wrapped binaries. {#ssec-gnome-common-issues-double-wrapped}
### When using `wrapGApps*` hook with special derivers or hooks you can end up with double wrapped binaries. {#ssec-gnome-common-issues-double-wrapped}

This is because derivers like `python.pkgs.buildPythonApplication` or `qt5.mkDerivation` have setup-hooks automatically added that produce wrappers with makeWrapper. The simplest way to workaround that is to disable the `wrapGApps*` hook automatic wrapping with `dontWrapGApps = true;` and pass the arguments it intended to pass to makeWrapper to another.
This is because some setup hooks like `qt6.wrapQtAppsHook` also wrap programs using `makeWrapper`. Likewise, some derivers (e.g. `python.pkgs.buildPythonApplication`) automatically pull in their own setup hooks that produce wrappers.

The simplest workaround is to disable the `wrapGApps*` hook's automatic wrapping using `dontWrapGApps = true;` while passing its `makeWrapper` arguments to another wrapper.

In the case of a Python application it could look like:

Expand All @@ -184,19 +186,19 @@ python3.pkgs.buildPythonApplication {
And for a QT app like:

```nix
mkDerivation {
stdenv.mkDerivation {
pname = "calibre";
version = "3.47.0";
nativeBuildInputs = [
wrapGAppsHook3
qt6.wrapQtAppsHook
qmake
# ...
];
dontWrapGApps = true;
# Arguments to be passed to `makeWrapper`, only used by qt5’s mkDerivation
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
Expand Down
12 changes: 12 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2328,6 +2328,12 @@
githubId = 18467667;
name = "Alexander Bantyev";
};
balssh = {
email = "[email protected]";
github = "balssh";
githubId = 82440615;
name = "George Bals";
};
bananad3v = {
email = "[email protected]";
github = "BANanaD3V";
Expand Down Expand Up @@ -16187,6 +16193,12 @@
githubId = 10776658;
name = "Patrick Gordon";
};
paepcke = {
email = "[email protected]";
github = "paepckehh";
githubId = 120342602;
name = "Michael Paepcke";
};
paholg = {
email = "[email protected]";
github = "paholg";
Expand Down
1 change: 0 additions & 1 deletion nixos/modules/services/monitoring/netdata.nix
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ in {
ps.psycopg2
ps.python-ldap
ps.netdata-pandas
ps.changefinder
]);

services.netdata.configDir.".opt-out-from-anonymous-statistics" = mkIf (!cfg.enableAnalyticsReporting) (pkgs.writeText ".opt-out-from-anonymous-statistics" "");
Expand Down
68 changes: 28 additions & 40 deletions nixos/tests/keymap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ let

testReader = pkgs.writeScript "test-input-reader" ''
rm -f ${resultFile} ${resultFile}.tmp
logger "testReader: START: Waiting for $1 characters, expecting '$2'."
logger "testReader: START: expecting '$1'."
touch ${readyFile}
read -r -N $1 chars
read -r -N ''${#1} -t 60 chars
rm -f ${readyFile}
if [ "$chars" == "$2" ]; then
logger -s "testReader: PASS: Got '$2' as expected." 2>${resultFile}.tmp
if [ "$chars" == "$1" ]; then
logger -s "testReader: PASS: Got '$1' as expected." 2>${resultFile}.tmp
else
logger -s "testReader: FAIL: Expected '$2' but got '$chars'." 2>${resultFile}.tmp
logger -s "testReader: FAIL: Expected '$1' but got '$chars'." 2>${resultFile}.tmp
fi
# rename after the file is written to prevent a race condition
mv ${resultFile}.tmp ${resultFile}
Expand All @@ -39,39 +39,29 @@ let
import shlex
def run_test_case(cmd, xorg_keymap, test_case_name, inputs, expected):
with subtest(test_case_name):
assert len(inputs) == len(expected)
machine.execute("rm -f ${readyFile} ${resultFile}")
def run_test_case(cmd, inputs, expected):
assert len(inputs) == len(expected)
machine.execute("rm -f ${readyFile} ${resultFile}")
# set up process that expects all the keys to be entered
machine.succeed(
"{} {} {} {} >&2 &".format(
cmd,
"${testReader}",
len(inputs),
shlex.quote("".join(expected)),
)
# set up process that expects all the keys to be entered
machine.succeed(
"${pkgs.systemd}/bin/systemd-cat -t input-test-reader -- {} {} {} &".format(
cmd,
"${testReader}",
shlex.quote("".join(expected)),
)
)
if xorg_keymap:
# make sure the xterm window is open and has focus
machine.wait_for_window("testterm")
machine.wait_until_succeeds(
"${pkgs.xdotool}/bin/xdotool search --sync --onlyvisible "
"--class testterm windowfocus --sync"
)
# wait for reader to be ready
machine.wait_for_file("${readyFile}")
# wait for reader to be ready
machine.wait_for_file("${readyFile}")
# send all keys
for key in inputs:
machine.send_key(key)
# send all keys
for key in inputs:
machine.send_key(key)
# wait for result and check
machine.wait_for_file("${resultFile}")
machine.succeed("grep -q 'PASS:' ${resultFile}")
# wait for result and check
machine.wait_for_file("${resultFile}")
machine.succeed("grep -q 'PASS:' ${resultFile}")
with open("${pkgs.writeText "tests.json" (builtins.toJSON tests)}") as json_file:
Expand All @@ -87,19 +77,17 @@ let
# fighting over the virtual terminal. This does not appear to be a problem
# when the X test runs first.
keymap_environments = {
"Xorg Keymap": "DISPLAY=:0 xterm -title testterm -class testterm -fullscreen -e",
"VT Keymap": "openvt -sw --",
"Xorg Keymap": "env DISPLAY=:0 xterm -title testterm -class testterm -fullscreen -e",
"VT Keymap": "openvt -c 2 -sw --",
}
machine.wait_for_x()
for keymap_env_name, command in keymap_environments.items():
with subtest(keymap_env_name):
for test_case_name, test_data in tests.items():
for test_case_name, test_data in tests.items():
for keymap_env_name, command in keymap_environments.items():
with subtest(f"{test_case_name} - {keymap_env_name}"):
run_test_case(
command,
False,
test_case_name,
test_data["qwerty"],
test_data["expect"],
)
Expand Down
1 change: 0 additions & 1 deletion nixos/tests/teleport.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ with import ../lib/testing-python.nix { inherit system pkgs; };
let
packages = with pkgs; {
"default" = teleport;
"14" = teleport_14;
"15" = teleport_15;
};

Expand Down
Loading

0 comments on commit 2ab7280

Please sign in to comment.