Merge pull request #327228 from eclairevoyant/flameshot-fix-wlr
flameshot: 12.1.0 -> 12.1.0-unstable-2024-07-02; allow enabling wlroots support
This commit is contained in:
commit
3c4865ea52
75
pkgs/by-name/fl/flameshot/package.nix
Normal file
75
pkgs/by-name/fl/flameshot/package.nix
Normal file
@ -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;
|
||||
};
|
||||
}
|
@ -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;
|
||||
};
|
||||
}
|
@ -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 { };
|
||||
|
Loading…
Reference in New Issue
Block a user