summary refs log tree commit diff
path: root/pkgs/data/documentation/zeal/default.nix
blob: c2bec7707c29ce00bdf154d443f7aebee0c16e8f (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
{ stdenv, fetchFromGitHub, pkgconfig, qt5, libarchive }:

stdenv.mkDerivation rec {
  version = "20141123";
  name = "zeal-${version}";

  src = fetchFromGitHub {
    owner = "zealdocs";
    repo = "zeal";
    rev = "76405f8387d6a82697faab9630c78f31417d8450";
    sha256 = "1057py3j2flzxyiks031s0mwm9h82v033iqn5cq8sycmrb3ihj2s";
  };

  buildInputs = [ pkgconfig qt5.base qt5.webkit libarchive ];

  patchPhase = ''
    substituteInPlace src/main.cpp \
      --replace /usr/share/pixmaps/zeal $out/share/pixmaps/zeal
  '';

  buildPhase = ''
    qmake PREFIX=$out
    make
  '';

  installPhase = ''
    make INSTALL_ROOT=$out install
  '';

  preFixup = ''
    mv $out/usr/bin $out/bin
    mv $out/usr/share $out/share
    rmdir $out/usr
  '';

  enableParallelBuilding = true;

  meta = {
    description = "Zeal is a simple offline API documentation browser";
    longDescription = ''
      Zeal is a simple offline API documentation browser inspired by Dash (OS X
      app), available for Linux and Windows.
    '';
    homepage = "http://zealdocs.org/";
    license = with stdenv.lib.licenses; [ gpl3 ];
    platforms = stdenv.lib.platforms.linux;
    maintainers = with stdenv.lib.maintainers; [ skeidel ];
  };
}