about summary refs log tree commit diff
path: root/pkgs/applications/misc/xiphos/default.nix
blob: 83690f129bffaba6b409b19b3b1109fe9aae540b (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
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, appstream-glib
, biblesync
, cmake
, dbus-glib
, desktop-file-utils
, docbook2x
, docbook_xml_dtd_412
, enchant2
, glib
, gtk3
, gtkhtml
, icu
, intltool
, isocodes
, itstool
, libuuid
, libxslt
, minizip
, pkg-config
, sword
, webkitgtk
, wrapGAppsHook3
, yelp-tools
, zip
}:

stdenv.mkDerivation rec {
  pname = "xiphos";
  version = "4.2.1";

  src = fetchFromGitHub {
    owner = "crosswire";
    repo = "xiphos";
    rev = version;
    hash = "sha256-H5Q+azE2t3fgu77C9DxrkeUCJ7iJz3Cc91Ln4dqLvD8=";
  };

  patches = [
    # GLIB_VERSION_MIN_REQUIRED is not defined.
    # https://github.com/crosswire/xiphos/issues/1083#issuecomment-820304874
    (fetchpatch {
      name ="xiphos-glibc.patch";
      url = "https://aur.archlinux.org/cgit/aur.git/plain/xiphos-glibc.patch?h=xiphos&id=bb816f43ba764ffac1287ab1e2a649c2443e3ce8";
      sha256 = "he3U7phU2/QCrZidHviupA7YwzudnQ9Jbb8eMZw6/ck=";
      extraPrefix = "";
    })

    # Fix D-Bus build
    # https://github.com/crosswire/xiphos/pull/1103
    ./0001-Add-dbus-glib-dependency-to-main.patch
  ];

  nativeBuildInputs = [
    appstream-glib # for appstream-util
    cmake
    desktop-file-utils # for desktop-file-validate
    docbook2x
    docbook_xml_dtd_412
    intltool
    itstool
    libxslt
    pkg-config
    wrapGAppsHook3
    yelp-tools # for yelp-build
    zip # for building help epubs
  ];

  buildInputs = [
    biblesync
    dbus-glib
    enchant2
    glib
    gtk3
    gtkhtml
    icu
    isocodes
    libuuid
    minizip
    sword
    webkitgtk
  ];

  cmakeFlags = [
    # WebKit-based editor does not build.
    "-DGTKHTML=ON"
  ];

  preConfigure =  ''
    # The build script won't continue without the version saved locally.
    echo "${version}" > cmake/source_version.txt

    export SWORD_HOME=${sword};
  '';

  meta = with lib; {
    description = "A GTK Bible study tool";
    longDescription = ''
      Xiphos (formerly known as GnomeSword) is a Bible study tool
      written for Linux, UNIX, and Windows using GTK, offering a rich
      and featureful environment for reading, study, and research using
      modules from The SWORD Project and elsewhere.
    '';
    homepage = "https://www.xiphos.org/";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.AndersonTorres ];
    platforms = platforms.linux;
  };
}