summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/sh/shutter/package.nix
blob: 767ad39edeeb965492f2cb0b4e011a732e3885a1 (plain)
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
114
115
{
  lib,
  stdenv,
  fetchFromGitHub,
  perlPackages,
  wrapGAppsHook3,
  imagemagick,
  gdk-pixbuf,
  librsvg,
  hicolor-icon-theme,
  procps,
  libwnck,
  libappindicator,
  xdg-utils,
}:

let
  perlModules = with perlPackages; [
    Cairo
    CairoGObject
    CarpAlways
    commonsense
    EncodeLocale
    FileBaseDir
    FileCopyRecursive
    FileWhich
    Glib
    GlibObjectIntrospection
    GooCanvas2
    GooCanvas2CairoTypes
    Gtk3
    Gtk3ImageView
    HTMLForm
    HTMLParser
    HTMLTagset
    HTTPCookies
    HTTPDate
    HTTPMessage
    ImageExifTool
    ImageMagick
    JSON
    JSONMaybeXS
    LocaleGettext
    LWP
    LWPProtocolHttps
    Moo
    NetDBus
    NumberBytesHuman
    Pango
    PathClass
    ProcProcessTable
    ProcSimple
    Readonly
    SortNaturally
    SubQuote
    TryTiny
    TypesSerialiser
    URI
    X11Protocol
    XMLParser
    XMLSimple
    XMLTwig
  ];
in
stdenv.mkDerivation (finalAttrs: {
  pname = "shutter";
  version = "0.99.7";

  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "shutter-project";
    repo = "shutter";
    tag = finalAttrs.version;
    sha256 = "sha256-iri4yj2DujsEfpa6u4f5bpaOhWL0h/XbSlolkSJgKgE=";
  };

  nativeBuildInputs = [ wrapGAppsHook3 ];
  buildInputs = [
    perlPackages.perl
    procps
    gdk-pixbuf
    librsvg
    libwnck
    libappindicator
    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 = {
    description = "Screenshot and annotation tool";
    mainProgram = "shutter";
    homepage = "https://shutter-project.org/";
    license = lib.licenses.gpl3Plus;
    platforms = lib.platforms.all;
    maintainers = [ lib.maintainers.bjornfor ];
  };
})