flameshot: 12.1.0-unstable-2025-05-04 -> 13.0.1 (#431307)

This commit is contained in:
Sandro 2025-08-16 20:58:43 +02:00 committed by GitHub
commit 1f5f5ac80b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 260 additions and 43 deletions

View File

@ -6583,6 +6583,12 @@
githubId = 875324;
name = "David Johnson";
};
dmkhitaryan = {
name = "David Mkhitaryan";
email = "d.mkhitaryan@mailbox.org";
github = "dmkhitaryan";
githubId = 63636798;
};
dmvianna = {
email = "dmlvianna@gmail.com";
github = "dmvianna";

View File

@ -0,0 +1,53 @@
--- a/CMakeLists.txt 2025-08-15 11:37:20
+++ b/CMakeLists.txt 2025-08-15 11:40:06
@@ -29,21 +29,7 @@
if(EXISTS "${CMAKE_SOURCE_DIR}/external/Qt-Color-Widgets/CMakeLists.txt")
add_subdirectory("${CMAKE_SOURCE_DIR}/external/Qt-Color-Widgets" EXCLUDE_FROM_ALL)
else()
- FetchContent_Declare(
- qtColorWidgets
- GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
- GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
- )
- #Workaround for duplicate GUID in windows WIX installer
- if (WIN32)
- FetchContent_GetProperties(qtColorWidgets)
- if(NOT qtcolorwidgets_POPULATED)
- FetchContent_Populate(qtColorWidgets)
- add_subdirectory(${qtcolorwidgets_SOURCE_DIR} ${qtcolorwidgets_BINARY_DIR} EXCLUDE_FROM_ALL)
- endif()
- else()
- FetchContent_MakeAvailable(qtColorWidgets)
- endif()
+ find_package(QtColorWidgets REQUIRED)
endif()
# This can be read from ${PROJECT_NAME} after project() is called
@@ -115,12 +101,7 @@
if(EXISTS "${CMAKE_SOURCE_DIR}/external/KDSingleApplication/CMakeLists.txt")
add_subdirectory("${CMAKE_SOURCE_DIR}/external/KDSingleApplication")
else()
- FetchContent_Declare(
- kdsingleApplication
- GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
- GIT_TAG v1.2.0
- )
- FetchContent_MakeAvailable(KDSingleApplication)
+ find_package(KDSingleApplication-qt6 REQUIRED)
endif()
endif()
@@ -128,12 +109,7 @@
option(BUILD_STATIC_LIBS ON)
if (APPLE)
- FetchContent_Declare(
- qHotKey
- GIT_REPOSITORY https://github.com/flameshot-org/QHotkey
- GIT_TAG master
- )
- FetchContent_MakeAvailable(QHotKey)
+ find_package(QHotKey REQUIRED)
endif()
add_subdirectory(src)

View File

@ -0,0 +1,76 @@
--- a/src/CMakeLists.txt 2025-08-12 16:34:27
+++ b/src/CMakeLists.txt 2025-08-15 11:45:56
@@ -220,7 +220,7 @@
target_link_libraries(
flameshot
- kdsingleapplication
+ kdsingleapplication-qt6
)
endif()
@@ -447,64 +447,3 @@
endif ()
endif ()
-# macdeployqt
-if (APPLE)
-# Code signing settings - optional, set to empty string to skip signing
- set(CODE_SIGN_IDENTITY "" CACHE STRING "Code signing identity (leave empty to skip signing)")
- set(DMG_SIGN_IDENTITY "" CACHE STRING "DMG signing identity (leave empty to skip signing)")
- # Custom target to create DMG (signed or unsigned)
- add_custom_target(create_dmg
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../packaging/macos/create_dmg.sh
- "${CMAKE_CURRENT_BINARY_DIR}/Flameshot.app"
- "${CMAKE_CURRENT_BINARY_DIR}/Flameshot-${PROJECT_VERSION}.dmg"
- "${CODE_SIGN_IDENTITY}"
- "${DMG_SIGN_IDENTITY}"
- DEPENDS flameshot
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Creating DMG"
- VERBATIM
- )
-
-# Always sign the app bundle (either with identity or ad hoc)
- if(CODE_SIGN_IDENTITY AND NOT CODE_SIGN_IDENTITY STREQUAL "")
- # Identity-based signing (requires Developer ID)
- add_custom_command(TARGET flameshot POST_BUILD
- COMMAND codesign --force --deep --sign "${CODE_SIGN_IDENTITY}"
- --options runtime --timestamp "$<TARGET_BUNDLE_DIR:flameshot>"
- COMMENT "Code signing app bundle with ${CODE_SIGN_IDENTITY}"
- )
- else()
- # Ad hoc signing
- add_custom_command(TARGET flameshot POST_BUILD
- COMMAND codesign --force --deep --sign - "$<TARGET_BUNDLE_DIR:flameshot>"
- COMMENT "Ad hoc code signing app bundle (no identity required)"
- )
- endif()
- # Deploy Qt libraries and dependencies
- find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS ${Qt6_DIR}/../../../bin)
-
- if(MACDEPLOYQT_EXECUTABLE)
- add_custom_command(TARGET flameshot POST_BUILD
- COMMAND ${MACDEPLOYQT_EXECUTABLE} "$<TARGET_BUNDLE_DIR:flameshot>" -verbose=2
- COMMENT "Deploying Qt libraries"
- )
-
- # Re-sign after macdeployqt (it modifies the bundle)
- if(CODE_SIGN_IDENTITY AND NOT CODE_SIGN_IDENTITY STREQUAL "")
- add_custom_command(TARGET flameshot POST_BUILD
- COMMAND codesign --force --deep --sign "${CODE_SIGN_IDENTITY}"
- --options runtime --timestamp "$<TARGET_BUNDLE_DIR:flameshot>"
- COMMENT "Re-signing app bundle after Qt deployment"
- )
- else()
- add_custom_command(TARGET flameshot POST_BUILD
- COMMAND codesign --force --deep --sign - "$<TARGET_BUNDLE_DIR:flameshot>"
- COMMENT "Re-signing app bundle after Qt deployment (ad hoc)"
- )
- endif()
- else()
- message(WARNING "macdeployqt not found. App may not run on systems without Qt installed.")
- endif()
-
-
-endif ()

View File

@ -2,13 +2,13 @@
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
cmake,
imagemagick,
libicns,
libsForQt5,
kdePackages,
grim,
makeBinaryWrapper,
kdsingleapplication,
nix-update-script,
enableWlrSupport ? false,
enableMonochromeIcon ? false,
@ -16,45 +16,42 @@
assert stdenv.hostPlatform.isDarwin -> (!enableWlrSupport);
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "flameshot";
# wlr screenshotting is currently only available on unstable version (>12.1.0)
version = "12.1.0-unstable-2025-05-04";
version = "13.0.1";
src = fetchFromGitHub {
owner = "flameshot-org";
repo = "flameshot";
rev = "f4cde19c63473f8fadd448ad2056c22f0f847f34";
hash = "sha256-B/piB8hcZR11vnzvue/1eR+SFviTSGJoek1w4abqsek=";
tag = "v${finalAttrs.version}";
hash = "sha256-Zo+rhvpwhcYqgn8PZ0b48sCb/YWqGSormFnY6pbY8Qc=";
};
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=";
})
];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-I${kdsingleapplication}/include/kdsingleapplication-qt6"
(lib.cmakeBool "DISABLE_UPDATE_CHECKER" true)
(lib.cmakeBool "USE_MONOCHROME_ICON" enableMonochromeIcon)
]
++ 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}/lib/cmake/Qt6")
];
# 1. "load-missing-deps" prevents from build inputs being fetched via GitHub.
# 2. "macos-build" mainly patches out the use of codesigning + macdeployqt,
# which incorrectly fetches Qt libraries.
# 2.1 Also fixes target link to "kdsingpleapplications-qt6" as in Nixpkgs.
patches = [
./load-missing-deps.patch
./macos-build.patch
];
nativeBuildInputs = [
cmake
libsForQt5.qttools
libsForQt5.qtsvg
libsForQt5.wrapQtAppsHook
kdePackages.qttools
kdePackages.wrapQtAppsHook
makeBinaryWrapper
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
@ -63,21 +60,24 @@ stdenv.mkDerivation {
];
buildInputs = [
libsForQt5.qtbase
libsForQt5.kguiaddons
kdsingleapplication
kdePackages.qt-color-widgets
kdePackages.qtbase
kdePackages.qtsvg
]
++ lib.optionals stdenv.hostPlatform.isLinux [
kdePackages.qtwayland # Included explicitly due to reported inconsistencies without it.
kdePackages.kguiaddons
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
kdePackages.qhotkey
];
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Fix icns generation running concurrently with png generation
sed -E -i '/"iconutil -o/i\
)\
execute_process(\
' src/CMakeLists.txt
# Replace unavailable commands
sed -E -i \
-e 's/"sips -z ([0-9]+) ([0-9]+) +(.+) --out /"magick \3 -resize \1x\2\! /' \
-e 's/"iconutil -o (.+) -c icns (.+)"/"png2icns \1 \2\/*{16,32,128,256,512}.png"/' \
# Replace sips with imagemagick and iconutil with png2icns.
sed -i -E \
-e 's|sips -z ([0-9]+) ([0-9]+) +(.+) --out (.+)|magick \3 -resize \1x\2\\! \4|g' \
-e 's|iconutil -o \\?"([^"]+)" -c icns \\?"([^"]+)"|png2icns \1 \2/*\{16,32,128,256,512\}.png|' \
src/CMakeLists.txt
'';
@ -109,20 +109,19 @@ stdenv.mkDerivation {
''${qtWrapperArgs[@]}
'';
passthru = {
updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
};
passthru.updateScript = nix-update-script { };
meta = with lib; {
meta = {
description = "Powerful yet simple to use screenshot software";
homepage = "https://github.com/flameshot-org/flameshot";
changelog = "https://github.com/flameshot-org/flameshot/releases";
mainProgram = "flameshot";
maintainers = with maintainers; [
maintainers = with lib.maintainers; [
scode
oxalica
dmkhitaryan
];
license = licenses.gpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}
})

View File

@ -0,0 +1,40 @@
{
stdenv,
lib,
fetchFromGitHub,
cmake,
qtbase,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "qhotkey";
version = "1.5.0-unstable-2025-07-06";
src = fetchFromGitHub {
owner = "Skycoder42";
repo = "qhotkey";
rev = "6c0e98492c59206139f8490706aadeb8ed033057";
hash = "sha256-F+NTVYIB55GlB+p9mgDvJD86n0xOOKMGCRDM8TtnMpo=";
};
dontWrapQtApps = true;
cmakeFlags = [
"-DQT_DEFAULT_MAJOR_VERSION=${lib.versions.major qtbase.version}"
];
nativeBuildInputs = [
cmake
];
buildInputs = [
qtbase
];
meta = {
homepage = "https://github.com/Skycoder42/QHotkey";
description = "Global shortcut/hotkey for Desktop Qt-Applications";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ dmkhitaryan ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
})

View File

@ -0,0 +1,40 @@
{
stdenv,
lib,
fetchFromGitLab,
cmake,
qtbase,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "qt-color-widgets";
version = "2.2.0-unstable-2025-05-26";
src = fetchFromGitLab {
owner = "mattbas";
repo = "qt-color-widgets";
rev = "8491078434b24cba295b5e41cc0d2a94c7049a5b";
hash = "sha256-77G1NU7079pvqhQnSTmMdkd2g1R2hoJxn183WcsWq8c=";
};
dontWrapQtApps = true;
cmakeFlags = [
"-DQT_VERSION_MAJOR=${lib.versions.major qtbase.version}"
];
nativeBuildInputs = [
cmake
];
buildInputs = [
qtbase
];
meta = {
homepage = "https://gitlab.com/mattbas/Qt-Color-Widgets";
description = "Qt (C++) widgets to manage color inputs";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [ dmkhitaryan ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
})

View File

@ -88,6 +88,7 @@ makeScopeWithSplicing' {
qcoro = callPackage ../development/libraries/qcoro { };
qcustomplot = callPackage ../development/libraries/qcustomplot { };
qgpgme = callPackage ../development/libraries/gpgme { };
qhotkey = callPackage ../development/libraries/qhotkey { };
qmlbox2d = callPackage ../development/libraries/qmlbox2d { };
packagekit-qt = callPackage ../tools/package-management/packagekit/qt.nix { };
@ -95,6 +96,8 @@ makeScopeWithSplicing' {
qt6gtk2 = callPackage ../tools/misc/qt6gtk2 { };
qt-color-widgets = callPackage ../development/libraries/qt-color-widgets { };
qtforkawesome = callPackage ../development/libraries/qtforkawesome { };
qtkeychain = callPackage ../development/libraries/qtkeychain { };