nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, extra-cmake-modules
6, pkg-config
7, qtbase
8, qtimageformats
9, qtwebengine
10, qtx11extras ? null # qt5 only
11, libarchive
12, libXdmcp
13, libpthreadstubs
14, wrapQtAppsHook
15, xcbutilkeysyms
16}:
17
18let
19 isQt5 = lib.versions.major qtbase.version == "5";
20
21in
22stdenv.mkDerivation rec {
23 pname = "zeal";
24 version = "0.6.1.20230320";
25
26 src = fetchFromGitHub {
27 owner = "zealdocs";
28 repo = "zeal";
29 rev = "a617ae5e06b95cec99bae058650e55b98613916d";
30 hash = "sha256-WL2uqA0sZ5Q3lZIA9vkLVyfec/jBkfGcWb6XQ7AuM94=";
31 };
32
33 # we only need this if we are using a version that hasn't been released. We
34 # could also match on the "VERSION x.y.z" bit but then it would have to be
35 # updated based on whatever is the latest release, so instead just rewrite the
36 # line.
37 postPatch = ''
38 sed -i CMakeLists.txt \
39 -e 's@^project.*@project(Zeal VERSION ${version})@'
40 '' + lib.optionalString (!isQt5) ''
41 substituteInPlace src/app/CMakeLists.txt \
42 --replace "COMPONENTS Widgets" "COMPONENTS Widgets QmlIntegration"
43 '';
44
45 nativeBuildInputs = [ cmake extra-cmake-modules pkg-config wrapQtAppsHook ];
46
47 buildInputs = [
48 qtbase
49 qtimageformats
50 qtwebengine
51 libarchive
52 libXdmcp
53 libpthreadstubs
54 xcbutilkeysyms
55 ] ++ lib.optionals isQt5 [ qtx11extras ];
56
57 meta = with lib; {
58 description = "A simple offline API documentation browser";
59 longDescription = ''
60 Zeal is a simple offline API documentation browser inspired by Dash (macOS
61 app), available for Linux and Windows.
62 '';
63 homepage = "https://zealdocs.org/";
64 license = licenses.gpl3;
65 maintainers = with maintainers; [ skeidel peterhoeg ];
66 platforms = platforms.linux;
67 };
68}