about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/shutter/default.nix
blob: d10e8487796fff96baa421420854361a60a1597c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{ lib
, stdenv
, fetchFromGitHub
, perlPackages
, wrapGAppsHook
, imagemagick
, gdk-pixbuf
, librsvg
, hicolor-icon-theme
, procps
, libwnck
, libappindicator-gtk3
, xdg-utils
}:

let
  perlModules = with perlPackages; [
      # Not sure if these are needed
      # Gnome2 Gnome2Canvas Gnome2VFS Gtk2AppIndicator Gtk2Unique
      ImageMagick
      Cairo
      FileBaseDir
      FileWhich
      FileCopyRecursive
      XMLSimple
      XMLTwig
      XMLParser
      SortNaturally
      LocaleGettext
      ProcProcessTable
      X11Protocol
      ProcSimple
      ImageExifTool
      JSON
      JSONMaybeXS
      NetOAuth
      PathClass
      LWP
      LWPProtocolHttps
      NetDBus
      TryTiny
      WWWMechanize
      HTTPMessage
      HTTPDate
      HTMLForm
      HTMLParser
      HTMLTagset
      HTTPCookies
      EncodeLocale
      URI
      CarpAlways
      GlibObjectIntrospection
      NumberBytesHuman
      CairoGObject
      Readonly
      Gtk3ImageView
      Gtk3
      Glib
      Pango
      GooCanvas2
      GooCanvas2CairoTypes
      commonsense
      TypesSerialiser
    ];
in
stdenv.mkDerivation rec {
  pname = "shutter";
  version = "0.99.2";

  src = fetchFromGitHub {
    owner = "shutter-project";
    repo = "shutter";
    rev = "v${version}";
    sha256 = "sha256-o95skSr6rszh0wsHQTpu1GjqCDmde7aygIP+i4XQW9A=";
  };

  nativeBuildInputs = [ wrapGAppsHook ];
  buildInputs = [
    perlPackages.perl
    procps
    gdk-pixbuf
    librsvg
    libwnck
    libappindicator-gtk3
    hicolor-icon-theme
  ] ++ perlModules;

  makeFlags = [
    "prefix=${placeholder "out"}"
  ];

  postPatch = ''
    patchShebangs po2mo.sh
  '';

  preFixup = ''
    # make xdg-open overrideable at runtime
    gappsWrapperArgs+=(
      --set PERL5LIB ${perlPackages.makePerlPath perlModules} \
      --prefix PATH : ${lib.makeBinPath [ imagemagick ] }
      --suffix PATH : ${lib.makeBinPath [ xdg-utils ] }
    )
  '';

  meta = with lib; {
    description = "Screenshot and annotation tool";
    mainProgram = "shutter";
    homepage = "https://shutter-project.org/";
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = [ maintainers.bjornfor ];
  };
}