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
41 changes: 41 additions & 0 deletions pkgs/by-name/fl/flameshot/0001-NixOS-dependency-injection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 8ca703efdb1129d97d27f78b0bbd1d21056a9501 Mon Sep 17 00:00:00 2001
From: hustlerone <nine-ball@tutanota.com>
Date: Thu, 10 Jul 2025 18:13:32 +0200
Subject: [PATCH] NixOS dependency injection

---
CMakeLists.txt | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8df544bc..62bccb8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,8 +48,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

FetchContent_Declare(
qtColorWidgets
- GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
- GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
+ SOURCE_DIR "${CMAKE_SOURCE_DIR}/tmp/qtColorWidgets"
)

#Workaround for duplicate GUID in windows WIX installer
@@ -129,12 +128,8 @@ if (USE_KDSINGLEAPPLICATION)
set(KDSingleApplication_EXAMPLES OFF CACHE BOOL "Don't build the examples")
set(KDSingleApplication_STATIC ON CACHE BOOL "Build static versions of the libraries")

- FetchContent_Declare(
- kdsingleApplication
- GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
- GIT_TAG v1.2.0
- )
- FetchContent_MakeAvailable(KDSingleApplication)
+ find_package(KDSingleApplication-qt6)
+ add_library(kdsingleapplication ALIAS KDAB::kdsingleapplication)
endif()

# ToDo: Check if this is used anywhere
--
2.49.0

53 changes: 36 additions & 17 deletions pkgs/by-name/fl/flameshot/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,79 @@
stdenv,
lib,
fetchFromGitHub,
fetchFromGitLab,
fetchpatch,
cmake,
git,
imagemagick,
libicns,
libsForQt5,
kdePackages,
kdsingleapplication,
grim,
makeBinaryWrapper,
nix-update-script,
enableWlrSupport ? false,
enableMonochromeIcon ? false,
}:
let
qtColorWidgets = fetchFromGitLab {
owner = "mattbas";
repo = "Qt-Color-Widgets";
rev = "352bc8f99bf2174d5724ee70623427aa31ddc26a";
hash = "sha256-Viwk2kXUfndvylvGUyrPgb+PecZYn6iRDR22tzlRbmY=";
};
in

assert stdenv.hostPlatform.isDarwin -> (!enableWlrSupport);

stdenv.mkDerivation {
pname = "flameshot";
# wlr screenshotting is currently only available on unstable version (>12.1.0)
version = "12.1.0-unstable-2025-05-04";
version = "12.1.0-unstable-2025-07-10";

src = fetchFromGitHub {
owner = "flameshot-org";
repo = "flameshot";
rev = "f4cde19c63473f8fadd448ad2056c22f0f847f34";
hash = "sha256-B/piB8hcZR11vnzvue/1eR+SFviTSGJoek1w4abqsek=";
rev = "32e97220427e4db86ad614acb3c905f303733091";
hash = "sha256-pMthhsIr7ZINVcv0BPID7sea1eXuQqOQvM4+BkIgte4=";

nativeBuildInputs = [
git
];

postFetch = ''
cd "$out"
mkdir tmp
cp -r "${qtColorWidgets}" tmp/qtColorWidgets
'';
};

patches = [
# https://github.com/flameshot-org/flameshot/pull/3166
# fixes fractional scaling calculations on wayland
(fetchpatch {
name = "10-fix-wayland.patch";
url = "https://github.com/flameshot-org/flameshot/commit/5fea9144501f7024344d6f29c480b000b2dcd5a6.patch";
hash = "sha256-SnjVbFMDKD070vR4vGYrwLw6scZAFaQA4b+MbI+0W9E=";
})
./0001-NixOS-dependency-injection.patch
];

cmakeFlags =
[
(lib.cmakeBool "DISABLE_UPDATE_CHECKER" true)
(lib.cmakeBool "USE_MONOCHROME_ICON" enableMonochromeIcon)
# I don't know what the hell these do
(lib.cmakeBool "USE_KDSINGLEAPPLICATION" false)
(lib.cmakeBool "FLAMESHOT_DEBUG_CAPTURE" false)
]
++ lib.optionals stdenv.hostPlatform.isLinux [
(lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true)
(lib.cmakeBool "USE_WAYLAND_GRIM" enableWlrSupport)
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeFeature "Qt5_DIR" "${libsForQt5.qtbase.dev}/lib/cmake/Qt5")
(lib.cmakeFeature "Qt6_DIR" "${kdePackages.qtbase.dev}/lib/cmake/Qt6")
];

nativeBuildInputs =
[
cmake
libsForQt5.qttools
libsForQt5.qtsvg
libsForQt5.wrapQtAppsHook
kdePackages.qttools
kdePackages.qtsvg
kdePackages.wrapQtAppsHook
makeBinaryWrapper
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
Expand All @@ -65,8 +83,9 @@ stdenv.mkDerivation {
];

buildInputs = [
libsForQt5.qtbase
libsForQt5.kguiaddons
kdePackages.qtbase
kdePackages.kguiaddons
kdsingleapplication
];

postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
Expand Down