nixpkgs/pkgs/by-name/fl/flameshot/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.8 KiB
Nix
Raw Normal View History

2024-07-15 00:01:23 +00:00
{ libsForQt5
, stdenv
, lib
, fetchFromGitHub
, cmake
, nix-update-script
, fetchpatch
2024-07-15 00:44:41 +00:00
, grim
, makeBinaryWrapper
, enableWlrSupport ? false
}:
2018-01-21 06:47:57 +00:00
stdenv.mkDerivation {
pname = "flameshot";
2024-07-15 00:44:41 +00:00
# wlr screenshotting is currently only available on unstable version (>12.1.0)
version = "12.1.0-unstable-2024-07-02";
2018-01-21 06:47:57 +00:00
src = fetchFromGitHub {
2020-10-14 18:59:19 +00:00
owner = "flameshot-org";
2018-01-21 06:47:57 +00:00
repo = "flameshot";
rev = "ccb5a27b136a633911b3b1006185530d9beeea5d";
hash = "sha256-JIXsdVUR/4183aJ0gvNGYPTyCzX7tCrk8vRtR8bcdhE=";
2018-01-21 06:47:57 +00:00
};
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=";
})
];
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
};
2024-02-08 20:30:46 +00:00
cmakeFlags = [
(lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true)
2024-07-15 00:44:41 +00:00
(lib.cmakeBool "USE_WAYLAND_GRIM" enableWlrSupport)
2024-02-08 20:30:46 +00:00
];
2024-07-15 00:01:23 +00:00
nativeBuildInputs = [
cmake
libsForQt5.qttools
libsForQt5.qtsvg
libsForQt5.wrapQtAppsHook
2024-07-15 00:44:41 +00:00
makeBinaryWrapper
2024-07-15 00:01:23 +00:00
];
buildInputs = [
libsForQt5.qtbase
libsForQt5.kguiaddons
];
2024-07-15 00:44:41 +00:00
dontWrapQtApps = true;
postFixup = ''
wrapProgram $out/bin/flameshot \
${lib.optionalString enableWlrSupport "--prefix PATH : ${lib.makeBinPath [ grim ]}"} \
''${qtWrapperArgs[@]}
'';
meta = with lib; {
2018-01-21 06:47:57 +00:00
description = "Powerful yet simple to use screenshot software";
homepage = "https://github.com/flameshot-org/flameshot";
2023-08-10 07:02:51 +00:00
mainProgram = "flameshot";
maintainers = with maintainers; [ scode oxalica ];
2021-07-19 11:08:08 +00:00
license = licenses.gpl3Plus;
2022-11-21 18:30:30 +00:00
platforms = platforms.linux ++ platforms.darwin;
2018-01-21 06:47:57 +00:00
};
}