@@ -1,6 +1,7 @@
11{ akonadi-contacts
22, cmake
33, fetchgit
4+, fetchsvn
45, gnupg
56, gpgme
67, kcontacts
@@ -15,11 +16,14 @@
1516, qtkeychain
1617, qttools
1718, qtwebkit
19+, qttranslations
20+, substituteAll
21+, withI18n ? true
1822}:
1923
2024mkDerivation rec {
2125 pname = "trojita";
22− version = "0.7.20200706";
26+ version = "unstable-2020-07-06";
2327
2428 src = fetchgit {
2529 url = "https://anongit.kde.org/trojita.git";
@@ -27,6 +31,18 @@ mkDerivation rec {
2731 sha256 = "0r8nmlqwgsqkk0k8xh32fkwvv6iylj35xq2h8b7l3g03yc342kbn";
2832 };
2933
34+ l10n = fetchsvn {
35+ url = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5";
36+ rev = "1566642";
37+ sha256 = "0y45fjib153za085la3hqpryycx33dkj3cz8kwzn2w31kvldfl1q";
38+ };
39+
40+ patches = (substituteAll {
41+ # See https://github.com/NixOS/nixpkgs/issues/86054
42+ src = ./fix-qttranslations-path.patch;
43+ inherit qttranslations;
44+ });
45+
3046 buildInputs = [
3147 akonadi-contacts
3248 gpgme
@@ -48,6 +64,14 @@ mkDerivation rec {
4864 gnupg
4965 ];
5066
67+ postPatch = "echo ${version} > src/trojita-version"
68+ + lib.optionalString withI18n ''
69+ mkdir -p po
70+ for f in `find ${l10n} -name "trojita_common.po"`; do
71+ cp $f po/trojita_common_$(echo $f | cut -d/ -f5).po
72+ done
73+ '';
74+
5175 meta = with lib; {
5276 description = "A Qt IMAP e-mail client";
5377 homepage = "http://trojita.flaska.net/";