aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
blob: df622e7303d45fcccf40ff21307c22c613be07c3 (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
{ stdenv, fetchFromGitHub, intltool, autoreconfHook, pkgconfig, libqalculate, gtk3, wrapGAppsHook }:

stdenv.mkDerivation rec {
  pname = "qalculate-gtk";
  version = "3.12.1";

  src = fetchFromGitHub {
    owner = "qalculate";
    repo = "qalculate-gtk";
    rev = "v${version}";
    sha256 = "0ylsxj9rn3dc1grn9w6jisci3ak0hxgbwzqp54azs3aj5cmvkfgg";
  };

  patchPhase = ''
    # The gnome-search-provider2.c file generated by gdbus-codegen depends
    # on gio-unix-2.0, which is a Requires.private of gtk+-3.0,
    # and private dependencies are dropped in our default patched pkg-config.
    # https://github.com/Qalculate/qalculate-gtk/pull/178
    # https://github.com/NixOS/nixpkgs/issues/292
    substituteInPlace configure.ac --replace 'libxml-2.0' 'libxml-2.0 gio-unix-2.0'

    # https://github.com/Qalculate/qalculate-gtk/pull/179
    echo searchprovider.o: gnome-search-provider2.c >>src/Makefile.am
  '';

  hardeningDisable = [ "format" ];

  nativeBuildInputs = [ intltool pkgconfig autoreconfHook wrapGAppsHook ];
  buildInputs = [ libqalculate gtk3 ];
  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "The ultimate desktop calculator";
    homepage = "http://qalculate.github.io";
    maintainers = with maintainers; [ gebner ];
    license = licenses.gpl2Plus;
    platforms = platforms.all;
  };
}