Skip to content

Commit

Permalink
#2912 nix: disable xvfb-run for macOS
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Dec 9, 2024
1 parent 57625a8 commit 1c593a4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
3 changes: 1 addition & 2 deletions build-systems/nix/default-cmake-qt5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ stdenv.mkDerivation {
wrapQtAppsHook
pkg-config
installShellFiles
xvfb-run
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
] ++ lib.optionals stdenv.isLinux [ xvfb-run ] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];

buildInputs = [
qtbase
Expand Down
18 changes: 9 additions & 9 deletions build-systems/nix/default-qmake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ stdenv.mkDerivation {
wrapQtAppsHook
pkg-config
installShellFiles
xvfb-run
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
] ++ lib.optionals stdenv.isLinux [ xvfb-run ] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];

buildInputs = [
qtbase
Expand All @@ -48,13 +47,14 @@ stdenv.mkDerivation {
"USE_SYSTEM_BOTAN=1"
];

postInstall = ''
installShellCompletion --cmd ${appname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
installShellCompletion --cmd ${pname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
# Install shell completion on Linux (there is no xvfb-run on macOS)
postInstall = lib.optionalString stdenv.isLinux ''
installShellCompletion --cmd ${appname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
installShellCompletion --cmd ${pname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
''
# Create a lowercase symlink for Linux
+ lib.optionalString stdenv.isLinux ''
Expand Down
2 changes: 1 addition & 1 deletion build-systems/nix/default-qt5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ stdenv.mkDerivation {
pkg-config
installShellFiles
xvfb-run
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
] ++ lib.optionals stdenv.isLinux [ xvfb-run ] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];

buildInputs = [
qtbase
Expand Down
18 changes: 9 additions & 9 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ stdenv.mkDerivation {
wrapQtAppsHook
pkg-config
installShellFiles
xvfb-run
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
] ++ lib.optionals stdenv.isLinux [ xvfb-run ] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];

buildInputs = [
qtbase
Expand All @@ -49,13 +48,14 @@ stdenv.mkDerivation {
"-DBUILD_WITH_SYSTEM_BOTAN=ON"
];

postInstall = ''
installShellCompletion --cmd ${appname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
installShellCompletion --cmd ${pname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
# Install shell completion on Linux (there is no xvfb-run on macOS)
postInstall = lib.optionalString stdenv.isLinux ''
installShellCompletion --cmd ${appname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
installShellCompletion --cmd ${pname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
''
# Create a lowercase symlink for Linux
+ lib.optionalString stdenv.isLinux ''
Expand Down

0 comments on commit 1c593a4

Please sign in to comment.