git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #55323 from Mic92/flameshot

flameshot: fix executable path in dbus service

commit61029df66aa53d81ab96c98646e0c17dedd47e90 authorJörg Thalheim <Mic92@users.noreply.github.com> dateFri 8 Feb 2019, 07:12 (8 years ago) parentb2d97824010639
1 file changed+21−16
pkgs/tools/misc/flameshot/default.nix+21−16
pkgs/tools/misc/flameshot/default.nix+21−16
@@ -1,25 +1,14 @@
11{ stdenv, fetchFromGitHub, qtbase, qmake, qttools, qtsvg }:
22
3+# To use `flameshot gui`, you will also need to put flameshot in `services.dbus.packages`
4+# in configuration.nix so that the daemon gets launched properly:
5+#
6+# services.dbus.packages = [ pkgs.flameshot ];
7+# environment.systemPackages = [ pkgs.flameshot ];
38stdenv.mkDerivation rec {
49 name = "flameshot-${version}";
510 version = "0.6.0";
611
7− nativeBuildInputs = [ qmake qttools qtsvg ];
8− buildInputs = [ qtbase ];
9−
10− qmakeFlags = [
11− # flameshot.pro assumes qmake is being run in a git checkout and uses it
12− # to determine the version being built. Let's replace that.
13− "VERSION=${version}"
14− "PREFIX=/"
15− ];
16− patchPhase = ''
17− sed -i 's/VERSION =/#VERSION =/g' flameshot.pro
18− sed -i 's,USRPATH = /usr/local,USRPATH = /,g' flameshot.pro
19− '';
20−
21− installFlags = [ "INSTALL_ROOT=$(out)" ];
22−
2312 src = fetchFromGitHub {
2413 owner = "lupoDharkael";
2514 repo = "flameshot";
@@ -27,6 +16,22 @@ stdenv.mkDerivation rec {
2716 sha256 = "193szslh55v44jzxzx5g9kxhl8p8di7vbcnxlid4acfidhnvgazm";
2817 };
2918
19+ nativeBuildInputs = [ qmake qttools qtsvg ];
20+ buildInputs = [ qtbase ];
21+
22+ qmakeFlags = [ "PREFIX=${placeholder "out"}" ];
23+
24+ preConfigure = ''
25+ # flameshot.pro assumes qmake is being run in a git checkout.
26+ git() { echo ${version}; }
27+ export -f git
28+ '';
29+
30+ postFixup = ''
31+ substituteInPlace $out/share/dbus-1/services/org.dharkael.Flameshot.service \
32+ --replace "/usr/local" "$out"
33+ '';
34+
3035 enableParallelBuilding = true;
3136
3237 meta = with stdenv.lib; {