summary refs log tree commit diff
path: root/pkgs/applications/misc/glom/default.nix
blob: 1f70111c92efdaaeed6e20559ceb57fdbe3b2c4b (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{ stdenv
, fetchFromGitLab
, pkgconfig
, autoconf
, automake
, libtool
, mm-common
, intltool
, itstool
, doxygen
, graphviz
, makeFontsConf
, freefont_ttf
, boost
, libxmlxx3
, libxslt
, libgdamm
, libarchive
, libepc
, python3
, ncurses
, glibmm
, gtk3
, openssl
, gtkmm3
, goocanvasmm2
, evince
, isocodes
, gtksourceviewmm4
, postgresql
, gnome3
, gobject-introspection
, yelp-tools
, wrapGAppsHook
}:

let
  gda = libgdamm.override {
    mysqlSupport = true;
    postgresSupport = true;
  };
  python = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
  sphinx-build = python3.pkgs.sphinx.overrideAttrs (super: {
    postFixup = super.postFixup or "" + ''
      # Do not propagate Python
      rm $out/nix-support/propagated-build-inputs
    '';
  });
  boost_python = boost.override { enablePython = true; inherit python; };
in stdenv.mkDerivation rec {
  pname = "glom";
  version = "unstable-2018-12-16";

  outputs = [ "out" "lib" "dev" "doc" "devdoc" ];

  src = fetchFromGitLab {
    domain = "gitlab.gnome.org";
    owner = "GNOME";
    repo = pname;
    rev = "fa5ff04f209f35bf3e97bc1c3eb1d1138d6172ce";
    sha256 = "145hnk96xa4v35i3a3mbf3fnx4nlk8cksc0qhm7nrh8cnnrbdfgn";
  };

  nativeBuildInputs = [
    pkgconfig
    autoconf
    automake
    libtool
    mm-common
    intltool
    yelp-tools
    itstool
    doxygen
    graphviz
    sphinx-build
    wrapGAppsHook
    gobject-introspection # for setup hook
  ];

  buildInputs = [
    boost_python
    glibmm
    gtk3
    openssl
    libxmlxx3
    libxslt
    gda
    libarchive
    libepc
    python
    ncurses # for python
    gtkmm3
    goocanvasmm2
    evince
    isocodes
    python3.pkgs.pygobject3
    gtksourceviewmm4
    postgresql # for pg_config
  ];

  enableParallelBuilding = true;

  preConfigure = "NOCONFIGURE=1 ./autogen.sh";

  configureFlags = [
    "--with-boost-python=boost_python${stdenv.lib.versions.major python3.version}${stdenv.lib.versions.minor python3.version}"
  ];

  makeFlags = [
    "libdocdir=${placeholder "doc"}/share/doc/$(book_name)"
    "devhelpdir=${placeholder "devdoc"}/share/devhelp/books/$(book_name)"
  ];

  # Fontconfig error: Cannot load default config file
  FONTCONFIG_FILE = makeFontsConf {
    fontDirectories = [ freefont_ttf ];
  };

  preFixup = ''
    gappsWrapperArgs+=(
      --prefix PYTHONPATH : "${placeholder "out"}/${python3.sitePackages}"
      --set PYTHONHOME "${python}"
    )
  '';

  meta = with stdenv.lib; {
    description = "An easy-to-use database designer and user interface";
    homepage = "http://www.glom.org/";
    license = [ licenses.lgpl2 licenses.gpl2 ];
    maintainers = gnome3.maintainers;
    platforms = platforms.linux;
  };
}