mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
flameshot: fix executable path in dbus service
also some minor tweaks that makes the package more robust.
This commit is contained in:
parent
ac098c2e62
commit
4010639d5e
|
@ -1,25 +1,14 @@
|
|||
{ stdenv, fetchFromGitHub, qtbase, qmake, qttools, qtsvg }:
|
||||
|
||||
# To use `flameshot gui`, you will also need to put flameshot in `services.dbus.packages`
|
||||
# in configuration.nix so that the daemon gets launched properly:
|
||||
#
|
||||
# services.dbus.packages = [ pkgs.flameshot ];
|
||||
# environment.systemPackages = [ pkgs.flameshot ];
|
||||
stdenv.mkDerivation rec {
|
||||
name = "flameshot-${version}";
|
||||
version = "0.6.0";
|
||||
|
||||
nativeBuildInputs = [ qmake qttools qtsvg ];
|
||||
buildInputs = [ qtbase ];
|
||||
|
||||
qmakeFlags = [
|
||||
# flameshot.pro assumes qmake is being run in a git checkout and uses it
|
||||
# to determine the version being built. Let's replace that.
|
||||
"VERSION=${version}"
|
||||
"PREFIX=/"
|
||||
];
|
||||
patchPhase = ''
|
||||
sed -i 's/VERSION =/#VERSION =/g' flameshot.pro
|
||||
sed -i 's,USRPATH = /usr/local,USRPATH = /,g' flameshot.pro
|
||||
'';
|
||||
|
||||
installFlags = [ "INSTALL_ROOT=$(out)" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lupoDharkael";
|
||||
repo = "flameshot";
|
||||
|
@ -27,6 +16,22 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "193szslh55v44jzxzx5g9kxhl8p8di7vbcnxlid4acfidhnvgazm";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ qmake qttools qtsvg ];
|
||||
buildInputs = [ qtbase ];
|
||||
|
||||
qmakeFlags = [ "PREFIX=${placeholder "out"}" ];
|
||||
|
||||
preConfigure = ''
|
||||
# flameshot.pro assumes qmake is being run in a git checkout.
|
||||
git() { echo ${version}; }
|
||||
export -f git
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
substituteInPlace $out/share/dbus-1/services/org.dharkael.Flameshot.service \
|
||||
--replace "/usr/local" "$out"
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
|
Loading…
Reference in a new issue