diff --git a/pkgs/by-name/fl/flameshot/package.nix b/pkgs/by-name/fl/flameshot/package.nix new file mode 100644 index 000000000000..bb7137fb48bc --- /dev/null +++ b/pkgs/by-name/fl/flameshot/package.nix @@ -0,0 +1,75 @@ +{ libsForQt5 +, stdenv +, lib +, fetchFromGitHub +, cmake +, nix-update-script +, fetchpatch +, grim +, makeBinaryWrapper +, enableWlrSupport ? false +}: + +stdenv.mkDerivation { + pname = "flameshot"; + # wlr screenshotting is currently only available on unstable version (>12.1.0) + version = "12.1.0-unstable-2024-07-02"; + + src = fetchFromGitHub { + owner = "flameshot-org"; + repo = "flameshot"; + rev = "ccb5a27b136a633911b3b1006185530d9beeea5d"; + hash = "sha256-JIXsdVUR/4183aJ0gvNGYPTyCzX7tCrk8vRtR8bcdhE="; + }; + + 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" ]; + }; + }; + + cmakeFlags = [ + (lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true) + (lib.cmakeBool "USE_WAYLAND_GRIM" enableWlrSupport) + ]; + + nativeBuildInputs = [ + cmake + libsForQt5.qttools + libsForQt5.qtsvg + libsForQt5.wrapQtAppsHook + makeBinaryWrapper + ]; + + buildInputs = [ + libsForQt5.qtbase + libsForQt5.kguiaddons + ]; + + dontWrapQtApps = true; + + postFixup = '' + wrapProgram $out/bin/flameshot \ + ${lib.optionalString enableWlrSupport "--prefix PATH : ${lib.makeBinPath [ grim ]}"} \ + ''${qtWrapperArgs[@]} + ''; + + meta = with lib; { + description = "Powerful yet simple to use screenshot software"; + homepage = "https://github.com/flameshot-org/flameshot"; + mainProgram = "flameshot"; + maintainers = with maintainers; [ scode oxalica ]; + license = licenses.gpl3Plus; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/pkgs/tools/misc/flameshot/default.nix b/pkgs/tools/misc/flameshot/default.nix deleted file mode 100644 index 7b7b58381e9c..000000000000 --- a/pkgs/tools/misc/flameshot/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ mkDerivation -, lib -, fetchFromGitHub -, qtbase -, cmake -, qttools -, qtsvg -, nix-update-script -, fetchpatch -, kguiaddons -}: - -mkDerivation rec { - pname = "flameshot"; - version = "12.1.0"; - - src = fetchFromGitHub { - owner = "flameshot-org"; - repo = "flameshot"; - rev = "v${version}"; - sha256 = "sha256-omyMN8d+g1uYsEw41KmpJCwOmVWLokEfbW19vIvG79w="; - }; - - patches = [ - # https://github.com/flameshot-org/flameshot/pull/3166 - (fetchpatch { - name = "10-fix-wayland.patch"; - url = "https://github.com/flameshot-org/flameshot/commit/5fea9144501f7024344d6f29c480b000b2dcd5a6.patch"; - sha256 = "sha256-SnjVbFMDKD070vR4vGYrwLw6scZAFaQA4b+MbI+0W9E="; - }) - ]; - - passthru = { - updateScript = nix-update-script { }; - }; - - cmakeFlags = [ - (lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true) - ]; - - nativeBuildInputs = [ cmake qttools qtsvg ]; - buildInputs = [ qtbase kguiaddons ]; - - meta = with lib; { - description = "Powerful yet simple to use screenshot software"; - homepage = "https://github.com/flameshot-org/flameshot"; - mainProgram = "flameshot"; - maintainers = with maintainers; [ scode oxalica ]; - license = licenses.gpl3Plus; - platforms = platforms.linux ++ platforms.darwin; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e72f8149f28b..1bf8166d86d0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30697,8 +30697,6 @@ with pkgs; redoflacs = callPackage ../applications/audio/redoflacs { }; - flameshot = libsForQt5.callPackage ../tools/misc/flameshot { }; - flex-ncat = callPackage ../applications/radio/flex-ncat { }; flex-ndax = callPackage ../applications/radio/flex-ndax { };