From 3ea10f99b7cb0c6fa7ab56f082030c7cfea97ae2 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 6 Nov 2024 20:39:41 +0800 Subject: [PATCH] libsForQt5.pix: fix build --- pkgs/applications/maui/pix.nix | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/maui/pix.nix b/pkgs/applications/maui/pix.nix index c84f6f56d709..de57aaedbccf 100644 --- a/pkgs/applications/maui/pix.nix +++ b/pkgs/applications/maui/pix.nix @@ -17,8 +17,17 @@ qtlocation, exiv2, kquickimageedit, + fetchFromGitHub, }: +let + src-kdtree = fetchFromGitHub { + owner = "cdalitz"; + repo = "kdtree-cpp"; + rev = "refs/tags/v1.3"; + hash = "sha256-h3cmndvjMlp/MTk/Ve3R183BLrE7VbL7GQx8YkOHEgU="; + }; +in mkDerivation { pname = "pix"; @@ -27,6 +36,18 @@ mkDerivation { extra-cmake-modules ]; + postPatch = '' + cp ${src-kdtree}/kdtree.cpp src/ + substituteInPlace src/CMakeLists.txt \ + --replace-fail "main.cpp" "main.cpp kdtree.cpp" + ''; + + env = { + NIX_CFLAGS_COMPILE = toString [ + "-I${src-kdtree}" + ]; + }; + buildInputs = [ applet-window-buttons karchive @@ -44,11 +65,11 @@ mkDerivation { kquickimageedit ]; - meta = with lib; { + meta = { description = "Image gallery application"; mainProgram = "pix"; homepage = "https://invent.kde.org/maui/pix"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ onny ]; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ onny ]; }; }