about summary refs log tree commit diff
path: root/pkgs/applications/misc/xiphos/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/xiphos/default.nix')
-rw-r--r--pkgs/applications/misc/xiphos/default.nix99
1 files changed, 78 insertions, 21 deletions
diff --git a/pkgs/applications/misc/xiphos/default.nix b/pkgs/applications/misc/xiphos/default.nix
index 01706011e2d57..994127baca6d0 100644
--- a/pkgs/applications/misc/xiphos/default.nix
+++ b/pkgs/applications/misc/xiphos/default.nix
@@ -1,44 +1,101 @@
-{ lib, stdenv, fetchFromGitHub, pkg-config
-, python
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, appstream-glib
+, biblesync
+, cmake
+, dbus-glib
+, desktop-file-utils
+, docbook2x
+, docbook_xml_dtd_412
+, enchant2
+, glib
+, gtk3
+, gtkhtml
+, icu
 , intltool
-, docbook2x, docbook_xml_dtd_412, libxslt
-, sword, clucene_core, biblesync
-, gnome-doc-utils
-, libgsf, gconf
-, gtkhtml, libglade, scrollkeeper
+, isocodes
+, itstool
+, libuuid
+, libxslt
+, minizip
+, pkg-config
+, sword
 , webkitgtk
-, dbus-glib, enchant, isocodes, libuuid, icu
 , wrapGAppsHook
-, wafHook
+, yelp-tools
+, zip
 }:
 
 stdenv.mkDerivation rec {
   pname = "xiphos";
-  version = "4.1.0";
+  version = "4.2.1";
 
   src = fetchFromGitHub {
     owner = "crosswire";
     repo = "xiphos";
     rev = version;
-    sha256 = "14il9k4i58qbc78hcadw3gqy21sb9q661d75vlj6fwpczbzj7x1a";
+    hash = "sha256-H5Q+azE2t3fgu77C9DxrkeUCJ7iJz3Cc91Ln4dqLvD8=";
   };
 
-  nativeBuildInputs = [ pkg-config wrapGAppsHook wafHook ];
-  buildInputs = [ python intltool docbook2x docbook_xml_dtd_412 libxslt
-                  sword clucene_core biblesync gnome-doc-utils libgsf gconf gtkhtml
-                  libglade scrollkeeper webkitgtk dbus-glib enchant isocodes libuuid icu ];
+  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 = "";
+    })
 
-  prePatch = ''
-    patchShebangs .;
-  '';
+    # 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
+    wrapGAppsHook
+    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 =  ''
-    export CLUCENE_HOME=${clucene_core};
+    # The build script won't continue without the version saved locally.
+    echo "${version}" > cmake/source_version.txt
+
     export SWORD_HOME=${sword};
   '';
 
-  wafConfigureFlags = [ "--enable-webkit2" ];
-
   meta = with lib; {
     description = "A GTK Bible study tool";
     longDescription = ''