Skip to content

Commit

Permalink
🐛 Fix build on nix darwin (#170)
Browse files Browse the repository at this point in the history
- somehow a regex expression was invalid
- get rid of `xvfb-run` to run test and use `offscreen` qt platform
  • Loading branch information
OlivierLDff authored Jan 4, 2025
1 parent 48dbe50 commit 1a663d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 7 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
qolm = {
url = "github:olivierldff/qolm/v3.2.2";
url = "github:olivierldff/qolm/v3.2.3";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.nix-filter.follows = "nix-filter";
Expand All @@ -38,7 +38,7 @@
];
};

nixglhost = nix-gl-host.packages.${system}.default;
nixglhost = if pkgs.stdenv.isLinux then nix-gl-host.packages.${system}.default else null;

nativeBuildInputs = with pkgs; [
qt6.wrapQtAppsHook
Expand Down Expand Up @@ -66,11 +66,6 @@
++ buildInputsFontRobotoMono
++ buildInputsFontLato;

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
Expand Down Expand Up @@ -104,7 +99,7 @@
];

qaterial = with pkgs; stdenv.mkDerivation rec {
inherit version nativeBuildInputs buildInputs nativeCheckInputs;
inherit version nativeBuildInputs buildInputs;
inherit CPM_USE_LOCAL_PACKAGES;
propagatedBuildInputs = buildInputs;

Expand Down Expand Up @@ -161,9 +156,8 @@
echo "Run shell hook"
${shellHook}
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
ctest -C "${cmakeConfigType}" --output-on-failure --verbose
'';

installPhase = ''
Expand All @@ -188,9 +182,8 @@
echo "Run shell hook"
${shellHook}
xvfb-run dbus-run-session \
--config-file=${pkgs.dbus}/share/dbus-1/session.conf \
find_package_build/QaterialFindPackageTest
export QT_QPA_PLATFORM=offscreen
find_package_build/QaterialFindPackageTest
'';
};

Expand All @@ -211,7 +204,6 @@
gh
];
fullDevBuildInputs = with pkgs; nativeBuildInputs
++ nativeCheckInputs
++ minimalDevBuildInputs
++ [
sccache
Expand All @@ -238,7 +230,6 @@
inherit CPM_USE_LOCAL_PACKAGES;

nativeBuildInputs = nativeBuildInputs
++ nativeCheckInputs
++ minimalDevBuildInputs;
};

Expand Down
3 changes: 1 addition & 2 deletions nix/get-pkg-source-from-cmake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ let
pkg_url = elemAt parse_repo 0;
pkg_hash = elemAt parse_tag 0;
pkg_rev = elemAt parse_tag 1;
parse_url = match ".*github\\.com/([[:alpha:]]+)/([a-zA-Z\\.0-9-]+?)(/.*|$)"
pkg_url;
parse_url = match ".*github\\.com/([a-zA-Z]+)/([a-zA-Z\\.0-9-]+)(/.*|$)" pkg_url;

pkg_owner = elemAt parse_url 0;
pkg_name_with_potential_extensions = elemAt parse_url 1;
Expand Down

0 comments on commit 1a663d9

Please sign in to comment.