summary refs log tree commit diff
path: root/pkgs/applications/graphics/dia/default.nix
blob: 0adc585603ef386e490221ab773944ba8094b67e (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
{ lib
, stdenv
, fetchFromGitLab
, appstream-glib
, cmake
, dblatex
, desktop-file-utils
, graphene
, gtk2
, gtk-mac-integration-gtk2
, intltool
, libxml2
, libxslt
, meson
, ninja
, pkg-config
, poppler
, python3
  # Building with docs are failing in unstable-2022-12-14
, withDocs ? false
}:

stdenv.mkDerivation {
  pname = "dia";
  version = "unstable-2022-12-14";

  src = fetchFromGitLab {
    owner = "GNOME";
    repo = "dia";
    domain = "gitlab.gnome.org";
    rev = "4a619ec7cc93be5ddfbcc48d9e1572d04943bcad";
    hash = "sha256-xi45Ak4rlDQjs/FNkdkm145mx76GNHjE6Nrs1dc94ww=";
  };

  patches = [ ./poppler-22_09-build-fix.patch ];

  # Required for the PDF plugin when building with clang.
  CXXFLAGS = "-std=c++17";

  preConfigure = ''
    patchShebangs .
  '';

  buildInputs = [
    graphene
    gtk2
    libxml2
    python3
    poppler
  ] ++
  lib.optionals withDocs [
    libxslt
  ] ++
  lib.optionals stdenv.isDarwin [
    gtk-mac-integration-gtk2
  ];

  nativeBuildInputs = [
    appstream-glib
    desktop-file-utils
    intltool
    meson
    ninja
    pkg-config
  ] ++
  lib.optionals withDocs [
    dblatex
  ];

  meta = with lib; {
    description = "Gnome Diagram drawing software";
    homepage = "http://live.gnome.org/Dia";
    maintainers = with maintainers; [ raskin ];
    license = licenses.gpl2;
    platforms = platforms.unix;
  };
}