From fe1ba3c9be690ce82e3f008912cc6a50bb2cc4b3 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 13 Jan 2022 21:07:04 +0100 Subject: [PATCH 1/5] xiphos: clean up the expression - attribute ordering --- pkgs/applications/misc/xiphos/default.nix | 42 +++++++++++------------ 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/pkgs/applications/misc/xiphos/default.nix b/pkgs/applications/misc/xiphos/default.nix index 87656db5e5f9..1584482fcf8b 100644 --- a/pkgs/applications/misc/xiphos/default.nix +++ b/pkgs/applications/misc/xiphos/default.nix @@ -1,5 +1,5 @@ -{ lib -, stdenv +{ stdenv +, lib , fetchFromGitHub , fetchpatch , appstream-glib @@ -60,14 +60,26 @@ stdenv.mkDerivation rec { 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"; + sha256 = "sha256-0WadztJKXW2adqsDP8iSAYVShbdqHoDvP+aVJC0cQB0="; + }) + ]; + + patchFlags = [ "-p0" ]; + nativeBuildInputs = [ - appstream-glib + appstream-glib # for appstream-util cmake - desktop-file-utils + desktop-file-utils # for desktop-file-validate itstool pkg-config wrapGAppsHook - yelp-tools + yelp-tools # for yelp-build ]; buildInputs = [ @@ -107,12 +119,10 @@ stdenv.mkDerivation rec { sqlite sword webkitgtk + xorg.libXdmcp + xorg.libXtst zip - ] - ++ (with xorg; [ - libXdmcp - libXtst - ]); + ]; cmakeFlags = [ "-DDBUS=OFF" @@ -127,18 +137,6 @@ stdenv.mkDerivation rec { export SWORD_HOME=${sword}; ''; - patchFlags = [ "-p0" ]; - - 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"; - sha256 = "sha256-0WadztJKXW2adqsDP8iSAYVShbdqHoDvP+aVJC0cQB0="; - }) - ]; - meta = with lib; { description = "A GTK Bible study tool"; longDescription = '' From 94517ee0c77aebad0278a5e8888b86b66f8dad59 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 13 Jan 2022 21:16:41 +0100 Subject: [PATCH 2/5] gnome2.gtkhtml4: do not use patchFlags Those apply to all patches making applying patches in the future problematic. --- pkgs/desktops/gnome-2/platform/gtkhtml/4.x.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/desktops/gnome-2/platform/gtkhtml/4.x.nix b/pkgs/desktops/gnome-2/platform/gtkhtml/4.x.nix index 9447a381a3fb..580d0a8cc829 100644 --- a/pkgs/desktops/gnome-2/platform/gtkhtml/4.x.nix +++ b/pkgs/desktops/gnome-2/platform/gtkhtml/4.x.nix @@ -12,11 +12,6 @@ stdenv.mkDerivation rec { rev = "master"; sha256 = "sha256-jL8YADvhW0o6I/2Uo5FNARMAnSbvtmFp+zWH1yCVvQk="; }; - propagatedBuildInputs = [ gsettings-desktop-schemas gtk3 gnome-icon-theme GConf ]; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ intltool enchant isocodes autoreconfHook ]; - - patchFlags = [ "-p0" ]; patches = [ # Enables enchant2 support. @@ -24,7 +19,12 @@ stdenv.mkDerivation rec { (fetchpatch { name ="enchant-2.patch"; url = "https://aur.archlinux.org/cgit/aur.git/plain/enchant-2.patch?h=gtkhtml4&id=0218303a63d64c04d6483a6fe9bb55063fcfaa43"; - sha256 = "sha256-jkA/GgIiJZmxkbcBGQ26OZ1nuI502BMPwbPhsZkbgbY="; + sha256 = "f0OToWGHZwxvqf+0qosfA9FfwJ/IXfjIPP5/WrcvArI="; + extraPrefix = ""; }) ]; + + propagatedBuildInputs = [ gsettings-desktop-schemas gtk3 gnome-icon-theme GConf ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ intltool enchant isocodes autoreconfHook ]; } From 569eea8ec1ea42a83dda23fe00bc6c0d080bc93f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 13 Jan 2022 21:27:26 +0100 Subject: [PATCH 3/5] xiphos: do not use patchFlags Those apply to all patches making applying patches in the future problematic. Also pin the patch while at it. --- pkgs/applications/misc/xiphos/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/xiphos/default.nix b/pkgs/applications/misc/xiphos/default.nix index 1584482fcf8b..5308e8ddad8a 100644 --- a/pkgs/applications/misc/xiphos/default.nix +++ b/pkgs/applications/misc/xiphos/default.nix @@ -65,13 +65,12 @@ stdenv.mkDerivation rec { # 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"; - sha256 = "sha256-0WadztJKXW2adqsDP8iSAYVShbdqHoDvP+aVJC0cQB0="; + url = "https://aur.archlinux.org/cgit/aur.git/plain/xiphos-glibc.patch?h=xiphos&id=bb816f43ba764ffac1287ab1e2a649c2443e3ce8"; + sha256 = "he3U7phU2/QCrZidHviupA7YwzudnQ9Jbb8eMZw6/ck="; + extraPrefix = ""; }) ]; - patchFlags = [ "-p0" ]; - nativeBuildInputs = [ appstream-glib # for appstream-util cmake From 7cf24465b2e971b2e7ea797a9654ad0205213765 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 14 Jan 2022 13:05:18 +0100 Subject: [PATCH 4/5] xiphos: drop lucene This is supposedly not used since 4.1.0 according to its release notes https://github.com/crosswire/xiphos/releases/tag/4.1.0 but I do not see a commit removing it and lucene is still mentioned throughout the interface. But there is no closure change. --- pkgs/applications/misc/xiphos/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/misc/xiphos/default.nix b/pkgs/applications/misc/xiphos/default.nix index 5308e8ddad8a..38349777edba 100644 --- a/pkgs/applications/misc/xiphos/default.nix +++ b/pkgs/applications/misc/xiphos/default.nix @@ -6,7 +6,6 @@ , at-spi2-core , biblesync , brotli -, clucene_core , cmake , dbus , dbus-glib @@ -85,7 +84,6 @@ stdenv.mkDerivation rec { at-spi2-core biblesync brotli - clucene_core dbus dbus-glib docbook2x @@ -132,7 +130,6 @@ stdenv.mkDerivation rec { # The build script won't continue without the version saved locally. echo "${version}" > cmake/source_version.txt - export CLUCENE_HOME=${clucene_core}; export SWORD_HOME=${sword}; ''; From a3720ac9a1b5625f8f39fb50d61f13e627390576 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 15 Jan 2022 05:10:36 +0100 Subject: [PATCH 5/5] xiphos: clean up dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Moved build dependencies to native. - Most of those added in 4.2.1 update are only transitive. - Switched to GTK 3. - The GNOME 2 dependencies can me removed as they are not used. - Except for GTKHtml since WebKit2-based editor is not implemented. - Python is not needed either. - D-Bus functionality requires a patch to build - gsf was replaced by minizip – https://github.com/crosswire/xiphos/pull/1003 --- ...001-Add-dbus-glib-dependency-to-main.patch | 38 +++++++++++ pkgs/applications/misc/xiphos/default.nix | 65 ++++--------------- pkgs/top-level/all-packages.nix | 4 -- 3 files changed, 52 insertions(+), 55 deletions(-) create mode 100644 pkgs/applications/misc/xiphos/0001-Add-dbus-glib-dependency-to-main.patch diff --git a/pkgs/applications/misc/xiphos/0001-Add-dbus-glib-dependency-to-main.patch b/pkgs/applications/misc/xiphos/0001-Add-dbus-glib-dependency-to-main.patch new file mode 100644 index 000000000000..71cb57ccef18 --- /dev/null +++ b/pkgs/applications/misc/xiphos/0001-Add-dbus-glib-dependency-to-main.patch @@ -0,0 +1,38 @@ +From 0e9e686c902935c0f00afdf9d0d45f9635995988 Mon Sep 17 00:00:00 2001 +From: Jan Tojnar +Date: Sat, 15 Jan 2022 05:00:37 +0100 +Subject: [PATCH] Add dbus-glib dependency to main + +It is required through the ipc header and the build will fail without it on Nix: + + In file included from /build/source/src/main/search_sidebar.cc:48: + /build/source/src/gui/ipc.h:26:10: fatal error: dbus/dbus-glib.h: No such file or directory + 26 | #include + | ^~~~~~~~~~~~~~~~~~ + compilation terminated. +--- + src/main/CMakeLists.txt | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt +index 49b86371..bb8e4bb6 100644 +--- a/src/main/CMakeLists.txt ++++ b/src/main/CMakeLists.txt +@@ -74,3 +74,14 @@ target_link_libraries(main + PkgConfig::Sword + PkgConfig::Biblesync + ) ++ ++IF (DBUS) ++ target_include_directories (main ++ PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ++ PkgConfig::DBus ++ ) ++ target_link_libraries(main ++ PRIVATE ++ PkgConfig::DBus ++ ) ++ENDIF (DBUS) +-- +2.34.1 + diff --git a/pkgs/applications/misc/xiphos/default.nix b/pkgs/applications/misc/xiphos/default.nix index 38349777edba..994127baca6d 100644 --- a/pkgs/applications/misc/xiphos/default.nix +++ b/pkgs/applications/misc/xiphos/default.nix @@ -3,47 +3,27 @@ , fetchFromGitHub , fetchpatch , appstream-glib -, at-spi2-core , biblesync -, brotli , cmake -, dbus , dbus-glib , desktop-file-utils , docbook2x , docbook_xml_dtd_412 -, enchant -, gconf +, enchant2 , glib -, gnome-doc-utils -, gtk2 +, gtk3 , gtkhtml , icu , intltool , isocodes , itstool -, libdatrie -, libepoxy -, libglade -, libgsf -, libpsl -, libselinux -, libsepol -, libsysprof-capture -, libthai , libuuid -, libxkbcommon , libxslt , minizip -, pcre , pkg-config -, python -, scrollkeeper -, sqlite , sword , webkitgtk , wrapGAppsHook -, xorg , yelp-tools , zip }: @@ -68,61 +48,44 @@ stdenv.mkDerivation rec { 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 wrapGAppsHook yelp-tools # for yelp-build + zip # for building help epubs ]; buildInputs = [ - at-spi2-core biblesync - brotli - dbus dbus-glib - docbook2x - docbook_xml_dtd_412 - enchant - gconf + enchant2 glib - gnome-doc-utils - gtk2 + gtk3 gtkhtml icu - intltool isocodes - libdatrie - libepoxy - libglade - libgsf - libpsl - libselinux - libsepol - libsysprof-capture - libthai libuuid - libxkbcommon - libxslt minizip - pcre - python - scrollkeeper - sqlite sword webkitgtk - xorg.libXdmcp - xorg.libXtst - zip ]; cmakeFlags = [ - "-DDBUS=OFF" + # WebKit-based editor does not build. "-DGTKHTML=ON" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8bebf6697029..ccbbcfc78b30 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29748,11 +29748,7 @@ with pkgs; }; xiphos = callPackage ../applications/misc/xiphos { - gconf = gnome2.GConf; - inherit (gnome2) libglade scrollkeeper; gtkhtml = gnome2.gtkhtml4; - python = python27; - enchant = enchant2; }; xournal = callPackage ../applications/graphics/xournal {