Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkgs/by-name/he/headlessDisplayHook/headless-display-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
appendToVar prePhases setupHeadlessDisplay

setupHeadlessDisplay() {
export FONTCONFIG_FILE=@fontconfig_file@
export XDG_RUNTIME_DIR=$(mktemp -d)
export XDG_CACHE_HOME=$(mktemp -d)
export LD_LIBRARY_PATH="@ld_library_path@:${LD_LIBRARY_PATH:-}"
Xvfb :99 -screen 0 800x600x24 >/dev/null 2>&1 &
export DISPLAY=:99
}
23 changes: 23 additions & 0 deletions pkgs/by-name/he/headlessDisplayHook/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
lib,
stdenv,
makeSetupHook,
xvfb,
makeFontsConf,
dejavu_fonts,
mesa,
}:
if stdenv.hostPlatform.isLinux then
makeSetupHook {
name = "headlessDisplayHook";
propagatedBuildInputs = [
xvfb
mesa.llvmpipeHook
];
substitutions = {
fontconfig_file = makeFontsConf { fontDirectories = [ dejavu_fonts ]; };
ld_library_path = lib.makeLibraryPath [ mesa ];
};
} ./headless-display-hook.sh
else
null
8 changes: 3 additions & 5 deletions pkgs/desktops/lomiri/qml/lomiri-ui-toolkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
gdb,
glib,
lttng-ust,
mesa,
perl,
pkg-config,
python3,
Expand All @@ -27,7 +26,7 @@
suru-icon-theme,
validatePkgConfig,
wrapQtAppsHook,
xvfb-run,
headlessDisplayHook,
}:

let
Expand Down Expand Up @@ -148,8 +147,7 @@ stdenv.mkDerivation (finalAttrs: {
dbus-test-runner
dpkg # `dpkg-architecture -qDEB_HOST_ARCH` response decides how tests are run
gdb
mesa.llvmpipeHook # ShapeMaterial needs an OpenGL context: https://gitlab.com/ubports/development/core/lomiri-ui-toolkit/-/issues/35
xvfb-run
headlessDisplayHook
];

qmakeFlags = [
Expand Down Expand Up @@ -178,7 +176,7 @@ stdenv.mkDerivation (finalAttrs: {
export QT_PLUGIN_PATH=${qtPluginPaths}
export XDG_DATA_DIRS=${suru-icon-theme}/share

tests/xvfb.sh make check ''${enableParallelChecking:+-j''${NIX_BUILD_CORES}}
make check ''${enableParallelChecking:+-j''${NIX_BUILD_CORES}}

runHook postCheck
'';
Expand Down
Loading