From c0b17c9ddaad172eeb9d01ef6495f57d06116c8c Mon Sep 17 00:00:00 2001 From: Olivier LDff Date: Sat, 4 Jan 2025 18:01:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Support=20nix-darwin=20by=20remo?= =?UTF-8?q?ving=20`xvfb-run`=20deps=20and=20finally=20run=20`ctest`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .envrc | 1 + .gitignore | 1 + flake.nix | 17 ++++------------- 3 files changed, 6 insertions(+), 13 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index d42e4dc..38da85f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ # nix result* +.direnv diff --git a/flake.nix b/flake.nix index 589e763..90b8ac2 100644 --- a/flake.nix +++ b/flake.nix @@ -44,11 +44,6 @@ buildInputs = buildInputsQt; - nativeCheckInputs = with pkgs; [ - dbus - xvfb-run - ]; - shellHook = '' # Crazy shell hook to set up Qt environment, from: # https://discourse.nixos.org/t/python-qt-woes/11808/12 @@ -68,7 +63,7 @@ packages = { qolm = with pkgs; stdenv.mkDerivation rec { - inherit version nativeBuildInputs buildInputs nativeCheckInputs; + inherit version nativeBuildInputs buildInputs; inherit CPM_USE_LOCAL_PACKAGES; pname = "qolm"; @@ -118,11 +113,9 @@ echo "Run shell hook" ${shellHook} - # This used to work with Qt5, but not with Qt6...? - # More investigation needed - # xvfb-run dbus-run-session \ - # --config-file=${pkgs.dbus}/share/dbus-1/session.conf \ - # ctest -C "${cmakeConfigType}" --output-on-failure --verbose + export QT_QPA_PLATFORM=offscreen + echo "Run tests" + ctest -C "${cmakeConfigType}" --output-on-failure --verbose ''; installPhase = '' @@ -142,7 +135,6 @@ gh ]; fullDevBuildInputs = with pkgs; nativeBuildInputs - ++ nativeCheckInputs ++ minimalDevBuildInputs ++ [ sccache @@ -169,7 +161,6 @@ inherit CPM_USE_LOCAL_PACKAGES; nativeBuildInputs = nativeBuildInputs - ++ nativeCheckInputs ++ minimalDevBuildInputs; };