Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / fl / flameshot / package.nix
blobbb7137fb48bc73bb0e153a9a2745242c26e51c26
1 { libsForQt5
2 , stdenv
3 , lib
4 , fetchFromGitHub
5 , cmake
6 , nix-update-script
7 , fetchpatch
8 , grim
9 , makeBinaryWrapper
10 , enableWlrSupport ? false
13 stdenv.mkDerivation {
14   pname = "flameshot";
15   # wlr screenshotting is currently only available on unstable version (>12.1.0)
16   version = "12.1.0-unstable-2024-07-02";
18   src = fetchFromGitHub {
19     owner = "flameshot-org";
20     repo = "flameshot";
21     rev = "ccb5a27b136a633911b3b1006185530d9beeea5d";
22     hash = "sha256-JIXsdVUR/4183aJ0gvNGYPTyCzX7tCrk8vRtR8bcdhE=";
23   };
25   patches = [
26     # https://github.com/flameshot-org/flameshot/pull/3166
27     # fixes fractional scaling calculations on wayland
28     (fetchpatch {
29       name = "10-fix-wayland.patch";
30       url = "https://github.com/flameshot-org/flameshot/commit/5fea9144501f7024344d6f29c480b000b2dcd5a6.patch";
31       hash = "sha256-SnjVbFMDKD070vR4vGYrwLw6scZAFaQA4b+MbI+0W9E=";
32     })
33   ];
35   passthru = {
36     updateScript = nix-update-script {
37       extraArgs = [ "--version=branch" ];
38     };
39   };
41   cmakeFlags = [
42     (lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true)
43     (lib.cmakeBool "USE_WAYLAND_GRIM" enableWlrSupport)
44   ];
46   nativeBuildInputs = [
47     cmake
48     libsForQt5.qttools
49     libsForQt5.qtsvg
50     libsForQt5.wrapQtAppsHook
51     makeBinaryWrapper
52   ];
54   buildInputs = [
55     libsForQt5.qtbase
56     libsForQt5.kguiaddons
57   ];
59   dontWrapQtApps = true;
61   postFixup = ''
62     wrapProgram $out/bin/flameshot \
63       ${lib.optionalString enableWlrSupport "--prefix PATH : ${lib.makeBinPath [ grim ]}"} \
64       ''${qtWrapperArgs[@]}
65   '';
67   meta = with lib; {
68     description = "Powerful yet simple to use screenshot software";
69     homepage = "https://github.com/flameshot-org/flameshot";
70     mainProgram = "flameshot";
71     maintainers = with maintainers; [ scode oxalica ];
72     license = licenses.gpl3Plus;
73     platforms = platforms.linux ++ platforms.darwin;
74   };