unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45721] Telegram Desktop
@ 2021-01-08  0:20 Raghav Gururajan
  2021-01-08  0:44 ` [bug#45721] Telegram Desktop (v2) Raghav Gururajan
                   ` (23 more replies)
  0 siblings, 24 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-08  0:20 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 119 bytes --]

Hello Guix!

This patch-series is for adding Telegram-Desktop application and its 
dependencies to Guix.

Regards,
RG.

[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 44a403000c2d4c22b309ec8fed5d123faa355b53 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/19] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index dfd44ac769..82d254db19 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 00e006928e..8b15533841 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.29.2


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 55b963d2526c14d01a34c8d7f3dd7621821a1275 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/19] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.29.2


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 56ae16b466ab7ad0a4e184cec0ea5a4fe3b7b7d9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/19] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.29.2


[-- Attachment #5: 0004-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 3429 bytes --]

From 5b5fcd94a712c06a54922fbc6ece0fa61fc6665a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 15:05:11 -0500
Subject: [PATCH 04/19] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 62 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..7257a4789e 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -37,6 +40,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -48,11 +52,67 @@
   #:use-module (guix build-system python)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ;; ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.29.2


[-- Attachment #6: 0005-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]

From 07d5870df7c944339a0c32ddc8590e883643492b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:16:43 -0500
Subject: [PATCH 05/19] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7257a4789e..1fefbbf560 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -41,6 +42,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -57,6 +59,59 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.29.2


[-- Attachment #7: 0006-gnu-hime-Enable-chewing-support.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

From 25360fda5f657189a3d802435ac9aad0a9d46eab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:19:21 -0500
Subject: [PATCH 06/19] gnu: hime: Enable chewing support.

* gnu/packages/language.scm (hime) [inputs]: Add libchewing.
---
 gnu/packages/language.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 1fefbbf560..e50e157370 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -151,7 +151,7 @@ method, one of the most popular choices for Traditional Chinese users.")
     (inputs
      `(("anthy" ,anthy)
        ("appindicator" ,libappindicator)
-       ;; ("chewing" ,libchewing)
+       ("chewing" ,libchewing)
        ("gtk+" ,gtk+)
        ("qtbase" ,qtbase)
        ("xtst" ,libxtst)))
-- 
2.29.2


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 330afc7d02cfe7b33ad4d795924a1232921b7049 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/19] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.29.2


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From da7d1632f20a46fffcefb8aa1e7bf94d7d303dac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/19] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 0b94063373..aea8ebeeb0 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -71,6 +72,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -102,6 +104,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.29.2


[-- Attachment #10: 0009-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6435 bytes --]

From 7e65598ad7db40d7260eb924a139203266efb026 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 19:32:18 -0500
Subject: [PATCH 09/19] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 127 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index e50e157370..1d1fe94690 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,8 +52,10 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -59,6 +66,126 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.29.2


[-- Attachment #11: 0010-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From 7ea1a965d466de582659bc4a7f94af7cdfa8992d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 10/19] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 8b15533841..491332987b 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.29.2


[-- Attachment #12: 0011-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From d8a64ec656a09f6075a87654da56d7cb06ca9e75 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 11/19] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 491332987b..f92cfe0c26 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.29.2


[-- Attachment #13: 0012-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2312 bytes --]

From b8dcf94a21ab31c7854e08c525283224e77dde6a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 12/19] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index aea8ebeeb0..fac7831ab7 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -104,6 +104,49 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.29.2


[-- Attachment #14: 0013-gnu-libtgvoip-Add-support-for-pkg-config.patch --]
[-- Type: text/x-patch, Size: 4095 bytes --]

From 1acf64c77a0eb29e1c0e5a8af1013578b70901c6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:39:04 -0500
Subject: [PATCH 13/19] gnu: libtgvoip: Add support for pkg-config.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Add libtgvoip-pkgconfig.patch.
[native-inputs]: Add pkg-config.
* gnu/packages/patches/libtgvoip-pkgconfig.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 .../patches/libtgvoip-pkgconfig.patch         | 61 +++++++++++++++++++
 gnu/packages/telephony.scm                    |  5 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libtgvoip-pkgconfig.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 82d254db19..e2e694a833 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1291,6 +1291,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
   %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
   %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
+  %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
   %D%/packages/patches/libtirpc-hurd-client.patch		\
diff --git a/gnu/packages/patches/libtgvoip-pkgconfig.patch b/gnu/packages/patches/libtgvoip-pkgconfig.patch
new file mode 100644
index 0000000000..23794e8d77
--- /dev/null
+++ b/gnu/packages/patches/libtgvoip-pkgconfig.patch
@@ -0,0 +1,61 @@
+From 4ce5e22ed2dc24e9211c4874c1dd6b05faad2a87 Mon Sep 17 00:00:00 2001
+From: Ilya Fedin <fedin-ilja2010@ya.ru>
+Date: Sun, 5 Jan 2020 12:25:31 +0400
+Subject: [PATCH] Add support for pkg-config
+
+---
+ Makefile.am  |  2 ++
+ configure.ac |  4 +++-
+ tgvoip.pc.in | 10 ++++++++++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+ create mode 100644 tgvoip.pc.in
+
+diff --git a/Makefile.am b/Makefile.am
+index 03c8866..a9c9715 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -755,6 +755,8 @@ libtgvoip_la_SOURCES = $(SRC) $(TGVOIP_HDRS)
+ tgvoipincludedir = $(includedir)/tgvoip
+ nobase_tgvoipinclude_HEADERS = $(TGVOIP_HDRS)
+ 
++pkgconfig_DATA = tgvoip.pc
++
+ CXXFLAGS += -std=gnu++0x $(CFLAGS)
+ if TARGET_OS_OSX
+ OBJCFLAGS = $(CFLAGS)
+diff --git a/configure.ac b/configure.ac
+index 222f541..e2df927 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,8 @@ AM_INIT_AUTOMAKE([subdir-objects])
+ AM_SILENT_RULES([yes])
+ LT_INIT
+ 
++PKG_INSTALLDIR
++
+ # Checks for programs.
+ AC_PROG_CXX
+ AC_PROG_CC
+@@ -109,5 +111,5 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_CHECK_FUNCS([clock_gettime floor gettimeofday inet_ntoa memmove memset select socket sqrt strcasecmp strchr strerror strncasecmp strstr strtol strtoul uname])
+ 
+-AC_CONFIG_FILES([Makefile])
++AC_CONFIG_FILES([Makefile tgvoip.pc])
+ AC_OUTPUT
+diff --git a/tgvoip.pc.in b/tgvoip.pc.in
+new file mode 100644
+index 0000000..1ca7758
+--- /dev/null
++++ b/tgvoip.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: tgvoip
++Description: VoIP library for Telegram clients
++Version: 2.4.4
++Libs: -L${libdir} -ltgvoip
++Cflags: -I${includedir}/tgvoip
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..05538762c3 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -879,11 +879,14 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
         (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"))
+                        "libtgvoip-disable-sse2.patch"
+                        "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("libopusenc" ,libopusenc)
-- 
2.29.2


[-- Attachment #15: 0014-gnu-libtgvoip-Remove-obsolete-patches.patch --]
[-- Type: text/x-patch, Size: 6288 bytes --]

From ccacf372a3653f7c7a2ae21b94756a1215dee443 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:53:40 -0500
Subject: [PATCH 14/19] gnu: libtgvoip: Remove obsolete patches.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Remove
libtgvoip-disable-webrtc and "libtgvoip-disable-sse2.
* gnu/packages/patches/libtgvoip-disable-webrtc.patch: Remove file.
* gnu/packages/patches/libtgvoip-disable-sse2.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                  |  2 -
 .../patches/libtgvoip-disable-sse2.patch      | 51 -------------------
 .../patches/libtgvoip-disable-webrtc.patch    | 47 -----------------
 gnu/packages/telephony.scm                    |  7 +--
 4 files changed, 1 insertion(+), 106 deletions(-)
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-sse2.patch
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-webrtc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e2e694a833..bf07b820f2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1289,8 +1289,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
-  %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
-  %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
   %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
diff --git a/gnu/packages/patches/libtgvoip-disable-sse2.patch b/gnu/packages/patches/libtgvoip-disable-sse2.patch
deleted file mode 100644
index 0e4faeab26..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-sse2.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Copied from Debian.
-
-Description: Disable SSE2 code on i386
- This patch is not complete. A high-graded solution may use automatic switching
- between SSE2 and C++ implementations based on the results of runtime checks.
- The webrtc code already provides for one of them inside its GetCPUInfo function.
-Bug-Debian: https://bugs.debian.org/892823
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:38 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -871,11 +871,7 @@
-                 'WEBRTC_POSIX',
-               ],
-               'conditions': [
--                [ '"<!(uname -m)" == "i686"', {
--                  'cflags_cc': [
--                    '-msse2',
--                  ],
--                }], ['"<!(uname -s)" == "Linux"', {
-+                [ '"<!(uname -s)" == "Linux"', {
-                   'defines': [
-                     'WEBRTC_LINUX',
-                   ],
---- a/webrtc_dsp/rtc_base/system/arch.h
-+++ b/webrtc_dsp/rtc_base/system/arch.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
---- a/webrtc_dsp/typedefs.h
-+++ b/webrtc_dsp/typedefs.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
diff --git a/gnu/packages/patches/libtgvoip-disable-webrtc.patch b/gnu/packages/patches/libtgvoip-disable-webrtc.patch
deleted file mode 100644
index 0ca532301c..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-webrtc.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Copied from Debian.
-
-Description: Fix build of  WebRTC on non-Linux systems
- * Define the WEBRTC_LINUX macro only on Linux, and not on GNU/Hurd or FreeBSD.
- * Fix type cast in the CurrentThreadId function.
-Bug-Debian: https://bugs.debian.org/920851
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:44 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -869,20 +869,18 @@
-             '"<(OS)" == "linux"', {
-               'defines': [
-                 'WEBRTC_POSIX',
--                'WEBRTC_LINUX',
-               ],
-               'conditions': [
-                 [ '"<!(uname -m)" == "i686"', {
-                   'cflags_cc': [
-                     '-msse2',
-                   ],
-+                }], ['"<!(uname -s)" == "Linux"', {
-+                  'defines': [
-+                    'WEBRTC_LINUX',
-+                  ],
-                 }]
-               ],
--              'direct_dependent_settings': {
--                'libraries': [
--
--                ],
--              },
-             },
-           ],
-         ],
---- a/webrtc_dsp/rtc_base/platform_thread_types.cc
-+++ b/webrtc_dsp/rtc_base/platform_thread_types.cc
-@@ -31,7 +31,7 @@ PlatformThreadId CurrentThreadId() {
-   return syscall(__NR_gettid);
- #else
-   // Default implementation for nacl and solaris.
--  return reinterpret_cast<pid_t>(pthread_self());
-+  return static_cast<pid_t>(pthread_self());
- #endif
- #endif  // defined(WEBRTC_POSIX)
- }
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 05538762c3..86a24f8fd8 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -874,13 +874,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
              (url "https://github.com/grishka/libtgvoip")
              (commit version)))
        (file-name (git-file-name name version))
-       ;; Fix compilation on i686-linux architecture.
-       ;; NOTE: Applying these patches is order-dependent!
-       ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
-        (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"
-                        "libtgvoip-pkgconfig.patch"))
+        (search-patches "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
-- 
2.29.2


[-- Attachment #16: 0015-gnu-libtgvoip-Remove-obsolete-phase.patch --]
[-- Type: text/x-patch, Size: 1726 bytes --]

From 5a44968a262a6770dc2e94644aacddaee0b14bec Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:58:53 -0500
Subject: [PATCH 15/19] gnu: libtgvoip: Remove obsolete phase.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['patch-dlopen]: Remove phase.
---
 gnu/packages/telephony.scm | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 86a24f8fd8..80e7c141f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -887,23 +887,6 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
        ("pulseaudio" ,pulseaudio)))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
-         ;; they are.
-         (add-after 'unpack 'patch-dlopen
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "os/linux/AudioPulse.cpp"
-               (("libpulse\\.so")
-                (string-append (assoc-ref inputs "pulseaudio")
-                              "/lib/libpulse.so")))
-             (substitute* '("os/linux/AudioInputALSA.cpp"
-                            "os/linux/AudioOutputALSA.cpp")
-               (("libasound\\.so")
-                (string-append (assoc-ref inputs "alsa-lib")
-                               "/lib/libasound.so")))
-             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.29.2


[-- Attachment #17: 0016-gnu-libtgvoip-Bootstrap-the-source.patch --]
[-- Type: text/x-patch, Size: 1728 bytes --]

From cbfaf75570b3adc0821c37ad9d65936abeddebef Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:04:26 -0500
Subject: [PATCH 16/19] gnu: libtgvoip: Bootstrap the source.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['trigger-bootstrap]: New phase.
[native-inputs]: Add autoconf, automake and libtool.
[inputs]: Change libopusenc to opus.
---
 gnu/packages/telephony.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 80e7c141f6..a17c5188f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -881,12 +881,25 @@ Initiation Protocol (SIP) and a multimedia framework.")
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
-       ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
+       ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (for-each delete-file
+                       (list
+                        "configure"
+                        "Makefile.in"))
+             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.29.2


[-- Attachment #18: 0017-gnu-libtgvoip-Disable-static-libraries.patch --]
[-- Type: text/x-patch, Size: 965 bytes --]

From e0d6b2b3ecf5b28598eee7df664c8171780fc020 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:07:59 -0500
Subject: [PATCH 17/19] gnu: libtgvoip: Disable static libraries.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--disable-static]: New flag.
---
 gnu/packages/telephony.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index a17c5188f6..ff1742366e 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -891,7 +891,10 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
     (arguments
-     `(#:phases
+     `(#:configure-flags
+       (list
+        "--disable-static")
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
            (lambda _
-- 
2.29.2


[-- Attachment #19: 0018-gnu-libtgvoip-Enable-audio-callback-feature.patch --]
[-- Type: text/x-patch, Size: 939 bytes --]

From ec2f57d9320ceeccd1345864113fa2837dd28bf1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:09:51 -0500
Subject: [PATCH 18/19] gnu: libtgvoip: Enable audio-callback feature.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--enable-audio-callback]: New flag.
---
 gnu/packages/telephony.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index ff1742366e..79aa2abb62 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -893,7 +893,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (arguments
      `(#:configure-flags
        (list
-        "--disable-static")
+        "--disable-static"
+        "--enable-audio-callback")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
-- 
2.29.2


[-- Attachment #20: 0019-gnu-libtgvoip-Update-home-page.patch --]
[-- Type: text/x-patch, Size: 956 bytes --]

From dc7ba05f38b9a53ebf94ab395655988b2f41583d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:11:49 -0500
Subject: [PATCH 19/19] gnu: libtgvoip: Update home-page.

* gnu/packages/telephony.scm (libtgvoip) [home-page]: Modify.
---
 gnu/packages/telephony.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 79aa2abb62..bdb2fc778b 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -907,5 +907,5 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-    (home-page "https://github.com/zevlg/libtgvoip")
+    (home-page "https://github.com/grishka/libtgvoip")
     (license license:unlicense)))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v2)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
@ 2021-01-08  0:44 ` Raghav Gururajan
  2021-01-12  3:12 ` [bug#45721] Telegram Desktop (v3) Raghav Gururajan
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-08  0:44 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 44a403000c2d4c22b309ec8fed5d123faa355b53 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/20] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index dfd44ac769..82d254db19 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 00e006928e..8b15533841 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.29.2


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 55b963d2526c14d01a34c8d7f3dd7621821a1275 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/20] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.29.2


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 56ae16b466ab7ad0a4e184cec0ea5a4fe3b7b7d9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/20] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.29.2


[-- Attachment #5: 0004-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 3429 bytes --]

From 5b5fcd94a712c06a54922fbc6ece0fa61fc6665a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 15:05:11 -0500
Subject: [PATCH 04/20] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 62 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..7257a4789e 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -37,6 +40,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -48,11 +52,67 @@
   #:use-module (guix build-system python)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ;; ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.29.2


[-- Attachment #6: 0005-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]

From 07d5870df7c944339a0c32ddc8590e883643492b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:16:43 -0500
Subject: [PATCH 05/20] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7257a4789e..1fefbbf560 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -41,6 +42,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -57,6 +59,59 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.29.2


[-- Attachment #7: 0006-gnu-hime-Enable-chewing-support.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

From 25360fda5f657189a3d802435ac9aad0a9d46eab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:19:21 -0500
Subject: [PATCH 06/20] gnu: hime: Enable chewing support.

* gnu/packages/language.scm (hime) [inputs]: Add libchewing.
---
 gnu/packages/language.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 1fefbbf560..e50e157370 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -151,7 +151,7 @@ method, one of the most popular choices for Traditional Chinese users.")
     (inputs
      `(("anthy" ,anthy)
        ("appindicator" ,libappindicator)
-       ;; ("chewing" ,libchewing)
+       ("chewing" ,libchewing)
        ("gtk+" ,gtk+)
        ("qtbase" ,qtbase)
        ("xtst" ,libxtst)))
-- 
2.29.2


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 330afc7d02cfe7b33ad4d795924a1232921b7049 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/20] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.29.2


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From da7d1632f20a46fffcefb8aa1e7bf94d7d303dac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/20] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 0b94063373..aea8ebeeb0 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -71,6 +72,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -102,6 +104,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.29.2


[-- Attachment #10: 0009-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6435 bytes --]

From 7e65598ad7db40d7260eb924a139203266efb026 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 19:32:18 -0500
Subject: [PATCH 09/20] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 127 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index e50e157370..1d1fe94690 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,8 +52,10 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -59,6 +66,126 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.29.2


[-- Attachment #11: 0010-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From 7ea1a965d466de582659bc4a7f94af7cdfa8992d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 10/20] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 8b15533841..491332987b 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.29.2


[-- Attachment #12: 0011-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From d8a64ec656a09f6075a87654da56d7cb06ca9e75 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 11/20] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 491332987b..f92cfe0c26 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.29.2


[-- Attachment #13: 0012-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2312 bytes --]

From b8dcf94a21ab31c7854e08c525283224e77dde6a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 12/20] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index aea8ebeeb0..fac7831ab7 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -104,6 +104,49 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.29.2


[-- Attachment #14: 0013-gnu-libtgvoip-Add-support-for-pkg-config.patch --]
[-- Type: text/x-patch, Size: 4095 bytes --]

From 1acf64c77a0eb29e1c0e5a8af1013578b70901c6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:39:04 -0500
Subject: [PATCH 13/20] gnu: libtgvoip: Add support for pkg-config.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Add libtgvoip-pkgconfig.patch.
[native-inputs]: Add pkg-config.
* gnu/packages/patches/libtgvoip-pkgconfig.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 .../patches/libtgvoip-pkgconfig.patch         | 61 +++++++++++++++++++
 gnu/packages/telephony.scm                    |  5 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libtgvoip-pkgconfig.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 82d254db19..e2e694a833 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1291,6 +1291,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
   %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
   %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
+  %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
   %D%/packages/patches/libtirpc-hurd-client.patch		\
diff --git a/gnu/packages/patches/libtgvoip-pkgconfig.patch b/gnu/packages/patches/libtgvoip-pkgconfig.patch
new file mode 100644
index 0000000000..23794e8d77
--- /dev/null
+++ b/gnu/packages/patches/libtgvoip-pkgconfig.patch
@@ -0,0 +1,61 @@
+From 4ce5e22ed2dc24e9211c4874c1dd6b05faad2a87 Mon Sep 17 00:00:00 2001
+From: Ilya Fedin <fedin-ilja2010@ya.ru>
+Date: Sun, 5 Jan 2020 12:25:31 +0400
+Subject: [PATCH] Add support for pkg-config
+
+---
+ Makefile.am  |  2 ++
+ configure.ac |  4 +++-
+ tgvoip.pc.in | 10 ++++++++++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+ create mode 100644 tgvoip.pc.in
+
+diff --git a/Makefile.am b/Makefile.am
+index 03c8866..a9c9715 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -755,6 +755,8 @@ libtgvoip_la_SOURCES = $(SRC) $(TGVOIP_HDRS)
+ tgvoipincludedir = $(includedir)/tgvoip
+ nobase_tgvoipinclude_HEADERS = $(TGVOIP_HDRS)
+ 
++pkgconfig_DATA = tgvoip.pc
++
+ CXXFLAGS += -std=gnu++0x $(CFLAGS)
+ if TARGET_OS_OSX
+ OBJCFLAGS = $(CFLAGS)
+diff --git a/configure.ac b/configure.ac
+index 222f541..e2df927 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,8 @@ AM_INIT_AUTOMAKE([subdir-objects])
+ AM_SILENT_RULES([yes])
+ LT_INIT
+ 
++PKG_INSTALLDIR
++
+ # Checks for programs.
+ AC_PROG_CXX
+ AC_PROG_CC
+@@ -109,5 +111,5 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_CHECK_FUNCS([clock_gettime floor gettimeofday inet_ntoa memmove memset select socket sqrt strcasecmp strchr strerror strncasecmp strstr strtol strtoul uname])
+ 
+-AC_CONFIG_FILES([Makefile])
++AC_CONFIG_FILES([Makefile tgvoip.pc])
+ AC_OUTPUT
+diff --git a/tgvoip.pc.in b/tgvoip.pc.in
+new file mode 100644
+index 0000000..1ca7758
+--- /dev/null
++++ b/tgvoip.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: tgvoip
++Description: VoIP library for Telegram clients
++Version: 2.4.4
++Libs: -L${libdir} -ltgvoip
++Cflags: -I${includedir}/tgvoip
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..05538762c3 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -879,11 +879,14 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
         (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"))
+                        "libtgvoip-disable-sse2.patch"
+                        "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("libopusenc" ,libopusenc)
-- 
2.29.2


[-- Attachment #15: 0014-gnu-libtgvoip-Remove-obsolete-patches.patch --]
[-- Type: text/x-patch, Size: 6288 bytes --]

From ccacf372a3653f7c7a2ae21b94756a1215dee443 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:53:40 -0500
Subject: [PATCH 14/20] gnu: libtgvoip: Remove obsolete patches.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Remove
libtgvoip-disable-webrtc and "libtgvoip-disable-sse2.
* gnu/packages/patches/libtgvoip-disable-webrtc.patch: Remove file.
* gnu/packages/patches/libtgvoip-disable-sse2.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                  |  2 -
 .../patches/libtgvoip-disable-sse2.patch      | 51 -------------------
 .../patches/libtgvoip-disable-webrtc.patch    | 47 -----------------
 gnu/packages/telephony.scm                    |  7 +--
 4 files changed, 1 insertion(+), 106 deletions(-)
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-sse2.patch
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-webrtc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e2e694a833..bf07b820f2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1289,8 +1289,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
-  %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
-  %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
   %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
diff --git a/gnu/packages/patches/libtgvoip-disable-sse2.patch b/gnu/packages/patches/libtgvoip-disable-sse2.patch
deleted file mode 100644
index 0e4faeab26..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-sse2.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Copied from Debian.
-
-Description: Disable SSE2 code on i386
- This patch is not complete. A high-graded solution may use automatic switching
- between SSE2 and C++ implementations based on the results of runtime checks.
- The webrtc code already provides for one of them inside its GetCPUInfo function.
-Bug-Debian: https://bugs.debian.org/892823
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:38 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -871,11 +871,7 @@
-                 'WEBRTC_POSIX',
-               ],
-               'conditions': [
--                [ '"<!(uname -m)" == "i686"', {
--                  'cflags_cc': [
--                    '-msse2',
--                  ],
--                }], ['"<!(uname -s)" == "Linux"', {
-+                [ '"<!(uname -s)" == "Linux"', {
-                   'defines': [
-                     'WEBRTC_LINUX',
-                   ],
---- a/webrtc_dsp/rtc_base/system/arch.h
-+++ b/webrtc_dsp/rtc_base/system/arch.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
---- a/webrtc_dsp/typedefs.h
-+++ b/webrtc_dsp/typedefs.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
diff --git a/gnu/packages/patches/libtgvoip-disable-webrtc.patch b/gnu/packages/patches/libtgvoip-disable-webrtc.patch
deleted file mode 100644
index 0ca532301c..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-webrtc.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Copied from Debian.
-
-Description: Fix build of  WebRTC on non-Linux systems
- * Define the WEBRTC_LINUX macro only on Linux, and not on GNU/Hurd or FreeBSD.
- * Fix type cast in the CurrentThreadId function.
-Bug-Debian: https://bugs.debian.org/920851
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:44 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -869,20 +869,18 @@
-             '"<(OS)" == "linux"', {
-               'defines': [
-                 'WEBRTC_POSIX',
--                'WEBRTC_LINUX',
-               ],
-               'conditions': [
-                 [ '"<!(uname -m)" == "i686"', {
-                   'cflags_cc': [
-                     '-msse2',
-                   ],
-+                }], ['"<!(uname -s)" == "Linux"', {
-+                  'defines': [
-+                    'WEBRTC_LINUX',
-+                  ],
-                 }]
-               ],
--              'direct_dependent_settings': {
--                'libraries': [
--
--                ],
--              },
-             },
-           ],
-         ],
---- a/webrtc_dsp/rtc_base/platform_thread_types.cc
-+++ b/webrtc_dsp/rtc_base/platform_thread_types.cc
-@@ -31,7 +31,7 @@ PlatformThreadId CurrentThreadId() {
-   return syscall(__NR_gettid);
- #else
-   // Default implementation for nacl and solaris.
--  return reinterpret_cast<pid_t>(pthread_self());
-+  return static_cast<pid_t>(pthread_self());
- #endif
- #endif  // defined(WEBRTC_POSIX)
- }
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 05538762c3..86a24f8fd8 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -874,13 +874,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
              (url "https://github.com/grishka/libtgvoip")
              (commit version)))
        (file-name (git-file-name name version))
-       ;; Fix compilation on i686-linux architecture.
-       ;; NOTE: Applying these patches is order-dependent!
-       ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
-        (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"
-                        "libtgvoip-pkgconfig.patch"))
+        (search-patches "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
-- 
2.29.2


[-- Attachment #16: 0015-gnu-libtgvoip-Remove-obsolete-phase.patch --]
[-- Type: text/x-patch, Size: 1726 bytes --]

From 5a44968a262a6770dc2e94644aacddaee0b14bec Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:58:53 -0500
Subject: [PATCH 15/20] gnu: libtgvoip: Remove obsolete phase.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['patch-dlopen]: Remove phase.
---
 gnu/packages/telephony.scm | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 86a24f8fd8..80e7c141f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -887,23 +887,6 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
        ("pulseaudio" ,pulseaudio)))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
-         ;; they are.
-         (add-after 'unpack 'patch-dlopen
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "os/linux/AudioPulse.cpp"
-               (("libpulse\\.so")
-                (string-append (assoc-ref inputs "pulseaudio")
-                              "/lib/libpulse.so")))
-             (substitute* '("os/linux/AudioInputALSA.cpp"
-                            "os/linux/AudioOutputALSA.cpp")
-               (("libasound\\.so")
-                (string-append (assoc-ref inputs "alsa-lib")
-                               "/lib/libasound.so")))
-             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.29.2


[-- Attachment #17: 0016-gnu-libtgvoip-Bootstrap-the-source.patch --]
[-- Type: text/x-patch, Size: 1728 bytes --]

From cbfaf75570b3adc0821c37ad9d65936abeddebef Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:04:26 -0500
Subject: [PATCH 16/20] gnu: libtgvoip: Bootstrap the source.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['trigger-bootstrap]: New phase.
[native-inputs]: Add autoconf, automake and libtool.
[inputs]: Change libopusenc to opus.
---
 gnu/packages/telephony.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 80e7c141f6..a17c5188f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -881,12 +881,25 @@ Initiation Protocol (SIP) and a multimedia framework.")
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
-       ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
+       ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (for-each delete-file
+                       (list
+                        "configure"
+                        "Makefile.in"))
+             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.29.2


[-- Attachment #18: 0017-gnu-libtgvoip-Disable-static-libraries.patch --]
[-- Type: text/x-patch, Size: 965 bytes --]

From e0d6b2b3ecf5b28598eee7df664c8171780fc020 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:07:59 -0500
Subject: [PATCH 17/20] gnu: libtgvoip: Disable static libraries.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--disable-static]: New flag.
---
 gnu/packages/telephony.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index a17c5188f6..ff1742366e 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -891,7 +891,10 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
     (arguments
-     `(#:phases
+     `(#:configure-flags
+       (list
+        "--disable-static")
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
            (lambda _
-- 
2.29.2


[-- Attachment #19: 0018-gnu-libtgvoip-Enable-audio-callback-feature.patch --]
[-- Type: text/x-patch, Size: 939 bytes --]

From ec2f57d9320ceeccd1345864113fa2837dd28bf1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:09:51 -0500
Subject: [PATCH 18/20] gnu: libtgvoip: Enable audio-callback feature.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--enable-audio-callback]: New flag.
---
 gnu/packages/telephony.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index ff1742366e..79aa2abb62 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -893,7 +893,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (arguments
      `(#:configure-flags
        (list
-        "--disable-static")
+        "--disable-static"
+        "--enable-audio-callback")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
-- 
2.29.2


[-- Attachment #20: 0019-gnu-libtgvoip-Update-home-page.patch --]
[-- Type: text/x-patch, Size: 956 bytes --]

From dc7ba05f38b9a53ebf94ab395655988b2f41583d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:11:49 -0500
Subject: [PATCH 19/20] gnu: libtgvoip: Update home-page.

* gnu/packages/telephony.scm (libtgvoip) [home-page]: Modify.
---
 gnu/packages/telephony.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 79aa2abb62..bdb2fc778b 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -907,5 +907,5 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-    (home-page "https://github.com/zevlg/libtgvoip")
+    (home-page "https://github.com/grishka/libtgvoip")
     (license license:unlicense)))
-- 
2.29.2


[-- Attachment #21: 0020-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 13279 bytes --]

From 5a1e7ad5024fe0c7f08b6411cadb5c2a910d56e8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 20/20] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 314 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 315 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index bf07b820f2..4332f16a82 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -533,6 +533,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..88299c33cb
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,314 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-DTDESKTOP_API_ID=17349"
+        "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb"
+        "-DDESKTOP_APP_DISABLE_WEBRTC_INTEGRATION=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (getcwd))
+                    (cmake_helpers (assoc-ref inputs "cmake_helpers"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib_base (assoc-ref inputs "lib_base"))
+                    (lib_crl (assoc-ref inputs "lib_crl"))
+                    (lib_lottie (assoc-ref inputs "lib_lottie"))
+                    (lib_qr (assoc-ref inputs "lib_qr"))
+                    (lib_rlottie (assoc-ref inputs "lib_rlottie"))
+                    (lib_rpl (assoc-ref inputs "lib_rpl"))
+                    (lib_spellcheck (assoc-ref inputs "lib_spellcheck"))
+                    (lib_storage (assoc-ref inputs "lib_storage"))
+                    (lib_tl (assoc-ref inputs "lib_tl"))
+                    (lib_ui (assoc-ref inputs "lib_ui"))
+                    (lib_webrtc (assoc-ref inputs "lib_webrtc"))
+                    (tgcalls (assoc-ref inputs "tgcalls")))
+               (copy-recursively cmake_helpers (string-append to "/cmake"))
+               (copy-recursively codegen (string-append to "/Telegram/codegen"))
+               (copy-recursively lib_base (string-append to "/Telegram/lib_base"))
+               (copy-recursively lib_crl (string-append to "/Telegram/lib_crl"))
+               (copy-recursively lib_lottie (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively lib_qr (string-append to "/Telegram/lib_qr"))
+               (copy-recursively lib_rlottie (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively lib_rpl (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively lib_spellcheck (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively lib_storage (string-append to "/Telegram/lib_storage"))
+               (copy-recursively lib_tl (string-append to "/Telegram/lib_tl"))
+               (copy-recursively lib_ui (string-append to "/Telegram/lib_ui"))
+               (copy-recursively lib_webrtc (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively tgcalls (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t)))))
+    (native-inputs
+     `(("cmake_helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a")))
+           (file-name
+            (git-file-name "cmake_helpers" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968d")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib_base"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0")))
+           (file-name
+            (git-file-name "lib_base" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib_crl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf")))
+           (file-name
+            (git-file-name "lib_crl" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib_lottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f37")))
+           (file-name
+            (git-file-name "lib_lottie" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib_qr"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a")))
+           (file-name
+            (git-file-name "lib_qr" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib_rlottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf7")))
+           (file-name
+            (git-file-name "lib_rlottie" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib_rpl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b9639")))
+           (file-name
+            (git-file-name "lib_rpl" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib_spellcheck"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b3")))
+           (file-name
+            (git-file-name "lib_spellcheck" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib_storage"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe5172")))
+           (file-name
+            (git-file-name "lib_storage" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib_tl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d")))
+           (file-name
+            (git-file-name "lib_tl" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib_ui"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e27992")))
+           (file-name
+            (git-file-name "lib_ui" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib_webrtc"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6")))
+           (file-name
+            (git-file-name "lib_webrtc" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie)
+       ("tgcalls"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f")))
+           (file-name
+            (git-file-name "tgcalls" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v3)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
  2021-01-08  0:44 ` [bug#45721] Telegram Desktop (v2) Raghav Gururajan
@ 2021-01-12  3:12 ` Raghav Gururajan
  2021-01-12  3:27 ` [bug#45721] Telegram Desktop (v4) Raghav Gururajan
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-12  3:12 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 38565437775ee43e1c64e9f36893926ceb7428c3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/21] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1151d4642e..da83bc59d6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 3b1a649be20575a8e13cb8d86992b93fbfed557e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/21] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From a1be34b8d76fe0d6855d78cf2997ea0ebea3060c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/21] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 3429 bytes --]

From 47df40611bbd6a8a065913f7b2d058d95a138516 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 15:05:11 -0500
Subject: [PATCH 04/21] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 62 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..7257a4789e 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -37,6 +40,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -48,11 +52,67 @@
   #:use-module (guix build-system python)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ;; ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]

From c48093f2c55d3036af6de0816bb9f6cbcb211f60 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:16:43 -0500
Subject: [PATCH 05/21] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7257a4789e..1fefbbf560 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -41,6 +42,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -57,6 +59,59 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-hime-Enable-chewing-support.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

From 8c8cda3a33177fe2e88bc73f6d1f56a8c560e514 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:19:21 -0500
Subject: [PATCH 06/21] gnu: hime: Enable chewing support.

* gnu/packages/language.scm (hime) [inputs]: Add libchewing.
---
 gnu/packages/language.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 1fefbbf560..e50e157370 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -151,7 +151,7 @@ method, one of the most popular choices for Traditional Chinese users.")
     (inputs
      `(("anthy" ,anthy)
        ("appindicator" ,libappindicator)
-       ;; ("chewing" ,libchewing)
+       ("chewing" ,libchewing)
        ("gtk+" ,gtk+)
        ("qtbase" ,qtbase)
        ("xtst" ,libxtst)))
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From b759a5480592278fcb9f112229a5eaca4ef56248 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/21] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From 6b348e064818062e9284e7ddcfcc0d9fbf8a83d5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/21] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6435 bytes --]

From a43b015b857e38e2d79ae6a5aab20d9d0ea1fd6d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 19:32:18 -0500
Subject: [PATCH 09/21] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 127 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index e50e157370..1d1fe94690 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,8 +52,10 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -59,6 +66,126 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From 9a22566adde1ca4fd6be81b5324479f3d4e51f85 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 10/21] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From ed415d768e68d78f92717159899c071ad0173586 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 11/21] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2312 bytes --]

From ba1b08dd2128ac9a802039bbcfbeee72849f1bfc Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 12/21] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..cd24f2c319 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,49 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #14: 0013-gnu-libtgvoip-Add-support-for-pkg-config.patch --]
[-- Type: text/x-patch, Size: 4095 bytes --]

From bf946ce55d62753e1e2e6c7716ef3c959d18425a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:39:04 -0500
Subject: [PATCH 13/21] gnu: libtgvoip: Add support for pkg-config.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Add libtgvoip-pkgconfig.patch.
[native-inputs]: Add pkg-config.
* gnu/packages/patches/libtgvoip-pkgconfig.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 .../patches/libtgvoip-pkgconfig.patch         | 61 +++++++++++++++++++
 gnu/packages/telephony.scm                    |  5 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libtgvoip-pkgconfig.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index da83bc59d6..e4bd7ab718 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1291,6 +1291,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
   %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
   %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
+  %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
   %D%/packages/patches/libtirpc-hurd-client.patch		\
diff --git a/gnu/packages/patches/libtgvoip-pkgconfig.patch b/gnu/packages/patches/libtgvoip-pkgconfig.patch
new file mode 100644
index 0000000000..23794e8d77
--- /dev/null
+++ b/gnu/packages/patches/libtgvoip-pkgconfig.patch
@@ -0,0 +1,61 @@
+From 4ce5e22ed2dc24e9211c4874c1dd6b05faad2a87 Mon Sep 17 00:00:00 2001
+From: Ilya Fedin <fedin-ilja2010@ya.ru>
+Date: Sun, 5 Jan 2020 12:25:31 +0400
+Subject: [PATCH] Add support for pkg-config
+
+---
+ Makefile.am  |  2 ++
+ configure.ac |  4 +++-
+ tgvoip.pc.in | 10 ++++++++++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+ create mode 100644 tgvoip.pc.in
+
+diff --git a/Makefile.am b/Makefile.am
+index 03c8866..a9c9715 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -755,6 +755,8 @@ libtgvoip_la_SOURCES = $(SRC) $(TGVOIP_HDRS)
+ tgvoipincludedir = $(includedir)/tgvoip
+ nobase_tgvoipinclude_HEADERS = $(TGVOIP_HDRS)
+ 
++pkgconfig_DATA = tgvoip.pc
++
+ CXXFLAGS += -std=gnu++0x $(CFLAGS)
+ if TARGET_OS_OSX
+ OBJCFLAGS = $(CFLAGS)
+diff --git a/configure.ac b/configure.ac
+index 222f541..e2df927 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,8 @@ AM_INIT_AUTOMAKE([subdir-objects])
+ AM_SILENT_RULES([yes])
+ LT_INIT
+ 
++PKG_INSTALLDIR
++
+ # Checks for programs.
+ AC_PROG_CXX
+ AC_PROG_CC
+@@ -109,5 +111,5 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_CHECK_FUNCS([clock_gettime floor gettimeofday inet_ntoa memmove memset select socket sqrt strcasecmp strchr strerror strncasecmp strstr strtol strtoul uname])
+ 
+-AC_CONFIG_FILES([Makefile])
++AC_CONFIG_FILES([Makefile tgvoip.pc])
+ AC_OUTPUT
+diff --git a/tgvoip.pc.in b/tgvoip.pc.in
+new file mode 100644
+index 0000000..1ca7758
+--- /dev/null
++++ b/tgvoip.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: tgvoip
++Description: VoIP library for Telegram clients
++Version: 2.4.4
++Libs: -L${libdir} -ltgvoip
++Cflags: -I${includedir}/tgvoip
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..05538762c3 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -879,11 +879,14 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
         (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"))
+                        "libtgvoip-disable-sse2.patch"
+                        "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("libopusenc" ,libopusenc)
-- 
2.30.0


[-- Attachment #15: 0014-gnu-libtgvoip-Remove-obsolete-patches.patch --]
[-- Type: text/x-patch, Size: 6288 bytes --]

From 013b78ed97e7d5bd18382dd344529ddc069b5638 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:53:40 -0500
Subject: [PATCH 14/21] gnu: libtgvoip: Remove obsolete patches.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Remove
libtgvoip-disable-webrtc and "libtgvoip-disable-sse2.
* gnu/packages/patches/libtgvoip-disable-webrtc.patch: Remove file.
* gnu/packages/patches/libtgvoip-disable-sse2.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                  |  2 -
 .../patches/libtgvoip-disable-sse2.patch      | 51 -------------------
 .../patches/libtgvoip-disable-webrtc.patch    | 47 -----------------
 gnu/packages/telephony.scm                    |  7 +--
 4 files changed, 1 insertion(+), 106 deletions(-)
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-sse2.patch
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-webrtc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e4bd7ab718..00f07986f7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1289,8 +1289,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
-  %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
-  %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
   %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
diff --git a/gnu/packages/patches/libtgvoip-disable-sse2.patch b/gnu/packages/patches/libtgvoip-disable-sse2.patch
deleted file mode 100644
index 0e4faeab26..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-sse2.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Copied from Debian.
-
-Description: Disable SSE2 code on i386
- This patch is not complete. A high-graded solution may use automatic switching
- between SSE2 and C++ implementations based on the results of runtime checks.
- The webrtc code already provides for one of them inside its GetCPUInfo function.
-Bug-Debian: https://bugs.debian.org/892823
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:38 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -871,11 +871,7 @@
-                 'WEBRTC_POSIX',
-               ],
-               'conditions': [
--                [ '"<!(uname -m)" == "i686"', {
--                  'cflags_cc': [
--                    '-msse2',
--                  ],
--                }], ['"<!(uname -s)" == "Linux"', {
-+                [ '"<!(uname -s)" == "Linux"', {
-                   'defines': [
-                     'WEBRTC_LINUX',
-                   ],
---- a/webrtc_dsp/rtc_base/system/arch.h
-+++ b/webrtc_dsp/rtc_base/system/arch.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
---- a/webrtc_dsp/typedefs.h
-+++ b/webrtc_dsp/typedefs.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
diff --git a/gnu/packages/patches/libtgvoip-disable-webrtc.patch b/gnu/packages/patches/libtgvoip-disable-webrtc.patch
deleted file mode 100644
index 0ca532301c..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-webrtc.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Copied from Debian.
-
-Description: Fix build of  WebRTC on non-Linux systems
- * Define the WEBRTC_LINUX macro only on Linux, and not on GNU/Hurd or FreeBSD.
- * Fix type cast in the CurrentThreadId function.
-Bug-Debian: https://bugs.debian.org/920851
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:44 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -869,20 +869,18 @@
-             '"<(OS)" == "linux"', {
-               'defines': [
-                 'WEBRTC_POSIX',
--                'WEBRTC_LINUX',
-               ],
-               'conditions': [
-                 [ '"<!(uname -m)" == "i686"', {
-                   'cflags_cc': [
-                     '-msse2',
-                   ],
-+                }], ['"<!(uname -s)" == "Linux"', {
-+                  'defines': [
-+                    'WEBRTC_LINUX',
-+                  ],
-                 }]
-               ],
--              'direct_dependent_settings': {
--                'libraries': [
--
--                ],
--              },
-             },
-           ],
-         ],
---- a/webrtc_dsp/rtc_base/platform_thread_types.cc
-+++ b/webrtc_dsp/rtc_base/platform_thread_types.cc
-@@ -31,7 +31,7 @@ PlatformThreadId CurrentThreadId() {
-   return syscall(__NR_gettid);
- #else
-   // Default implementation for nacl and solaris.
--  return reinterpret_cast<pid_t>(pthread_self());
-+  return static_cast<pid_t>(pthread_self());
- #endif
- #endif  // defined(WEBRTC_POSIX)
- }
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 05538762c3..86a24f8fd8 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -874,13 +874,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
              (url "https://github.com/grishka/libtgvoip")
              (commit version)))
        (file-name (git-file-name name version))
-       ;; Fix compilation on i686-linux architecture.
-       ;; NOTE: Applying these patches is order-dependent!
-       ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
-        (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"
-                        "libtgvoip-pkgconfig.patch"))
+        (search-patches "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
-- 
2.30.0


[-- Attachment #16: 0015-gnu-libtgvoip-Remove-obsolete-phase.patch --]
[-- Type: text/x-patch, Size: 1726 bytes --]

From a2d71ca04893393aaac035c229a9f8ce98563a5f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:58:53 -0500
Subject: [PATCH 15/21] gnu: libtgvoip: Remove obsolete phase.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['patch-dlopen]: Remove phase.
---
 gnu/packages/telephony.scm | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 86a24f8fd8..80e7c141f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -887,23 +887,6 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
        ("pulseaudio" ,pulseaudio)))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
-         ;; they are.
-         (add-after 'unpack 'patch-dlopen
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "os/linux/AudioPulse.cpp"
-               (("libpulse\\.so")
-                (string-append (assoc-ref inputs "pulseaudio")
-                              "/lib/libpulse.so")))
-             (substitute* '("os/linux/AudioInputALSA.cpp"
-                            "os/linux/AudioOutputALSA.cpp")
-               (("libasound\\.so")
-                (string-append (assoc-ref inputs "alsa-lib")
-                               "/lib/libasound.so")))
-             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.30.0


[-- Attachment #17: 0016-gnu-libtgvoip-Bootstrap-the-source.patch --]
[-- Type: text/x-patch, Size: 1728 bytes --]

From 0b412b2704b97faba0ca2f9bef0303be1e93670b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:04:26 -0500
Subject: [PATCH 16/21] gnu: libtgvoip: Bootstrap the source.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['trigger-bootstrap]: New phase.
[native-inputs]: Add autoconf, automake and libtool.
[inputs]: Change libopusenc to opus.
---
 gnu/packages/telephony.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 80e7c141f6..a17c5188f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -881,12 +881,25 @@ Initiation Protocol (SIP) and a multimedia framework.")
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
-       ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
+       ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (for-each delete-file
+                       (list
+                        "configure"
+                        "Makefile.in"))
+             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.30.0


[-- Attachment #18: 0017-gnu-libtgvoip-Disable-static-libraries.patch --]
[-- Type: text/x-patch, Size: 965 bytes --]

From 6b8be418e63829ca46a56d541309f8a35551ebab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:07:59 -0500
Subject: [PATCH 17/21] gnu: libtgvoip: Disable static libraries.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--disable-static]: New flag.
---
 gnu/packages/telephony.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index a17c5188f6..ff1742366e 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -891,7 +891,10 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
     (arguments
-     `(#:phases
+     `(#:configure-flags
+       (list
+        "--disable-static")
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
            (lambda _
-- 
2.30.0


[-- Attachment #19: 0018-gnu-libtgvoip-Enable-audio-callback-feature.patch --]
[-- Type: text/x-patch, Size: 939 bytes --]

From 154367fdfd49a54f8eefe3f481e31bad8accdf4b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:09:51 -0500
Subject: [PATCH 18/21] gnu: libtgvoip: Enable audio-callback feature.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--enable-audio-callback]: New flag.
---
 gnu/packages/telephony.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index ff1742366e..79aa2abb62 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -893,7 +893,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (arguments
      `(#:configure-flags
        (list
-        "--disable-static")
+        "--disable-static"
+        "--enable-audio-callback")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
-- 
2.30.0


[-- Attachment #20: 0019-gnu-libtgvoip-Update-home-page.patch --]
[-- Type: text/x-patch, Size: 956 bytes --]

From aa28c1ec8038fbee7bb10568fdf6583b7ff962a1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:11:49 -0500
Subject: [PATCH 19/21] gnu: libtgvoip: Update home-page.

* gnu/packages/telephony.scm (libtgvoip) [home-page]: Modify.
---
 gnu/packages/telephony.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 79aa2abb62..bdb2fc778b 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -907,5 +907,5 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-    (home-page "https://github.com/zevlg/libtgvoip")
+    (home-page "https://github.com/grishka/libtgvoip")
     (license license:unlicense)))
-- 
2.30.0


[-- Attachment #21: 0020-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2737 bytes --]

From d087fe5b8da32060bab7a463e743b9341342ad64 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 20/21] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 50 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index bdb2fc778b..2f9d2c8cc6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,54 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "10b988a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "12wwj1hgmklpxs1m0mx6xa2a3n6prfvi539kx444pny31440nhpj"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC"
+        "-DBUILD_SHARED_LIBS=ON"
+        "-DTG_OWT_USE_PROTOBUF=ON")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #22: 0021-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 13251 bytes --]

From 1be410f80350bec7c09f7f75136ac13c93bb7856 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 21/21] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 314 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 315 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 00f07986f7..788f1d736e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..72a1fa1b62
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,314 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-DTDESKTOP_API_ID=17349"
+        "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (getcwd))
+                    (cmake_helpers (assoc-ref inputs "cmake_helpers"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib_base (assoc-ref inputs "lib_base"))
+                    (lib_crl (assoc-ref inputs "lib_crl"))
+                    (lib_lottie (assoc-ref inputs "lib_lottie"))
+                    (lib_qr (assoc-ref inputs "lib_qr"))
+                    (lib_rlottie (assoc-ref inputs "lib_rlottie"))
+                    (lib_rpl (assoc-ref inputs "lib_rpl"))
+                    (lib_spellcheck (assoc-ref inputs "lib_spellcheck"))
+                    (lib_storage (assoc-ref inputs "lib_storage"))
+                    (lib_tl (assoc-ref inputs "lib_tl"))
+                    (lib_ui (assoc-ref inputs "lib_ui"))
+                    (lib_webrtc (assoc-ref inputs "lib_webrtc"))
+                    (tgcalls (assoc-ref inputs "tgcalls")))
+               (copy-recursively cmake_helpers (string-append to "/cmake"))
+               (copy-recursively codegen (string-append to "/Telegram/codegen"))
+               (copy-recursively lib_base (string-append to "/Telegram/lib_base"))
+               (copy-recursively lib_crl (string-append to "/Telegram/lib_crl"))
+               (copy-recursively lib_lottie (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively lib_qr (string-append to "/Telegram/lib_qr"))
+               (copy-recursively lib_rlottie (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively lib_rpl (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively lib_spellcheck (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively lib_storage (string-append to "/Telegram/lib_storage"))
+               (copy-recursively lib_tl (string-append to "/Telegram/lib_tl"))
+               (copy-recursively lib_ui (string-append to "/Telegram/lib_ui"))
+               (copy-recursively lib_webrtc (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively tgcalls (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t)))))
+    (native-inputs
+     `(("cmake_helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a")))
+           (file-name
+            (git-file-name "cmake_helpers" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968d")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib_base"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0")))
+           (file-name
+            (git-file-name "lib_base" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib_crl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf")))
+           (file-name
+            (git-file-name "lib_crl" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib_lottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f37")))
+           (file-name
+            (git-file-name "lib_lottie" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib_qr"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a")))
+           (file-name
+            (git-file-name "lib_qr" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib_rlottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf7")))
+           (file-name
+            (git-file-name "lib_rlottie" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib_rpl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b9639")))
+           (file-name
+            (git-file-name "lib_rpl" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib_spellcheck"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b3")))
+           (file-name
+            (git-file-name "lib_spellcheck" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib_storage"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe5172")))
+           (file-name
+            (git-file-name "lib_storage" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib_tl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d")))
+           (file-name
+            (git-file-name "lib_tl" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib_ui"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e27992")))
+           (file-name
+            (git-file-name "lib_ui" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib_webrtc"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6")))
+           (file-name
+            (git-file-name "lib_webrtc" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("tgcalls"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f")))
+           (file-name
+            (git-file-name "tgcalls" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v4)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
  2021-01-08  0:44 ` [bug#45721] Telegram Desktop (v2) Raghav Gururajan
  2021-01-12  3:12 ` [bug#45721] Telegram Desktop (v3) Raghav Gururajan
@ 2021-01-12  3:27 ` Raghav Gururajan
  2021-01-13 22:13 ` [bug#45721] Telegram Desktop (v5) Raghav Gururajan
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-12  3:27 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 38565437775ee43e1c64e9f36893926ceb7428c3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/21] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1151d4642e..da83bc59d6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 3b1a649be20575a8e13cb8d86992b93fbfed557e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/21] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From a1be34b8d76fe0d6855d78cf2997ea0ebea3060c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/21] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 3429 bytes --]

From 47df40611bbd6a8a065913f7b2d058d95a138516 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 15:05:11 -0500
Subject: [PATCH 04/21] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 62 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..7257a4789e 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -37,6 +40,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -48,11 +52,67 @@
   #:use-module (guix build-system python)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ;; ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]

From c48093f2c55d3036af6de0816bb9f6cbcb211f60 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:16:43 -0500
Subject: [PATCH 05/21] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7257a4789e..1fefbbf560 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -41,6 +42,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -57,6 +59,59 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-hime-Enable-chewing-support.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

From 8c8cda3a33177fe2e88bc73f6d1f56a8c560e514 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:19:21 -0500
Subject: [PATCH 06/21] gnu: hime: Enable chewing support.

* gnu/packages/language.scm (hime) [inputs]: Add libchewing.
---
 gnu/packages/language.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 1fefbbf560..e50e157370 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -151,7 +151,7 @@ method, one of the most popular choices for Traditional Chinese users.")
     (inputs
      `(("anthy" ,anthy)
        ("appindicator" ,libappindicator)
-       ;; ("chewing" ,libchewing)
+       ("chewing" ,libchewing)
        ("gtk+" ,gtk+)
        ("qtbase" ,qtbase)
        ("xtst" ,libxtst)))
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From b759a5480592278fcb9f112229a5eaca4ef56248 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/21] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From 6b348e064818062e9284e7ddcfcc0d9fbf8a83d5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/21] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6435 bytes --]

From a43b015b857e38e2d79ae6a5aab20d9d0ea1fd6d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 19:32:18 -0500
Subject: [PATCH 09/21] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 127 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index e50e157370..1d1fe94690 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,8 +52,10 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -59,6 +66,126 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From 9a22566adde1ca4fd6be81b5324479f3d4e51f85 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 10/21] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From ed415d768e68d78f92717159899c071ad0173586 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 11/21] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2312 bytes --]

From ba1b08dd2128ac9a802039bbcfbeee72849f1bfc Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 12/21] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..cd24f2c319 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,49 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #14: 0013-gnu-libtgvoip-Add-support-for-pkg-config.patch --]
[-- Type: text/x-patch, Size: 4095 bytes --]

From bf946ce55d62753e1e2e6c7716ef3c959d18425a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:39:04 -0500
Subject: [PATCH 13/21] gnu: libtgvoip: Add support for pkg-config.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Add libtgvoip-pkgconfig.patch.
[native-inputs]: Add pkg-config.
* gnu/packages/patches/libtgvoip-pkgconfig.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 .../patches/libtgvoip-pkgconfig.patch         | 61 +++++++++++++++++++
 gnu/packages/telephony.scm                    |  5 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libtgvoip-pkgconfig.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index da83bc59d6..e4bd7ab718 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1291,6 +1291,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
   %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
   %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
+  %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
   %D%/packages/patches/libtirpc-hurd-client.patch		\
diff --git a/gnu/packages/patches/libtgvoip-pkgconfig.patch b/gnu/packages/patches/libtgvoip-pkgconfig.patch
new file mode 100644
index 0000000000..23794e8d77
--- /dev/null
+++ b/gnu/packages/patches/libtgvoip-pkgconfig.patch
@@ -0,0 +1,61 @@
+From 4ce5e22ed2dc24e9211c4874c1dd6b05faad2a87 Mon Sep 17 00:00:00 2001
+From: Ilya Fedin <fedin-ilja2010@ya.ru>
+Date: Sun, 5 Jan 2020 12:25:31 +0400
+Subject: [PATCH] Add support for pkg-config
+
+---
+ Makefile.am  |  2 ++
+ configure.ac |  4 +++-
+ tgvoip.pc.in | 10 ++++++++++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+ create mode 100644 tgvoip.pc.in
+
+diff --git a/Makefile.am b/Makefile.am
+index 03c8866..a9c9715 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -755,6 +755,8 @@ libtgvoip_la_SOURCES = $(SRC) $(TGVOIP_HDRS)
+ tgvoipincludedir = $(includedir)/tgvoip
+ nobase_tgvoipinclude_HEADERS = $(TGVOIP_HDRS)
+ 
++pkgconfig_DATA = tgvoip.pc
++
+ CXXFLAGS += -std=gnu++0x $(CFLAGS)
+ if TARGET_OS_OSX
+ OBJCFLAGS = $(CFLAGS)
+diff --git a/configure.ac b/configure.ac
+index 222f541..e2df927 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,8 @@ AM_INIT_AUTOMAKE([subdir-objects])
+ AM_SILENT_RULES([yes])
+ LT_INIT
+ 
++PKG_INSTALLDIR
++
+ # Checks for programs.
+ AC_PROG_CXX
+ AC_PROG_CC
+@@ -109,5 +111,5 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_CHECK_FUNCS([clock_gettime floor gettimeofday inet_ntoa memmove memset select socket sqrt strcasecmp strchr strerror strncasecmp strstr strtol strtoul uname])
+ 
+-AC_CONFIG_FILES([Makefile])
++AC_CONFIG_FILES([Makefile tgvoip.pc])
+ AC_OUTPUT
+diff --git a/tgvoip.pc.in b/tgvoip.pc.in
+new file mode 100644
+index 0000000..1ca7758
+--- /dev/null
++++ b/tgvoip.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: tgvoip
++Description: VoIP library for Telegram clients
++Version: 2.4.4
++Libs: -L${libdir} -ltgvoip
++Cflags: -I${includedir}/tgvoip
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..05538762c3 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -879,11 +879,14 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
         (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"))
+                        "libtgvoip-disable-sse2.patch"
+                        "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("libopusenc" ,libopusenc)
-- 
2.30.0


[-- Attachment #15: 0014-gnu-libtgvoip-Remove-obsolete-patches.patch --]
[-- Type: text/x-patch, Size: 6288 bytes --]

From 013b78ed97e7d5bd18382dd344529ddc069b5638 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:53:40 -0500
Subject: [PATCH 14/21] gnu: libtgvoip: Remove obsolete patches.

* gnu/packages/telephony.scm (libtgvoip) [patches]: Remove
libtgvoip-disable-webrtc and "libtgvoip-disable-sse2.
* gnu/packages/patches/libtgvoip-disable-webrtc.patch: Remove file.
* gnu/packages/patches/libtgvoip-disable-sse2.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                  |  2 -
 .../patches/libtgvoip-disable-sse2.patch      | 51 -------------------
 .../patches/libtgvoip-disable-webrtc.patch    | 47 -----------------
 gnu/packages/telephony.scm                    |  7 +--
 4 files changed, 1 insertion(+), 106 deletions(-)
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-sse2.patch
 delete mode 100644 gnu/packages/patches/libtgvoip-disable-webrtc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e4bd7ab718..00f07986f7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1289,8 +1289,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch 		\
-  %D%/packages/patches/libtgvoip-disable-sse2.patch 		\
-  %D%/packages/patches/libtgvoip-disable-webrtc.patch 		\
   %D%/packages/patches/libtgvoip-pkgconfig.patch             \
   %D%/packages/patches/libtheora-config-guess.patch		\
   %D%/packages/patches/libtirpc-hurd.patch			\
diff --git a/gnu/packages/patches/libtgvoip-disable-sse2.patch b/gnu/packages/patches/libtgvoip-disable-sse2.patch
deleted file mode 100644
index 0e4faeab26..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-sse2.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Copied from Debian.
-
-Description: Disable SSE2 code on i386
- This patch is not complete. A high-graded solution may use automatic switching
- between SSE2 and C++ implementations based on the results of runtime checks.
- The webrtc code already provides for one of them inside its GetCPUInfo function.
-Bug-Debian: https://bugs.debian.org/892823
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:38 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -871,11 +871,7 @@
-                 'WEBRTC_POSIX',
-               ],
-               'conditions': [
--                [ '"<!(uname -m)" == "i686"', {
--                  'cflags_cc': [
--                    '-msse2',
--                  ],
--                }], ['"<!(uname -s)" == "Linux"', {
-+                [ '"<!(uname -s)" == "Linux"', {
-                   'defines': [
-                     'WEBRTC_LINUX',
-                   ],
---- a/webrtc_dsp/rtc_base/system/arch.h
-+++ b/webrtc_dsp/rtc_base/system/arch.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
---- a/webrtc_dsp/typedefs.h
-+++ b/webrtc_dsp/typedefs.h
-@@ -28,7 +28,10 @@
- #define WEBRTC_ARCH_64_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #elif defined(_M_IX86) || defined(__i386__)
-+#if defined(__SSE2__)
-+// This macro is mostly used to detect SSE2 extension.
- #define WEBRTC_ARCH_X86_FAMILY
-+#endif
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
diff --git a/gnu/packages/patches/libtgvoip-disable-webrtc.patch b/gnu/packages/patches/libtgvoip-disable-webrtc.patch
deleted file mode 100644
index 0ca532301c..0000000000
--- a/gnu/packages/patches/libtgvoip-disable-webrtc.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Copied from Debian.
-
-Description: Fix build of  WebRTC on non-Linux systems
- * Define the WEBRTC_LINUX macro only on Linux, and not on GNU/Hurd or FreeBSD.
- * Fix type cast in the CurrentThreadId function.
-Bug-Debian: https://bugs.debian.org/920851
-Author: Nicholas Guriev <guriev-ns@ya.ru>
-Last-Update: Tue, 29 Jan 2019 23:26:44 +0300
-
---- a/libtgvoip.gyp
-+++ b/libtgvoip.gyp
-@@ -869,20 +869,18 @@
-             '"<(OS)" == "linux"', {
-               'defines': [
-                 'WEBRTC_POSIX',
--                'WEBRTC_LINUX',
-               ],
-               'conditions': [
-                 [ '"<!(uname -m)" == "i686"', {
-                   'cflags_cc': [
-                     '-msse2',
-                   ],
-+                }], ['"<!(uname -s)" == "Linux"', {
-+                  'defines': [
-+                    'WEBRTC_LINUX',
-+                  ],
-                 }]
-               ],
--              'direct_dependent_settings': {
--                'libraries': [
--
--                ],
--              },
-             },
-           ],
-         ],
---- a/webrtc_dsp/rtc_base/platform_thread_types.cc
-+++ b/webrtc_dsp/rtc_base/platform_thread_types.cc
-@@ -31,7 +31,7 @@ PlatformThreadId CurrentThreadId() {
-   return syscall(__NR_gettid);
- #else
-   // Default implementation for nacl and solaris.
--  return reinterpret_cast<pid_t>(pthread_self());
-+  return static_cast<pid_t>(pthread_self());
- #endif
- #endif  // defined(WEBRTC_POSIX)
- }
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 05538762c3..86a24f8fd8 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -874,13 +874,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
              (url "https://github.com/grishka/libtgvoip")
              (commit version)))
        (file-name (git-file-name name version))
-       ;; Fix compilation on i686-linux architecture.
-       ;; NOTE: Applying these patches is order-dependent!
-       ;; The patch for WebRTC /must/ precede the patch for SSE2.
        (patches
-        (search-patches "libtgvoip-disable-webrtc.patch"
-                        "libtgvoip-disable-sse2.patch"
-                        "libtgvoip-pkgconfig.patch"))
+        (search-patches "libtgvoip-pkgconfig.patch"))
        (sha256
         (base32
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
-- 
2.30.0


[-- Attachment #16: 0015-gnu-libtgvoip-Remove-obsolete-phase.patch --]
[-- Type: text/x-patch, Size: 1726 bytes --]

From a2d71ca04893393aaac035c229a9f8ce98563a5f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 04:58:53 -0500
Subject: [PATCH 15/21] gnu: libtgvoip: Remove obsolete phase.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['patch-dlopen]: Remove phase.
---
 gnu/packages/telephony.scm | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 86a24f8fd8..80e7c141f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -887,23 +887,6 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
        ("pulseaudio" ,pulseaudio)))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
-         ;; they are.
-         (add-after 'unpack 'patch-dlopen
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "os/linux/AudioPulse.cpp"
-               (("libpulse\\.so")
-                (string-append (assoc-ref inputs "pulseaudio")
-                              "/lib/libpulse.so")))
-             (substitute* '("os/linux/AudioInputALSA.cpp"
-                            "os/linux/AudioOutputALSA.cpp")
-               (("libasound\\.so")
-                (string-append (assoc-ref inputs "alsa-lib")
-                               "/lib/libasound.so")))
-             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.30.0


[-- Attachment #17: 0016-gnu-libtgvoip-Bootstrap-the-source.patch --]
[-- Type: text/x-patch, Size: 1728 bytes --]

From 0b412b2704b97faba0ca2f9bef0303be1e93670b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:04:26 -0500
Subject: [PATCH 16/21] gnu: libtgvoip: Bootstrap the source.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:phases>
['trigger-bootstrap]: New phase.
[native-inputs]: Add autoconf, automake and libtool.
[inputs]: Change libopusenc to opus.
---
 gnu/packages/telephony.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 80e7c141f6..a17c5188f6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -881,12 +881,25 @@ Initiation Protocol (SIP) and a multimedia framework.")
          "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
     (inputs
      `(("alsa-lib" ,alsa-lib)
-       ("libopusenc" ,libopusenc)
        ("openssl" ,openssl)
+       ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (for-each delete-file
+                       (list
+                        "configure"
+                        "Makefile.in"))
+             #t)))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.30.0


[-- Attachment #18: 0017-gnu-libtgvoip-Disable-static-libraries.patch --]
[-- Type: text/x-patch, Size: 965 bytes --]

From 6b8be418e63829ca46a56d541309f8a35551ebab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:07:59 -0500
Subject: [PATCH 17/21] gnu: libtgvoip: Disable static libraries.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--disable-static]: New flag.
---
 gnu/packages/telephony.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index a17c5188f6..ff1742366e 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -891,7 +891,10 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("opus" ,opus)
        ("pulseaudio" ,pulseaudio)))
     (arguments
-     `(#:phases
+     `(#:configure-flags
+       (list
+        "--disable-static")
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
            (lambda _
-- 
2.30.0


[-- Attachment #19: 0018-gnu-libtgvoip-Enable-audio-callback-feature.patch --]
[-- Type: text/x-patch, Size: 939 bytes --]

From 154367fdfd49a54f8eefe3f481e31bad8accdf4b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:09:51 -0500
Subject: [PATCH 18/21] gnu: libtgvoip: Enable audio-callback feature.

* gnu/packages/telephony.scm (libtgvoip) [arguments]<#:configure-flags>
[--enable-audio-callback]: New flag.
---
 gnu/packages/telephony.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index ff1742366e..79aa2abb62 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -893,7 +893,8 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (arguments
      `(#:configure-flags
        (list
-        "--disable-static")
+        "--disable-static"
+        "--enable-audio-callback")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'trigger-bootstrap
-- 
2.30.0


[-- Attachment #20: 0019-gnu-libtgvoip-Update-home-page.patch --]
[-- Type: text/x-patch, Size: 956 bytes --]

From aa28c1ec8038fbee7bb10568fdf6583b7ff962a1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 6 Jan 2021 05:11:49 -0500
Subject: [PATCH 19/21] gnu: libtgvoip: Update home-page.

* gnu/packages/telephony.scm (libtgvoip) [home-page]: Modify.
---
 gnu/packages/telephony.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 79aa2abb62..bdb2fc778b 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -907,5 +907,5 @@ Initiation Protocol (SIP) and a multimedia framework.")
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-    (home-page "https://github.com/zevlg/libtgvoip")
+    (home-page "https://github.com/grishka/libtgvoip")
     (license license:unlicense)))
-- 
2.30.0


[-- Attachment #21: 0020-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2737 bytes --]

From d087fe5b8da32060bab7a463e743b9341342ad64 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 20/21] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 50 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index bdb2fc778b..2f9d2c8cc6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,54 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "10b988a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "12wwj1hgmklpxs1m0mx6xa2a3n6prfvi539kx444pny31440nhpj"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC"
+        "-DBUILD_SHARED_LIBS=ON"
+        "-DTG_OWT_USE_PROTOBUF=ON")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #22: 0021-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 13486 bytes --]

From 8a4e96b452dc705984d438ec425bbd96cbb3d9cd Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 21/21] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 321 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 322 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 00f07986f7..788f1d736e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..513f2246df
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,321 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-DTDESKTOP_API_ID=17349"
+        "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (getcwd))
+                    (cmake_helpers (assoc-ref inputs "cmake_helpers"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib_base (assoc-ref inputs "lib_base"))
+                    (lib_crl (assoc-ref inputs "lib_crl"))
+                    (lib_lottie (assoc-ref inputs "lib_lottie"))
+                    (lib_qr (assoc-ref inputs "lib_qr"))
+                    (lib_rlottie (assoc-ref inputs "lib_rlottie"))
+                    (lib_rpl (assoc-ref inputs "lib_rpl"))
+                    (lib_spellcheck (assoc-ref inputs "lib_spellcheck"))
+                    (lib_storage (assoc-ref inputs "lib_storage"))
+                    (lib_tl (assoc-ref inputs "lib_tl"))
+                    (lib_ui (assoc-ref inputs "lib_ui"))
+                    (lib_webrtc (assoc-ref inputs "lib_webrtc"))
+                    (tgcalls (assoc-ref inputs "tgcalls")))
+               (copy-recursively cmake_helpers (string-append to "/cmake"))
+               (copy-recursively codegen (string-append to "/Telegram/codegen"))
+               (copy-recursively lib_base (string-append to "/Telegram/lib_base"))
+               (copy-recursively lib_crl (string-append to "/Telegram/lib_crl"))
+               (copy-recursively lib_lottie (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively lib_qr (string-append to "/Telegram/lib_qr"))
+               (copy-recursively lib_rlottie (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively lib_rpl (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively lib_spellcheck (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively lib_storage (string-append to "/Telegram/lib_storage"))
+               (copy-recursively lib_tl (string-append to "/Telegram/lib_tl"))
+               (copy-recursively lib_ui (string-append to "/Telegram/lib_ui"))
+               (copy-recursively lib_webrtc (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively tgcalls (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t)))))
+    (native-inputs
+     `(("cmake_helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a")))
+           (file-name
+            (git-file-name "cmake_helpers" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968d")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib_base"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0")))
+           (file-name
+            (git-file-name "lib_base" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib_crl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf")))
+           (file-name
+            (git-file-name "lib_crl" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib_lottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f37")))
+           (file-name
+            (git-file-name "lib_lottie" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib_qr"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a")))
+           (file-name
+            (git-file-name "lib_qr" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib_rlottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf7")))
+           (file-name
+            (git-file-name "lib_rlottie" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib_rpl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b9639")))
+           (file-name
+            (git-file-name "lib_rpl" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib_spellcheck"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b3")))
+           (file-name
+            (git-file-name "lib_spellcheck" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib_storage"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe5172")))
+           (file-name
+            (git-file-name "lib_storage" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib_tl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d")))
+           (file-name
+            (git-file-name "lib_tl" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib_ui"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e27992")))
+           (file-name
+            (git-file-name "lib_ui" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib_webrtc"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6")))
+           (file-name
+            (git-file-name "lib_webrtc" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("tgcalls"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f")))
+           (file-name
+            (git-file-name "tgcalls" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v5)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (2 preceding siblings ...)
  2021-01-12  3:27 ` [bug#45721] Telegram Desktop (v4) Raghav Gururajan
@ 2021-01-13 22:13 ` Raghav Gururajan
  2021-01-14  5:39 ` [bug#45721] Telegram Desktop (v6) Raghav Gururajan
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-13 22:13 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 38565437775ee43e1c64e9f36893926ceb7428c3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/14] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1151d4642e..da83bc59d6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 3b1a649be20575a8e13cb8d86992b93fbfed557e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/14] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From a1be34b8d76fe0d6855d78cf2997ea0ebea3060c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/14] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 3429 bytes --]

From 47df40611bbd6a8a065913f7b2d058d95a138516 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 15:05:11 -0500
Subject: [PATCH 04/14] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 62 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..7257a4789e 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -37,6 +40,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -48,11 +52,67 @@
   #:use-module (guix build-system python)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ;; ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]

From c48093f2c55d3036af6de0816bb9f6cbcb211f60 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:16:43 -0500
Subject: [PATCH 05/14] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7257a4789e..1fefbbf560 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -41,6 +42,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -57,6 +59,59 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-hime-Enable-chewing-support.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

From 8c8cda3a33177fe2e88bc73f6d1f56a8c560e514 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:19:21 -0500
Subject: [PATCH 06/14] gnu: hime: Enable chewing support.

* gnu/packages/language.scm (hime) [inputs]: Add libchewing.
---
 gnu/packages/language.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 1fefbbf560..e50e157370 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -151,7 +151,7 @@ method, one of the most popular choices for Traditional Chinese users.")
     (inputs
      `(("anthy" ,anthy)
        ("appindicator" ,libappindicator)
-       ;; ("chewing" ,libchewing)
+       ("chewing" ,libchewing)
        ("gtk+" ,gtk+)
        ("qtbase" ,qtbase)
        ("xtst" ,libxtst)))
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From b759a5480592278fcb9f112229a5eaca4ef56248 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/14] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From 6b348e064818062e9284e7ddcfcc0d9fbf8a83d5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/14] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6435 bytes --]

From a43b015b857e38e2d79ae6a5aab20d9d0ea1fd6d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 19:32:18 -0500
Subject: [PATCH 09/14] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 127 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index e50e157370..1d1fe94690 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,8 +52,10 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -59,6 +66,126 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From 9a22566adde1ca4fd6be81b5324479f3d4e51f85 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 10/14] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From ed415d768e68d78f92717159899c071ad0173586 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 11/14] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2312 bytes --]

From ba1b08dd2128ac9a802039bbcfbeee72849f1bfc Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 12/14] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..cd24f2c319 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,49 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2693 bytes --]

From 0dd76bc7253a9e2f921f2cb4916bd1fd930a2f3f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 13/14] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 49 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..94801020c6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,53 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "fa86fcc")
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #15: 0014-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 7626 bytes --]

From 49046c07a41fbd934238c6874e1613197e888199 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 14/14] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 180 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 181 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index da83bc59d6..4c42aeeb63 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..523edac19b
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,180 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC"
+        "-DTDESKTOP_API_ID=17349"
+        "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v6)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (3 preceding siblings ...)
  2021-01-13 22:13 ` [bug#45721] Telegram Desktop (v5) Raghav Gururajan
@ 2021-01-14  5:39 ` Raghav Gururajan
  2021-01-14  6:41 ` [bug#45721] Telegram Desktop (v7) Raghav Gururajan
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-14  5:39 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 38565437775ee43e1c64e9f36893926ceb7428c3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/14] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1151d4642e..da83bc59d6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 3b1a649be20575a8e13cb8d86992b93fbfed557e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/14] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From a1be34b8d76fe0d6855d78cf2997ea0ebea3060c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/14] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 3429 bytes --]

From 47df40611bbd6a8a065913f7b2d058d95a138516 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 15:05:11 -0500
Subject: [PATCH 04/14] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 62 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..7257a4789e 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -37,6 +40,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -48,11 +52,67 @@
   #:use-module (guix build-system python)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ;; ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3062 bytes --]

From af6920ba7018f0de2a2a47eb86940edf285ae3f4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:16:43 -0500
Subject: [PATCH 05/14] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7257a4789e..63a087959b 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -41,6 +42,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -57,6 +59,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("      test-keyboard ")
+                "")
+               (("      test-regression ")
+                "")
+               (("      test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-hime-Enable-chewing-support.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

From 1270803074efc7a0eec9d5d62bea67e4052df6d6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 17:19:21 -0500
Subject: [PATCH 06/14] gnu: hime: Enable chewing support.

* gnu/packages/language.scm (hime) [inputs]: Add libchewing.
---
 gnu/packages/language.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 63a087959b..4567ff2ef4 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -157,7 +157,7 @@ method, one of the most popular choices for Traditional Chinese users.")
     (inputs
      `(("anthy" ,anthy)
        ("appindicator" ,libappindicator)
-       ;; ("chewing" ,libchewing)
+       ("chewing" ,libchewing)
        ("gtk+" ,gtk+)
        ("qtbase" ,qtbase)
        ("xtst" ,libxtst)))
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 5f25e3852d7b1b428574948c8da3c56d45392d5d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/14] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From f8718bba55e21406415410542142e7cbd98a53de Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/14] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 7078 bytes --]

From 62d855be68cc821f22eb7d365765643fb3d22d30 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 19:32:18 -0500
Subject: [PATCH 09/14] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 140 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 140 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 4567ff2ef4..0e71f38084 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,11 +52,15 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
                 (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
@@ -59,6 +68,137 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From d12ff41a265a3549791a177c08e8d15bbaa7ffef Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 10/14] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From 8ef7e817ded85a5584e33566c61fe0c6958bfa16 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 11/14] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2312 bytes --]

From 8ef1cf85d9c1f6bd4621a2d5a173a85bf9138464 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 12/14] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..cd24f2c319 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,49 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2693 bytes --]

From 30d16a3e23d00afaa00e414424ac17bae3646264 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 13/14] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 49 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..94801020c6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,53 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "fa86fcc")
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #15: 0014-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 7626 bytes --]

From f547d6e0ca8e91ce73d39c8e26c535353d4a520e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 14/14] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 180 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 181 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index da83bc59d6..4c42aeeb63 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..523edac19b
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,180 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC"
+        "-DTDESKTOP_API_ID=17349"
+        "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v7)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (4 preceding siblings ...)
  2021-01-14  5:39 ` [bug#45721] Telegram Desktop (v6) Raghav Gururajan
@ 2021-01-14  6:41 ` Raghav Gururajan
  2021-01-14 10:38 ` [bug#45721] Telegram Desktop (v8) Raghav Gururajan
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-14  6:41 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From 38565437775ee43e1c64e9f36893926ceb7428c3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/13] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1151d4642e..da83bc59d6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 3b1a649be20575a8e13cb8d86992b93fbfed557e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/13] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From a1be34b8d76fe0d6855d78cf2997ea0ebea3060c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/13] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From 6cccdc3561d9bc31e3ad2eb94fecae7b0f8a8cf5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/13] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4157 bytes --]

From 2a84104221e632850d3dbb5b829b4fba27b5ab96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/13] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 76 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..2ad8b6e2a9 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,86 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6695 bytes --]

From 5031b7c372f6404f2ed99a117c7ee65ab90d6912 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/13] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 137 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 137 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 2ad8b6e2a9..7f7955cf71 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,137 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 6dc98c1ceb7139948252cb0e24c1651618b7625a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/13] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From 15e44619c1a690972ac245e039d871197cd8eac2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/13] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From b5c043f167246dc79655ad642615b62663709a9c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/13] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From fe77e5184d37c2bbcaf4e99241ead0ec3f659a2b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/13] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 80bae76ef4c05e51698a67eacdf01e0118bc0b17 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/13] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..80275aa138 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2693 bytes --]

From c2f24b3ae8d99722797e7c8e447021da0dc5a5ee Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/13] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 49 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..94801020c6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,53 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "fa86fcc")
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 7626 bytes --]

From e20c0648219d1de6b9f414559e08d6f0f328d155 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/13] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 180 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 181 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index da83bc59d6..4c42aeeb63 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..523edac19b
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,180 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC"
+        "-DTDESKTOP_API_ID=17349"
+        "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v8)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (5 preceding siblings ...)
  2021-01-14  6:41 ` [bug#45721] Telegram Desktop (v7) Raghav Gururajan
@ 2021-01-14 10:38 ` Raghav Gururajan
  2021-01-16 16:08 ` [bug#45721] Telegram Desktop (v9) Raghav Gururajan
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-14 10:38 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/13] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 008e96ef20fecc4147c369549ca0a411786f1b41 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/13] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 1f8ab5a01ef6858d757bef06c64b10db4acf146f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/13] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From 5d449632f8e2b0c083074ef91fe2761ac7c34fd0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/13] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4157 bytes --]

From 9c05941c9dc8d52f02895304942fb76b9c90bea7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/13] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 76 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..2ad8b6e2a9 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,86 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6695 bytes --]

From 28c5984ee45f62a9efc9c4f7edd9f69cbb59a2fb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/13] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 137 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 137 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 2ad8b6e2a9..7f7955cf71 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,137 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From edcc6f9812bd61e9cb3b98cf545411d619318a46 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/13] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From 2f500e9de89825caaf06505536b138ae1f393e20 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/13] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From e0b18b18c1d79c35c7b924443a45e25f50cfdd27 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/13] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From b90f607185357e01fbb1e529db83acced6b57bd5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/13] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 79656baa13d090eb3cfd8d47fbb6b87a120d96e6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/13] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..80275aa138 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2693 bytes --]

From 8c87b59a9e6fab78e76791e8b1a6c5bd1d6c9bf9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/13] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 49 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..94801020c6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,53 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "fa86fcc")
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 7622 bytes --]

From dde49d6a47321f1a5450641d0ca24ab33c356e32 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/13] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 180 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 181 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..d497c8051b
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,180 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public tdesktop
+  (package
+    (name "tdesktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("dconf" ,dconf)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license license:gpl3+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (6 preceding siblings ...)
  2021-01-14 10:38 ` [bug#45721] Telegram Desktop (v8) Raghav Gururajan
@ 2021-01-16 16:08 ` Raghav Gururajan
  2021-01-16 17:15   ` Nicolò Balzarotti
  2021-01-16 18:04 ` Leo Prikler
                   ` (15 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-16 16:08 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0015-gnu-Add-nextcloud-desktop.patch --]
[-- Type: text/x-patch, Size: 6988 bytes --]

From 7ccd4d7c0220507429a67a3ddecd795bf27b28ac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Fri, 15 Jan 2021 05:04:31 -0500
Subject: [PATCH 15/15] gnu: Add nextcloud-desktop.

* gnu/packages/nextcloud.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/nextcloud.scm (nextcloud-desktop): New variable.
---
 gnu/local.mk               |   1 +
 gnu/packages/nextcloud.scm | 148 +++++++++++++++++++++++++++++++++++++
 2 files changed, 149 insertions(+)
 create mode 100644 gnu/packages/nextcloud.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 747cbb1da7..9c155fff73 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -398,6 +398,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/netpbm.scm			\
   %D%/packages/nettle.scm			\
   %D%/packages/networking.scm			\
+  %D%/packages/nextcloud.scm              \
   %D%/packages/nfs.scm                          \
   %D%/packages/nickle.scm                       \
   %D%/packages/nicotine.scm                     \
diff --git a/gnu/packages/nextcloud.scm b/gnu/packages/nextcloud.scm
new file mode 100644
index 0000000000..abf33cdc6b
--- /dev/null
+++ b/gnu/packages/nextcloud.scm
@@ -0,0 +1,148 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages nextcloud)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages documentation)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages graphviz)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages ruby)
+  #:use-module (gnu packages sphinx)
+  #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages tls)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public nextcloud-desktop
+  (package
+    (name "nextcloud-desktop")
+    (version "3.1.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/nextcloud/desktop")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "022k7b3c30dymrjc1g3ly2cac1c34gkqnvjya6p7w2j3qw2w1dm2"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-DUNIT_TESTING=ON")
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "src/3rdparty"
+               (for-each delete-file-recursively
+                         ;; Keep QProgressIndicator, KMessageWidget
+                         ;; QtLockedFile, Qtokenizer and QtSingleApplication,
+                         ;; as they are not available in Guix.
+                         ;; LibCrashReporter-Qt has it's own bundled 3rdparty stuff.
+                         ;; SQLite is available in Guix.
+                         (list
+                          "libcrashreporter-qt"
+                          "sqlite3")))
+             #t))
+         (add-after 'remove-thirdparty 'patch-plugin-dirs
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Patch install directory for dbus service files.
+             (substitute* "shell_integration/libcloudproviders/CMakeLists.txt"
+               (("PKGCONFIG_GETVAR\\(dbus-1 session_bus_services_dir _install_dir\\)")
+                "set(_install_dir \"${CMAKE_INSTALL_PREFIX}/share/dbus-1/services\")"))
+             ;; Turn-off the use of absolute Qt paths for installation.
+             (substitute* "shell_integration/dolphin/CMakeLists.txt"
+               (("ON CACHE")
+                "OFF CACHE"))
+             #t))
+         (add-before 'check 'pre-check
+           (lambda _
+             ;; Tests write to $HOME.
+             (setenv "HOME" (getcwd))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmocka" ,cmocka)
+       ("dot" ,graphviz)
+       ("doxygen" ,doxygen)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("glib:bin" ,glib "bin")
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)
+       ("ruby" ,ruby)))
+    (inputs
+     `(("appstream" ,appstream)
+       ("glib" ,glib)
+       ("kconfig" ,kconfig)
+       ("kcoreaddons" ,kcoreaddons)
+       ("kio" ,kio)
+       ("libcloudproviders" ,libcloudproviders)
+       ("openssl" ,openssl)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtkeychain" ,qtkeychain)
+       ("qtquickcontrols2" ,qtquickcontrols2)
+       ("qtsvg" ,qtsvg)
+       ("qtwebchannel" ,qtwebchannel)
+       ("qtwebkit" ,qtwebkit)
+       ("sqlite" ,sqlite)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("qtwebengine" ,qtwebengine)))
+    (synopsis "Desktop sync client for Nextcloud")
+    (description "Nextcloud-Desktop is a tool to synchronize files from
+Nextcloud Server with your computer.")
+    (home-page "https://nextcloud.com/install/#install-clients")
+    (license
+     (list
+      ;; QtProgressIndicator
+      license:expat
+      ;; All ThirdParty (except QtProgressIndicator)
+      license:lgpl2.1+
+      ;; Others
+      license:gpl2+))))
-- 
2.30.0


[-- Attachment #3: 0014-gnu-Add-appstream.patch --]
[-- Type: text/x-patch, Size: 5480 bytes --]

From 2bef6d2701205fd8191c45fe204ab21a9f36a8e0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 23:32:27 -0500
Subject: [PATCH 14/15] gnu: Add appstream.

* gnu/packages/freedesktop.scm (appstream): New variable.
---
 gnu/packages/freedesktop.scm | 96 ++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 6dd37005ae..a65cc9bd90 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -58,8 +58,10 @@
   #:use-module (gnu packages bash)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cryptsetup)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages disk)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
@@ -75,6 +77,7 @@
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages language)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages libusb)
@@ -101,6 +104,99 @@
   #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
+(define-public appstream
+  (package
+    (name "appstream")
+    (version "0.13.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://www.freedesktop.org/software/"
+                       "appstream/releases/"
+                       "AppStream-" version ".tar.xz"))
+       (sha256
+        (base32 "09l6ixz1w29pi0nb0flz14m4r3f2hpqpp1fq8y66v9xa4c9fczds"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:glib-or-gtk? #t
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-libstemmer
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "meson.build"
+               (("/usr/include")
+                (string-append (assoc-ref inputs "libstemmer")
+                               "/include")))
+             #t))
+         (add-after 'patch-libstemmer 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs/api"
+               (substitute* "appstream-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             (for-each (lambda (file)
+                         (substitute* file
+                           (("http://www.oasis-open.org/docbook/xml/4.5/")
+                            (string-append (assoc-ref inputs "docbook-xml")
+                                           "/xml/dtd/docbook/"))))
+                       (find-files "scripts/desc" "\\.xml$"))
+             #t))
+         (add-after 'patch-docbook-xml 'disable-failing-tests
+           (lambda _
+             (substitute* "tests/test-pool.c"
+               (("	g_test_add_func \\(\"/AppStream/PoolRead\", test_pool_read\\);")
+                "")
+               (("	g_test_add_func \\(\"/AppStream/PoolReadAsync\", test_pool_read_async\\);")
+                "")
+               (("	g_test_add_func \\(\"/AppStream/PoolEmpty\", test_pool_empty\\);")
+                "")
+               (("	g_test_add_func \\(\"/AppStream/Cache\", test_cache\\);")
+                "")
+               (("	g_test_add_func \\(\"/AppStream/Merges\", test_merge_components\\);")
+                ""))
+             #t))
+         (add-after 'disable-failing-tests 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "data/meson.build"
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc")))
+             #t)))))
+    (native-inputs
+     `(("cmake" ,cmake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("docbook-xml" ,docbook-xml)
+       ("docbook-xsl" ,docbook-xsl)
+       ("gettext" ,gettext-minimal)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gperf" ,gperf)
+       ("gtk-doc" ,gtk-doc)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("xsltproc" ,libxslt)))
+    (inputs
+     `(("libsoup" ,libsoup)
+       ("libstemmer" ,libstemmer)
+       ("libxml2" ,libxml2)
+       ("libyaml" ,libyaml)
+       ("lmdb" ,lmdb)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Tools and libraries to work with AppStream metadata")
+    (description "AppStream is a cross-distribution effort for enhancing the way
+we interact with the software repositories provided by distributions by
+standardizing software component metadata.  It provides the foundation to build
+software-center applications, by providing metadata necessary for an
+application-centric view on package repositories.  It additionally provides
+specifications for things like an unified software metadata database, screenshot
+services and various other things needed to create user-friendly
+application-centers for distributions.")
+    (home-page "https://www.freedesktop.org/wiki/Distributions/AppStream/")
+    (license license:gpl2+)))
+
 (define-public farstream
   (package
     (name "farstream")
-- 
2.30.0


[-- Attachment #4: 0013-gnu-Add-tdesktop.patch --]
[-- Type: text/x-patch, Size: 8574 bytes --]

From fb2006940bf4c712c30035ed84ddb3212ecbea7c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/15] gnu: Add tdesktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tdesktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 202 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 203 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..52a9469c63
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,202 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Git checkouts are not writable by default,
+         ;; but the package writes to it.
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               ;; Keep SPMediaKeyTap and StatusNotifierItem,
+               ;; as they are not available in Guix.
+               ;; Telegram uses custom fork of LibTgVoIP and rLottie,
+               ;; which are different from the ones available in Guix.
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'remove-thirdparty 'disable-emojis
+           (lambda _
+             ;; FIXME: Emojis framework of Qt doesn't get loaded,
+             ;; so causes the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #5: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 2693 bytes --]

From 8c87b59a9e6fab78e76791e8b1a6c5bd1d6c9bf9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/15] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 49 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..94801020c6 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,53 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (package
+    (name "tg_owt")
+    (version "0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/desktop-app/tg_owt.git")
+         (commit "fa86fcc")
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        "-DCMAKE_C_FLAGS=-fPIC"
+        "-DCMAKE_CXX_FLAGS=-fPIC")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("abseil-cpp" ,abseil-cpp)
+       ("alsa" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libsrtp" ,libsrtp)
+       ("libvpx" ,libvpx)
+       ;; ("libyuv" ,libyuv)
+       ("openh264" ,openh264)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("rnnoise" ,rnnoise)))
+    (synopsis "WebRTC build for Telegram")
+    (description "TG_OWT is the packaged build of WebRTC, for its use in
+Telegram-Desktop application.")
+    (home-page "https://github.com/desktop-app/tg_owt")
+    (license license:bsd-3)))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #6: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 79656baa13d090eb3cfd8d47fbb6b87a120d96e6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 773281d291..80275aa138 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #7: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From b90f607185357e01fbb1e529db83acced6b57bd5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6defefab0c..4295e6cc3d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #8: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From e0b18b18c1d79c35c7b924443a45e25f50cfdd27 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..6defefab0c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is the range library for C++14/17/20.  This code was
+the basis of a formal proposal to add range support to the C++ standard library.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Dual-Licensed
+      license:expat
+      license:ncsa))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2246 bytes --]

From 2f500e9de89825caaf06505536b138ae1f393e20 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..773281d291 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is the client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From edcc6f9812bd61e9cb3b98cf545411d619318a46 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #11: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6695 bytes --]

From 28c5984ee45f62a9efc9c4f7edd9f69cbb59a2fb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 137 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 137 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 2ad8b6e2a9..7f7955cf71 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,137 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Korean input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #12: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4157 bytes --]

From 9c05941c9dc8d52f02895304942fb76b9c90bea7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 76 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..2ad8b6e2a9 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,86 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* '("configure" "Makefile")
+               (("17")
+                "11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #13: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From 5d449632f8e2b0c083074ef91fe2761ac7c34fd0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #14: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 1f8ab5a01ef6858d757bef06c64b10db4acf146f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #15: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 008e96ef20fecc4147c369549ca0a411786f1b41 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #16: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-16 16:08 ` [bug#45721] Telegram Desktop (v9) Raghav Gururajan
@ 2021-01-16 17:15   ` Nicolò Balzarotti
  2021-01-16 21:22     ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Nicolò Balzarotti @ 2021-01-16 17:15 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

There's nextcloud inside those telegram-desktop patches




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (7 preceding siblings ...)
  2021-01-16 16:08 ` [bug#45721] Telegram Desktop (v9) Raghav Gururajan
@ 2021-01-16 18:04 ` Leo Prikler
  2021-01-17  0:19   ` Raghav Gururajan
  2021-01-17  0:05 ` [bug#45721] Telegram Desktop (v10) Raghav Gururajan
                   ` (14 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-16 18:04 UTC (permalink / raw)
  To: 45721; +Cc: Raghav Gururajan

Hi Raghav,

congratulations on getting a working Telegram Desktop.  I haven't yet
built this version on my own, but I want to comment on the patches a
little.

Am Freitag, den 15.01.2021, 11:08 -0500 schrieb Raghav Gururajan:
> * gnu/packages/cpp.scm (gsl): New variable.
> * gnu/packages/patches/gsl-gtest.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
LGTM, but there seem to be whitespace issues.  Any idea?

>  (define-module (gnu packages fcitx)
> -  #:use-module ((guix licenses) #:select (gpl2+))
> +  #:use-module (guix licenses)
Personal nitpick, but those should likely be prefixed with license:
To keep backwards-compatibility, you can (define gpl2+ license:gpl2+)
inside the module.

> * gnu/packages/language.scm (libchewing): New variable.
LGTM.

> +         (add-after 'unpack 'patch-std
> +           (lambda _
> +             (substitute* '("configure" "Makefile")
> +               (("17")
> +                "11"))
> +             #t))
Is there a less broad way of doing this?  E.g. replacing c++-17 by c++-
11?

> +        (git-reference
> +         (url "https://github.com/hamonikr/nimf.git")
> +         (commit
> +          (string-append "nimf-" version))))
FWIW there seems to also exist an older version over at
https://gitlab.com/nimf-i18n/nimf
Would it be worth packaging that?

> +    (synopsis "Korean input method framework")
> +    (description "Nimf is a lightweight, fast and extensible input
> method
> +framework.")
In my opinion the synopsis should be "Lightweight input method
framework" and the description should mention, that this specific fork
has a special focus on Korean.

> * gnu/packages/cmake.scm (cmake-shared): New variable.
LGTM, albeit admittedly weird.

> +    (synopsis "Material Decoration for Qt")
> +    (description "MaterialDecoration is the client-side decoration
> for Qt
> +applications on Wayland.")
It's not "the", just "a".  Usually such projects describe Material
Design in some way, but apparently it has come to a point where just
throwing around the word "Material" is enough.

> +    (description "Range-v3 is the range library for
> C++14/17/20.  This code was
> +the basis of a formal proposal to add range support to the C++
> standard library.")
I find the following more useful:
> [range-v3 is] an extension of the Standard Template Library that
> makes its iterators and algorithms more powerful by making them
> composable.  Unlike other range-like solutions which, seek to do away
> with iterators, in range-v3 ranges are an abstration layer on top of
> iterators.

> +    (license
> +     (list
> +      ;; Dual-Licensed
> +      license:expat
> +      license:ncsa))))
It appears, that this library carries a few more (free) licenses with
it.  Perhaps this needs to be revised?

> * gnu/packages/cpp.scm (rlottie): New variable.
LGTM.

> * gnu/packages/qt.scm (qt5ct): New variable.
LGTM.

> +(define-public tg_owt
> +  (package
> +    (name "tg_owt")
> +    (version "0.0.0")
Use a proper version.  Packages, that build directly from git without
any tagged versions usually have a preamble of 
  (let ((commit <hash>) 
        (revision <number))
    (package ...))

> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference
> +         (url "https://github.com/desktop-app/tg_owt.git")
> +         (commit "fa86fcc")
> +         (recursive? #t)))
Is there a way of making this checkout non-recursive?  I know you've
made that change in accordance to an upstream recommendation, but one
ought to look at it a little closer. 

> +    (inputs
> +     `(("abseil-cpp" ,abseil-cpp)
> +       ("alsa" ,alsa-lib)
> +       ("ffmpeg" ,ffmpeg)
> +       ("libjpeg" ,libjpeg-turbo)
> +       ("libsrtp" ,libsrtp)
> +       ("libvpx" ,libvpx)
> +       ;; ("libyuv" ,libyuv)
> +       ("openh264" ,openh264)
> +       ("openssl" ,openssl)
> +       ("opus" ,opus)
> +       ("protobuf" ,protobuf)
> +       ("pulseaudio" ,pulseaudio)
> +       ("rnnoise" ,rnnoise)))
It seems that some of those inputs are also found as third_party/
libraries.  Can you remove their respective sources from the package?

> +    (synopsis "WebRTC build for Telegram")
> +    (description "TG_OWT is the packaged build of WebRTC, for its
> use in
> +Telegram-Desktop application.")
I really don't like that synopsis and description.  Granted, upstream
offers little to work with, but there ought to be a better way of
phrasing this.

By the way, it would appear we already have some WebRTC stuff packaged,
but no direct "webrtc" package (which I guess is normal, given that it
is a protocol and not an individual piece of software).  How tightly is
Telegram coupled to this specific implementation?  Would there be a way
of replacing it with something else (kinda like our udev/eudev
situation)?

> * gnu/packages/telegram.scm: New module.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
> * gnu/packages/telegram.scm (tdesktop): New variable.
Would there be a way of moving this into another module, e.g. (gnu
packages messaging)?

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-16 17:15   ` Nicolò Balzarotti
@ 2021-01-16 21:22     ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-16 21:22 UTC (permalink / raw)
  To: Nicolò Balzarotti, 45721

Hi Nicolò!

> There's nextcloud inside those telegram-desktop patches

Oops! I must have attached it by mistake.

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v10)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (8 preceding siblings ...)
  2021-01-16 18:04 ` Leo Prikler
@ 2021-01-17  0:05 ` Raghav Gururajan
  2021-01-17  0:29 ` [bug#45721] Telegram Desktop (v11) Raghav Gururajan
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17  0:05 UTC (permalink / raw)
  To: 45721; +Cc: leo.prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 8962 bytes --]

From 3c3324e3feb3d1e980d4ebf49efa2dccbc7d9f24 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/15] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 207 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 208 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..7339025d49
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,207 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Unique API-ID and API-HASH must obtained for each client application.
+       ;; Reference: https://core.telegram.org/api/obtaining_api_id
+       ;; The following API-ID and API-HASH are generated from my account.
+       ;; In case of ban/block, contact: rg@raghavgururajan.name
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Git checkouts are not writable by default,
+         ;; but the package writes to it.
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               ;; [1] Keep SPMediaKeyTap, StatusNotifierItem,
+               ;; LibTgVoIP and rLottie.
+               ;; [2] SPMediaKeyTap and StatusNotifierItem are not available.
+               ;; [3] Telegram-Desktop uses custom fork of LibTgVoIP and rLottie,
+               ;; which are different from the ones available in Guix.
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'remove-thirdparty 'disable-emojis
+           (lambda _
+             ;; FIXME: Emojis framework of Qt doesn't get loaded,
+             ;; so causes the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 4002 bytes --]

From 342ca4a5123459b7d17e963b11abc035785023cc Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/15] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 77 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..c4094d75aa 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,81 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (let ((commit "fa86fcc")
+        (revision "1"))
+    (package
+      (name "tg_owt")
+      (version
+       (git-version "1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)
+           (recursive? #t)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'delete-thirdparty
+             (lambda _
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           ;; [1] Keep Abseil-CPP, LibSRTP, LibVPx, LibYuv,
+                           ;; OpenH264, PFFFT, RnNoise and UsrSCTP.
+                           ;; [2] Tg_owt uses custom fork of Abseil-CPP,
+                           ;; LibSRTP, OpenH264 and RnNoise.
+                           ;; [3] Tg_owt uses specific version/commit of LibVPx,
+                           ;; which is different from one available in Guix.
+                           ;; [4] LibYuv, PFFFT and UsrSCTP aren't available.
+                           (list
+                            "yasm")))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ;; ("libvpx" ,libvpx)
+         ;; ("libyuv" ,libyuv)
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 023b9e9c0c55b56e21bee13fd24c22688d61f900 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..0ce694bd92 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From 887cd35ad810ce819091fcd1afc0ea71475b439d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index b71c7e1832..8df15a8c65 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2206 bytes --]

From 58ee3d478934d16495061849e566126fe670bf51 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..b71c7e1832 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2244 bytes --]

From d91590a291cbe9a130e5ef6349e15949fd22b646 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From e2dee2b004db93dbbec27f5478b3f61fd0b4c5b6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6784 bytes --]

From 7a7061f67899b870fc64ef842cfa62519267e5a9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..da417417a6 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework. This a forked version on original nimf project, which has special
+focus on Korean.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4206 bytes --]

From fcc44eab5187f9df64f77898595908424a67a92e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From 5d449632f8e2b0c083074ef91fe2761ac7c34fd0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 1f8ab5a01ef6858d757bef06c64b10db4acf146f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 008e96ef20fecc4147c369549ca0a411786f1b41 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-16 18:04 ` Leo Prikler
@ 2021-01-17  0:19   ` Raghav Gururajan
  2021-01-17  0:36     ` Leo Prikler
  0 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17  0:19 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> congratulations on getting a working Telegram Desktop.  I haven't yet
> built this version on my own, but I want to comment on the patches a
> little.

Thanks! Couldn't have done without your help. :-)

> LGTM, but there seem to be whitespace issues.  Any idea?

Those are from the patch file taken from upstream. The pack-def is clean.

> Personal nitpick, but those should likely be prefixed with license:
> To keep backwards-compatibility, you can (define gpl2+ license:gpl2+)
> inside the module.

Hmm. I think we have to make changes to all pack-def in this module. As 
the licenses doesn't use prefix. Can be a separate task.

> LGTM.

Cool!

> Is there a less broad way of doing this?  E.g. replacing c++-17 by c++-
> 11?

Updated in v10.

> FWIW there seems to also exist an older version over at
> https://gitlab.com/nimf-i18n/nimf
> Would it be worth packaging that?

Hmm, not sure. I can package it later though.

> In my opinion the synopsis should be "Lightweight input method
> framework" and the description should mention, that this specific fork
> has a special focus on Korean.

Updated in v10.

> LGTM, albeit admittedly weird.

Haha, yeah.

> It's not "the", just "a".  Usually such projects describe Material
> Design in some way, but apparently it has come to a point where just
> throwing around the word "Material" is enough.

Updated in v10.

> I find the following more useful:
> [range-v3 is] an extension of the Standard Template Library that
> makes its iterators and algorithms more powerful by making them
> composable.  Unlike other range-like solutions which, seek to do away
> with iterators, in range-v3 ranges are an abstration layer on top of
> iterators.

Updated in v10.

> It appears, that this library carries a few more (free) licenses with
> it.  Perhaps this needs to be revised?

Updated in v10.

> LGTM.

Cool!

> LGTM.

Cool!

> Use a proper version.  Packages, that build directly from git without
> any tagged versions usually have a preamble of
>    (let ((commit <hash>)
>          (revision <number))
>      (package ...))

Updated in v10.

> Is there a way of making this checkout non-recursive?  I know you've
> made that change in accordance to an upstream recommendation, but one
> ought to look at it a little closer.

Not sure, but we need the sub-modules any way for build.

> It seems that some of those inputs are also found as third_party/
> libraries.  Can you remove their respective sources from the package?

Updated in v10.

> I really don't like that synopsis and description.  Granted, upstream
> offers little to work with, but there ought to be a better way of
> phrasing this.

Updated in v10.

> By the way, it would appear we already have some WebRTC stuff packaged,
> but no direct "webrtc" package (which I guess is normal, given that it
> is a protocol and not an individual piece of software).  How tightly is
> Telegram coupled to this specific implementation?  Would there be a way
> of replacing it with something else (kinda like our udev/eudev
> situation)?

Nah, telegram made a hard fork. There are some telegram-specific classes 
and objects.

> Would there be a way of moving this into another module, e.g. (gnu
> packages messaging)?

I first tried there, but the was circular dependency. So moved it to 
separate module. We can also move telegram-related stuff like tg_owt 
etc, to this module in the future.

Thank you so much for reviewing. :-)

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v11)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (9 preceding siblings ...)
  2021-01-17  0:05 ` [bug#45721] Telegram Desktop (v10) Raghav Gururajan
@ 2021-01-17  0:29 ` Raghav Gururajan
  2021-01-17  1:04 ` [bug#45721] Telegram Desktop (v12) Raghav Gururajan
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17  0:29 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 8962 bytes --]

From df13fd20cdf040f0e4e6c7b158973b8cc65fd83a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/15] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 207 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 208 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..7339025d49
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,207 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Unique API-ID and API-HASH must obtained for each client application.
+       ;; Reference: https://core.telegram.org/api/obtaining_api_id
+       ;; The following API-ID and API-HASH are generated from my account.
+       ;; In case of ban/block, contact: rg@raghavgururajan.name
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Git checkouts are not writable by default,
+         ;; but the package writes to it.
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               ;; [1] Keep SPMediaKeyTap, StatusNotifierItem,
+               ;; LibTgVoIP and rLottie.
+               ;; [2] SPMediaKeyTap and StatusNotifierItem are not available.
+               ;; [3] Telegram-Desktop uses custom fork of LibTgVoIP and rLottie,
+               ;; which are different from the ones available in Guix.
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'remove-thirdparty 'disable-emojis
+           (lambda _
+             ;; FIXME: Emojis framework of Qt doesn't get loaded,
+             ;; so causes the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 4002 bytes --]

From b81159dea877e162b34f92c3f89244d91ef46a3a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/15] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 77 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..c4094d75aa 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,81 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (let ((commit "fa86fcc")
+        (revision "1"))
+    (package
+      (name "tg_owt")
+      (version
+       (git-version "1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)
+           (recursive? #t)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'delete-thirdparty
+             (lambda _
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           ;; [1] Keep Abseil-CPP, LibSRTP, LibVPx, LibYuv,
+                           ;; OpenH264, PFFFT, RnNoise and UsrSCTP.
+                           ;; [2] Tg_owt uses custom fork of Abseil-CPP,
+                           ;; LibSRTP, OpenH264 and RnNoise.
+                           ;; [3] Tg_owt uses specific version/commit of LibVPx,
+                           ;; which is different from one available in Guix.
+                           ;; [4] LibYuv, PFFFT and UsrSCTP aren't available.
+                           (list
+                            "yasm")))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ;; ("libvpx" ,libvpx)
+         ;; ("libyuv" ,libyuv)
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From f56974102f34a96de27bce09acccac40f1acf254 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..0ce694bd92 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From 3a2a5c329587056e56cb2d0df118c0161ce6c789 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index b71c7e1832..8df15a8c65 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2206 bytes --]

From aeaba0734e8f11b5704c398e247f67b40fe9db0b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..b71c7e1832 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2244 bytes --]

From 9af63a33ba7a5489c5889c4137bb2f841a5fd56f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 32c9c556e5ff3fd5f7616c9e9497645b923dd6b0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6772 bytes --]

From f2791c7bf5650fa2f33e146b9a355fdadd407144 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..18373f2c6c 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework. This is a fork of original nimf project, with special focus on
+Korean.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4206 bytes --]

From fcc44eab5187f9df64f77898595908424a67a92e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From 5d449632f8e2b0c083074ef91fe2761ac7c34fd0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 1f8ab5a01ef6858d757bef06c64b10db4acf146f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3405 bytes --]

From 008e96ef20fecc4147c369549ca0a411786f1b41 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..18d7d4ee34 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-17  0:19   ` Raghav Gururajan
@ 2021-01-17  0:36     ` Leo Prikler
  2021-01-17  1:10       ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-17  0:36 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Hi Raghav,

Am Samstag, den 16.01.2021, 19:19 -0500 schrieb Raghav Gururajan:
> Hi Leo!
> 
> > congratulations on getting a working Telegram Desktop.  I haven't
> > yet
> > built this version on my own, but I want to comment on the patches
> > a
> > little.
> 
> Thanks! Couldn't have done without your help. :-)
> 
> > LGTM, but there seem to be whitespace issues.  Any idea?
> 
> Those are from the patch file taken from upstream. The pack-def is
> clean.
Nvm then.

> > Personal nitpick, but those should likely be prefixed with license:
> > To keep backwards-compatibility, you can (define gpl2+
> > license:gpl2+)
> > inside the module.
> 
> Hmm. I think we have to make changes to all pack-def in this module.
> As 
> the licenses doesn't use prefix. Can be a separate task.
Again, you can (define gpl2+ license:gpl2+) at the start of the module,
so that existing definitions can be kept the same, but your packages
adhere to the license: style.

> > LGTM.
> 
> Cool!
> 
> > Is there a less broad way of doing this?  E.g. replacing c++-17 by
> > c++-
> > 11?
> 
> Updated in v10.
Yes, okay.

> > In my opinion the synopsis should be "Lightweight input method
> > framework" and the description should mention, that this specific
> > fork
> > has a special focus on Korean.
> 
> Updated in v10.
Already discussed that one in IRC.

> > LGTM, albeit admittedly weird.
> 
> Haha, yeah.
> 
> > It's not "the", just "a".  Usually such projects describe Material
> > Design in some way, but apparently it has come to a point where
> > just
> > throwing around the word "Material" is enough.
> 
> Updated in v10.
Okay.

> > I find the following more useful:
> > [range-v3 is] an extension of the Standard Template Library that
> > makes its iterators and algorithms more powerful by making them
> > composable.  Unlike other range-like solutions which, seek to do
> > away
> > with iterators, in range-v3 ranges are an abstration layer on top
> > of
> > iterators.
> 
> Updated in v10.
Thanks.

> > It appears, that this library carries a few more (free) licenses
> > with
> > it.  Perhaps this needs to be revised?
> 
> Updated in v10.
Seems okay, I also saw you double-checking in IRC.

> > Use a proper version.  Packages, that build directly from git
> > without
> > any tagged versions usually have a preamble of
> >    (let ((commit <hash>)
> >          (revision <number))
> >      (package ...))
> 
> Updated in v10.
Use full commit hashes please.

> > Is there a way of making this checkout non-recursive?  I know
> > you've
> > made that change in accordance to an upstream recommendation, but
> > one
> > ought to look at it a little closer.
> 
> Not sure, but we need the sub-modules any way for build.
Perhaps, but it seems kinda weird, that this package gets special
treatment in how we accept anything else it might pull in.

> > It seems that some of those inputs are also found as third_party/
> > libraries.  Can you remove their respective sources from the
> > package?
> 
> Updated in v10.
I don't particularly agree with the way this has been solved in v10. 
Do we really need to keep around custom forks and old versions?  Can we
not instead patch tg_owt?

> > I really don't like that synopsis and description.  Granted,
> > upstream
> > offers little to work with, but there ought to be a better way of
> > phrasing this.
> 
> Updated in v10.
Yep, that sounds better.

> > By the way, it would appear we already have some WebRTC stuff
> > packaged,
> > but no direct "webrtc" package (which I guess is normal, given that
> > it
> > is a protocol and not an individual piece of software).  How
> > tightly is
> > Telegram coupled to this specific implementation?  Would there be a
> > way
> > of replacing it with something else (kinda like our udev/eudev
> > situation)?
> 
> Nah, telegram made a hard fork. There are some telegram-specific
> classes 
> and objects.
Fair enough.

> > Would there be a way of moving this into another module, e.g. (gnu
> > packages messaging)?
> 
> I first tried there, but the was circular dependency. So moved it to 
> separate module. We can also move telegram-related stuff like tg_owt 
> etc, to this module in the future.
That would make sense in my opinion.

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v12)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (10 preceding siblings ...)
  2021-01-17  0:29 ` [bug#45721] Telegram Desktop (v11) Raghav Gururajan
@ 2021-01-17  1:04 ` Raghav Gururajan
  2021-01-17  1:52 ` [bug#45721] Telegram Desktop (v13) Raghav Gururajan
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17  1:04 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 8962 bytes --]

From ee10f0820aaaec66fed39c104b07c3ffffeed916 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/15] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 207 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 208 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..7339025d49
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,207 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Unique API-ID and API-HASH must obtained for each client application.
+       ;; Reference: https://core.telegram.org/api/obtaining_api_id
+       ;; The following API-ID and API-HASH are generated from my account.
+       ;; In case of ban/block, contact: rg@raghavgururajan.name
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Git checkouts are not writable by default,
+         ;; but the package writes to it.
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               ;; [1] Keep SPMediaKeyTap, StatusNotifierItem,
+               ;; LibTgVoIP and rLottie.
+               ;; [2] SPMediaKeyTap and StatusNotifierItem are not available.
+               ;; [3] Telegram-Desktop uses custom fork of LibTgVoIP and rLottie,
+               ;; which are different from the ones available in Guix.
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'remove-thirdparty 'disable-emojis
+           (lambda _
+             ;; FIXME: Emojis framework of Qt doesn't get loaded,
+             ;; so causes the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 4035 bytes --]

From b328aa0352e9b4571b7df0364677d0cbfc3b9730 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/15] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 77 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..652c06e693 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,81 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (let ((commit "ffc317415d5c8e732005414125099a6a6b52dc3e")
+        (revision "1"))
+    (package
+      (name "tg_owt")
+      (version
+       (git-version "1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)
+           (recursive? #t)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0f7s5jwrs6h9sdvwcv9w35ga018dy76i8wzh3nncsriwi217gc2x"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'delete-thirdparty
+             (lambda _
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           ;; [1] Keep Abseil-CPP, LibSRTP, LibVPx, LibYuv,
+                           ;; OpenH264, PFFFT, RnNoise and UsrSCTP.
+                           ;; [2] Tg_owt uses custom fork of Abseil-CPP,
+                           ;; LibSRTP, OpenH264 and RnNoise.
+                           ;; [3] Tg_owt uses specific version/commit of LibVPx,
+                           ;; which is different from one available in Guix.
+                           ;; [4] LibYuv, PFFFT and UsrSCTP aren't available.
+                           (list
+                            "yasm")))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ;; ("libvpx" ,libvpx)
+         ;; ("libyuv" ,libyuv)
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 5106116af504108fd97986108ed7ebbc1401a29d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..0ce694bd92 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From 9f7b138e9d85454e56a63974c52871fca1604df3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index b71c7e1832..8df15a8c65 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2206 bytes --]

From 4d805e4a839de29b59b983f59e7015f38fd93e56 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..b71c7e1832 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2244 bytes --]

From 48edef4bfe7b2adf397725b369e0ad02725482c8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 67de96d5d6f291f199e58a2ef056cd73b6444fd7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6772 bytes --]

From d1f8f17e93d4c996307f9a9c2abcc1df551570c2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..18373f2c6c 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework. This is a fork of original nimf project, with special focus on
+Korean.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4206 bytes --]

From 91f99169ab0cca7d4686b4a3e6863f41f6695d66 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From b1aefee1089fb16ffd6e25c8102a709651540f83 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 331ad0dff904836e8b0827a4884a619697cee01c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3430 bytes --]

From 91386944fcf9663ac1dffbf59544194bce3ede97 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..a4ad008da9 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v9)
  2021-01-17  0:36     ` Leo Prikler
@ 2021-01-17  1:10       ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17  1:10 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> Again, you can (define gpl2+ license:gpl2+) at the start of the module,
> so that existing definitions can be kept the same, but your packages
> adhere to the license: style.

Updated in v12, as per discussed in IRC.

> Use full commit hashes please.

Updated in v12.

> Perhaps, but it seems kinda weird, that this package gets special
> treatment in how we accept anything else it might pull in.

There are existing packages in guix that uses recursive. But your 
concern is valid. May be we can update git-fetch in guix to have an 
option for fetching only specific/mentioned sub-modules.

> I don't particularly agree with the way this has been solved in v10.
> Do we really need to keep around custom forks and old versions?  Can we
> not instead patch tg_owt?

The situation is same as with tg_owt. They made custom changes in the 
fork. Like unique foo::bar.

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v13)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (11 preceding siblings ...)
  2021-01-17  1:04 ` [bug#45721] Telegram Desktop (v12) Raghav Gururajan
@ 2021-01-17  1:52 ` Raghav Gururajan
  2021-01-17 12:13   ` Leo Prikler
  2021-01-17 14:43 ` [bug#45721] Telegram Desktop (v14) Raghav Gururajan
                   ` (10 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17  1:52 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 8962 bytes --]

From ddd554a0810908ac14490dc7c381cb49f571baec Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 13/15] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 207 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 208 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..7339025d49
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,207 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Unique API-ID and API-HASH must obtained for each client application.
+       ;; Reference: https://core.telegram.org/api/obtaining_api_id
+       ;; The following API-ID and API-HASH are generated from my account.
+       ;; In case of ban/block, contact: rg@raghavgururajan.name
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Git checkouts are not writable by default,
+         ;; but the package writes to it.
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'remove-thirdparty
+           (lambda _
+             (with-directory-excursion "Telegram/ThirdParty"
+               ;; [1] Keep SPMediaKeyTap, StatusNotifierItem,
+               ;; LibTgVoIP and rLottie.
+               ;; [2] SPMediaKeyTap and StatusNotifierItem are not available.
+               ;; [3] Telegram-Desktop uses custom fork of LibTgVoIP and rLottie,
+               ;; which are different from the ones available in Guix.
+               (for-each delete-file-recursively
+                         (list
+                          "Catch"
+                          "GSL"
+                          "QR"
+                          "expected"
+                          "fcitx-qt5"
+                          "fcitx5-qt"
+                          "hime"
+                          "hunspell"
+                          "libdbusmenu-qt"
+                          ;; "libtgvoip"
+                          "lz4"
+                          "materialdecoration"
+                          "minizip"
+                          "nimf"
+                          "qt5ct"
+                          "range-v3"
+                          ;; "rlottie"
+                          "xxHash")))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'remove-thirdparty 'disable-emojis
+           (lambda _
+             ;; FIXME: Emojis framework of Qt doesn't get loaded,
+             ;; so causes the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 5436 bytes --]

From e635d7f01155473eef90b5e0ba94c3e64da70909 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 11 Jan 2021 20:25:49 -0500
Subject: [PATCH 12/15] gnu: Add tg_owt.

* gnu/packages/telephony.scm (tg_owt): New variable.
---
 gnu/packages/telephony.scm | 107 +++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 48e30abfc3..afc85f8424 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages audio)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -93,6 +95,111 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
+(define-public tg_owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg_owt")
+      (version
+       (git-version "1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'delete-thirdparty
+             (lambda _
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           ;; [1] Keep Abseil-CPP, LibSRTP, LibVPx, LibYuv,
+                           ;; OpenH264, PFFFT, RnNoise and UsrSCTP.
+                           ;; [2] Tg_owt uses custom fork of Abseil-CPP,
+                           ;; LibSRTP, OpenH264 and RnNoise.
+                           ;; [3] Tg_owt uses specific version/commit of LibVPx,
+                           ;; which is different from one available in Guix.
+                           ;; [4] LibYuv, PFFFT and UsrSCTP aren't available.
+                           (list
+                            "yasm")))
+               #t))
+           (add-after 'delete-thirdparty 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f")))
+             (file-name
+              (git-file-name "libvpx" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad89006")))
+             (file-name
+              (git-file-name "libyuv" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
+
 (define-public libilbc
   (package
     (name "libilbc")
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 5106116af504108fd97986108ed7ebbc1401a29d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..0ce694bd92 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From 9f7b138e9d85454e56a63974c52871fca1604df3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index b71c7e1832..8df15a8c65 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2206 bytes --]

From 4d805e4a839de29b59b983f59e7015f38fd93e56 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..b71c7e1832 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2244 bytes --]

From 48edef4bfe7b2adf397725b369e0ad02725482c8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 67de96d5d6f291f199e58a2ef056cd73b6444fd7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6772 bytes --]

From d1f8f17e93d4c996307f9a9c2abcc1df551570c2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..18373f2c6c 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework. This is a fork of original nimf project, with special focus on
+Korean.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4206 bytes --]

From 91f99169ab0cca7d4686b4a3e6863f41f6695d66 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From b1aefee1089fb16ffd6e25c8102a709651540f83 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 331ad0dff904836e8b0827a4884a619697cee01c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3430 bytes --]

From 91386944fcf9663ac1dffbf59544194bce3ede97 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..a4ad008da9 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v13)
  2021-01-17  1:52 ` [bug#45721] Telegram Desktop (v13) Raghav Gururajan
@ 2021-01-17 12:13   ` Leo Prikler
  2021-01-17 14:49     ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-17 12:13 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Hi,

Am Samstag, den 16.01.2021, 20:52 -0500 schrieb Raghav Gururajan:
> * gnu/packages/fcitx.scm (fcitx-qt5): New variable.
LGTM.

> +      (version
> +       (git-version "1" revision commit))
You can still use "0" or "0.0.0" for the base version.

> +           (add-after 'unpack 'delete-thirdparty
> +             (lambda _
> +               (with-directory-excursion "src/third_party"
> +                 (for-each delete-file-recursively
> +                           ;; [1] Keep Abseil-CPP, LibSRTP, LibVPx,
> LibYuv,
> +                           ;; OpenH264, PFFFT, RnNoise and UsrSCTP.
> +                           ;; [2] Tg_owt uses custom fork of Abseil-
> CPP,
> +                           ;; LibSRTP, OpenH264 and RnNoise.
> +                           ;; [3] Tg_owt uses specific
> version/commit of LibVPx,
> +                           ;; which is different from one available
> in Guix.
> +                           ;; [4] LibYuv, PFFFT and UsrSCTP aren't
> available.
> +                           (list
> +                            "yasm")))
I forgot to mention this, but this should be a snippet, perhaps even a
computed origin.
Also, as it has been noted in your Nextcloud patch (IIRC), you should
formulate this in terms of what to keep.
E.g. 
  '(;; custom forks of existing packages
    ;; the forks are incompatible with what we have in Guix
    "abseil-cpp" "libsrtp" "openh264" "rnnoise" 
    ;; XXX: packages currently lacking a description
    "pffft" "usrsctp")

> +           (add-after 'delete-thirdparty 'copy-inputs
> +             (lambda* (#:key inputs outputs #:allow-other-keys)
> +               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
> +                      (libyuv-from (assoc-ref inputs "libyuv"))
> +                      (libvpx-to (string-append (getcwd)
> +                                                "/src/third_party/li
> bvpx/source/libvpx"))
> +                      (libyuv-to (string-append (getcwd)
> +                                                "/src/third_party/li
> byuv")))
> +                 (copy-recursively libvpx-from libvpx-to)
> +                 (copy-recursively libyuv-from libyuv-to))
> +               #t)))))
Should be after unpack (see above), otherwise LGTM.

> +         ("libvpx"
> +          ,(origin
> +             (method git-fetch)
> +             (uri
> +              (git-reference
> +               (url "https://chromium.googlesource.com/webm/libvpx")
> +               (commit "5b63f0f")))
> +             (file-name
> +              (git-file-name "libvpx" version))
> +             (sha256
> +              (base32
> "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
> +         ("libyuv"
> +          ,(origin
> +             (method git-fetch)
> +             (uri
> +              (git-reference
> +               (url "https://chromium.googlesource.com/libyuv/libyuv
> ")
> +               (commit "ad89006")))
> +             (file-name
> +              (git-file-name "libyuv" version))
> +             (sha256
> +              (base32
> "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
Use long hashes.  Also, try to make things work with the nearest
release.  You might also want to package them individually as "libvpx-
for-telegram-desktop" etc. if everything else fails, see stepmania as
an example with a custom ffmpeg.

As per our discussion in IRC, this should be part of the telegram
module.

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v14)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (12 preceding siblings ...)
  2021-01-17  1:52 ` [bug#45721] Telegram Desktop (v13) Raghav Gururajan
@ 2021-01-17 14:43 ` Raghav Gururajan
  2021-01-20 10:41 ` [bug#45721] Telegram Desktop (v17) Raghav Gururajan
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17 14:43 UTC (permalink / raw)
  To: 45721

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 7410 bytes --]

From 602623047c7d6b0725f5d3422912df215cf487d5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/15] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 164 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 163 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 8e68cd4a11..9759a11873 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg_owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,143 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Unique API-ID and API-HASH must obtained for each client application.
+       ;; Reference: https://core.telegram.org/api/obtaining_api_id
+       ;; The following API-ID and API-HASH are generated from my account.
+       ;; In case of ban/block, contact: rg@raghavgururajan.name
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Git checkouts are not writable by default,
+         ;; but the package writes to it.
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable
+                       (find-files "."))
+             #t))
+         (add-after 'make-writable 'disable-emojis
+           (lambda _
+             ;; FIXME: Emojis framework of Qt doesn't get loaded,
+             ;; so causes the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess")
+                "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gsl" ,gsl)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg_owt" ,tg_owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Tdesktop is the official desktop application for telegram
+messenger.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg_owt.patch --]
[-- Type: text/x-patch, Size: 6823 bytes --]

From 5202078ae576963bc5133bf08844b7312f7f16f4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/15] gnu: Add tg_owt.

* gnu/packages/telegram.scm: New module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/telegram.scm (tg_owt): New variable.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7d405c2462..747cbb1da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..8e68cd4a11
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg_owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg_owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2700 bytes --]

From 5106116af504108fd97986108ed7ebbc1401a29d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.
---
 gnu/packages/qt.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..0ce694bd92 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,60 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5 settings
+(theme, font, icons, etc.) under DE/WM without Qt integration.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

From 9f7b138e9d85454e56a63974c52871fca1604df3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index b71c7e1832..8df15a8c65 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2206 bytes --]

From 4d805e4a839de29b59b983f59e7015f38fd93e56 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6a22cf5749..b71c7e1832 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public gsl
   (package
     (name "gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2244 bytes --]

From 48edef4bfe7b2adf397725b369e0ad02725482c8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2204 bytes --]

From 67de96d5d6f291f199e58a2ef056cd73b6444fd7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6772 bytes --]

From d1f8f17e93d4c996307f9a9c2abcc1df551570c2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..18373f2c6c 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework. This is a fork of original nimf project, with special focus on
+Korean.")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4206 bytes --]

From 91f99169ab0cca7d4686b4a3e6863f41f6695d66 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3048 bytes --]

From b1aefee1089fb16ffd6e25c8102a709651540f83 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 331ad0dff904836e8b0827a4884a619697cee01c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3430 bytes --]

From 91386944fcf9663ac1dffbf59544194bce3ede97 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..a4ad008da9 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "Fcitx support for Qt5")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-GSL.patch --]
[-- Type: text/x-patch, Size: 5732 bytes --]

From a38babfc295363905b3f0badc623fd4a770a9315 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add GSL.

* gnu/packages/cpp.scm (gsl): New variable.
* gnu/packages/patches/gsl-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                         |  1 +
 gnu/packages/cpp.scm                 | 28 ++++++++
 gnu/packages/patches/gsl-gtest.patch | 96 ++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
 create mode 100644 gnu/packages/patches/gsl-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..7d405c2462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1124,6 +1124,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
+  %D%/packages/patches/gsl-gtest.patch                                \
   %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..6a22cf5749 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,34 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public gsl
+  (package
+    (name "gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches "gsl-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "GSL contains functions and types that are suggested for use by
+the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/gsl-gtest.patch b/gnu/packages/patches/gsl-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/gsl-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v13)
  2021-01-17 12:13   ` Leo Prikler
@ 2021-01-17 14:49     ` Raghav Gururajan
  2021-01-17 19:08       ` [bug#45721] [PATCH v15] Add Telegram Desktop Leo Prikler
  0 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17 14:49 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> You can still use "0" or "0.0.0" for the base version.
Updated in v14.

> I forgot to mention this, but this should be a snippet, perhaps even a
> computed origin.
> Also, as it has been noted in your Nextcloud patch (IIRC), you should
> formulate this in terms of what to keep.
> E.g.
>    '(;; custom forks of existing packages
>      ;; the forks are incompatible with what we have in Guix
>      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
>      ;; XXX: packages currently lacking a description
>      "pffft" "usrsctp")

Updated in v14.

> Should be after unpack (see above), otherwise LGTM.

Updated in v14.

> Use long hashes.  Also, try to make things work with the nearest
> release.  You might also want to package them individually as "libvpx-
> for-telegram-desktop" etc. if everything else fails, see stepmania as
> an example with a custom ffmpeg.

Updated hashes in v14. Regarding individually packaging, its not worth 
the time for this project. The upstream is planning on re-work their 
tdesktop, libtgvoip, tgcalls and tg_owt. So there might be no tg_owt in 
near future.

> As per our discussion in IRC, this should be part of the telegram
> module.

Moved in v14.

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v15] Add Telegram Desktop.
  2021-01-17 14:49     ` Raghav Gururajan
@ 2021-01-17 19:08       ` Leo Prikler
  2021-01-17 21:59         ` Raghav Gururajan
  2021-01-19 10:11         ` [bug#45721] [PATCH v16] " Leo Prikler
  0 siblings, 2 replies; 55+ messages in thread
From: Leo Prikler @ 2021-01-17 19:08 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

Hi Raghav and everyone else listening on this topic,

this was supposed to be a short set of mostly cosmetic changes before
pushing your patch, but alas, I discovered, that gsl actually conflicts
with an existing package.  I've verified, that Telegram still runs with
the changes I've made and I don't think I have anything else to add,
but someone else should look over these patches once again to make sure
that I didn't overlook anything.

Also there's the question as to whether Telegram Desktop actually runs
under QtWayland.  If someone would be willing to check, that'd be very
nice.

Regards,
Leo



[-- Attachment #2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From 8e600a777e96d887b871481fcf6c05485e4a72f0 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/13] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 77f1d4a096..e4a2d72812 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From 8a48305c5770348085759457e3a16213428686cb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/13] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 9b54b53b181d9c7fc9f012fc3e44d9a139394ba5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/13] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From e9007f40b1ea7e852a5ccde03e6b39ce5ce615a5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/13] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From 06748768a7c2a400e9183bf265edb22bc2f339ec Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/13] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From 03b817f5b90d1c97ad3ad4f576bb2ae3a7b54785 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/13] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 09870a48a27d7eabb2b2fd760c529e491eb578f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/13] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From e483de51a63ef248028a4100b47da39743b7a6b4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/13] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 33774f6667107f72de062191c3378cb485b08f6d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/13] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 80ce1ad56fb83488a4315f0094eb85b5cd2d5235 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/13] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 096ba1ff06cf396c3c46a54022b8c59f6b8a7463 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/13] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6891 bytes --]

From 5bd08c0dc98423115c98ac3f4b5412ac149a702b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/13] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>

fixup tg-owt
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index e4a2d72812..76e2803e81 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 7318 bytes --]

From 33b8103d31f4bbb34a5130a616f2c3c6bf6b706d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/13] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/telegram.scm | 160 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 159 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..ad7bcb2e6c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,139 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Client applications must provide their own API-ID and API-HASH,
+       ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+       ;; In case, that the credentials below fail to work, contact
+       ;;   Raghav Gururajan <rg@raghavgururajan.name>
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'disable-emojis
+           (lambda _
+             ;; FIXME: Emoji sprites do not get loaded, causing
+             ;; the application to crash upon launch.
+             (substitute* "Telegram/lib_ui/ui/emoji_config.cpp"
+               (("bool _unsupported = false")
+                "bool _unsupported = true")
+               (("		generateCache\\(\\);")
+                "//generateCache();"))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg-owt" ,tg-owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v15] Add Telegram Desktop.
  2021-01-17 19:08       ` [bug#45721] [PATCH v15] Add Telegram Desktop Leo Prikler
@ 2021-01-17 21:59         ` Raghav Gururajan
  2021-01-19 10:11         ` [bug#45721] [PATCH v16] " Leo Prikler
  1 sibling, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-17 21:59 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> this was supposed to be a short set of mostly cosmetic changes before
> pushing your patch, but alas, I discovered, that gsl actually conflicts
> with an existing package.  I've verified, that Telegram still runs with
> the changes I've made and I don't think I have anything else to add,
> but someone else should look over these patches once again to make sure
> that I didn't overlook anything.

Thank you!

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v16] Add Telegram Desktop.
  2021-01-17 19:08       ` [bug#45721] [PATCH v15] Add Telegram Desktop Leo Prikler
  2021-01-17 21:59         ` Raghav Gururajan
@ 2021-01-19 10:11         ` Leo Prikler
  1 sibling, 0 replies; 55+ messages in thread
From: Leo Prikler @ 2021-01-19 10:11 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

Thanks to pineapples in IRC for figuring out what was missing for Emoji
support and verifying, that it launches in Wayland.  This will
hopefully be the last patch set for Telegram Desktop before it can be
upstreamed.

Regards,
Leo

[-- Attachment #2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From 297626f102637eeeda2aadff8d84bae4d2e7d6b6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/13] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 6f66021c78..f79f981a12 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From dcaca6d534a6d1a7eca71178e2c89f265db0a832 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/13] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 5217c6f164877c75ebef6fb7c7de108b3c14c74f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/13] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From d2d7a7298dfe1deca1aa3b3b6ee81ae91aa87cd4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/13] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From cbeec23b07d4e544aa44590319c33b93f2a10350 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/13] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From c2cb735c104d65667af3f9c2cacdc7f9880606e8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/13] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 81cf0c3a72f2451814900588b827f6f5104afb7b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/13] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From aa001fb3c2259c8100648486d44272711e1b0b05 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/13] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 7f9711cb4b980843dc6d785dbc342d73d900b140 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/13] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From e1c4a65b8d7293fab5f63e08f4466e6296592615 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/13] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 4292ad483f937bc3de48312f6f4f805e6fac6f60 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/13] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6891 bytes --]

From 1d85c3bb5efaca3f9aeea896e2e91c22c5fb85c8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/13] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>

fixup tg-owt
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index f79f981a12..ce6fd840a8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 6907 bytes --]

From 050035427fdbd4fa2b4f02d3b7640bda8d2c6c2b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/13] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/telegram.scm | 151 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 150 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..7d748cbcae 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,130 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))
+         (recursive? #t)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Client applications must provide their own API-ID and API-HASH,
+       ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+       ;; In case, that the credentials below fail to work, contact
+       ;;   Raghav Gururajan <rg@raghavgururajan.name>
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; ("libtgvoip" ,libtgvoip)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ;; ("rlottie" ,rlottie)
+       ("tg-owt" ,tg-owt)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v17)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (13 preceding siblings ...)
  2021-01-17 14:43 ` [bug#45721] Telegram Desktop (v14) Raghav Gururajan
@ 2021-01-20 10:41 ` Raghav Gururajan
  2021-01-20 11:07   ` Leo Prikler
  2021-01-20 12:29 ` [bug#45721] Telegram Desktop (v18) Raghav Gururajan
                   ` (8 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-20 10:41 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 16715 bytes --]

From ded388c7c654f4fe4475d2ce2ae330722fc1bc87 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/telegram.scm | 392 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 391 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..1d4e819a44 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,371 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Client applications must provide their own API-ID and API-HASH,
+       ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+       ;; In case, that the credentials below fail to work, contact
+       ;;   Raghav Gururajan <rg@raghavgururajan.name>
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (string-append (getenv "TEMP") "/source"))
+                    (cmake_helpers (assoc-ref inputs "cmake_helpers"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib_base (assoc-ref inputs "lib_base"))
+                    (lib_crl (assoc-ref inputs "lib_crl"))
+                    (lib_lottie (assoc-ref inputs "lib_lottie"))
+                    (lib_qr (assoc-ref inputs "lib_qr"))
+                    (lib_rlottie (assoc-ref inputs "lib_rlottie"))
+                    (lib_rpl (assoc-ref inputs "lib_rpl"))
+                    (lib_spellcheck (assoc-ref inputs "lib_spellcheck"))
+                    (lib_storage (assoc-ref inputs "lib_storage"))
+                    (lib_tl (assoc-ref inputs "lib_tl"))
+                    (lib_ui (assoc-ref inputs "lib_ui"))
+                    (lib_webrtc (assoc-ref inputs "lib_webrtc"))
+                    (libtgvoip (assoc-ref inputs "libtgvoip"))
+                    (rlottie (assoc-ref inputs "rlottie"))
+                    (tgcalls (assoc-ref inputs "tgcalls")))
+               (copy-recursively
+                cmake_helpers
+                (string-append to "/cmake"))
+               (copy-recursively
+                codegen
+                (string-append to "/Telegram/codegen"))
+               (copy-recursively
+                lib_base
+                (string-append to "/Telegram/lib_base"))
+               (copy-recursively
+                lib_crl
+                (string-append to "/Telegram/lib_crl"))
+               (copy-recursively
+                lib_lottie
+                (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively
+                lib_qr
+                (string-append to "/Telegram/lib_qr"))
+               (copy-recursively
+                lib_rlottie
+                (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively
+                lib_rpl
+                (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively
+                lib_spellcheck
+                (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively
+                lib_storage
+                (string-append to "/Telegram/lib_storage"))
+               (copy-recursively
+                lib_tl
+                (string-append to "/Telegram/lib_tl"))
+               (copy-recursively
+                lib_ui
+                (string-append to "/Telegram/lib_ui"))
+               (copy-recursively
+                lib_webrtc
+                (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively
+                libtgvoip
+                (string-append to "/Telegram/ThirdParty/libtgvoip"))
+               (copy-recursively
+                rlottie
+                (string-append to "/Telegram/ThirdParty/rlottie"))
+               (copy-recursively
+                tgcalls
+                (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-after 'copy-inputs 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake_helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake_helpers" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib_base"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib_base" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib_crl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib_crl" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib_lottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib_lottie" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib_qr"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib_qr" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib_rlottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib_rlottie" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib_rpl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib_rpl" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib_spellcheck"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib_spellcheck" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib_storage"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib_storage" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib_tl"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib_tl" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib_ui"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib_ui" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib_webrtc"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib_webrtc" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/telegramdesktop/libtgvoip.git")
+             (commit "37d98e984fd6fa389262307db826d52ab86c8241")))
+           (file-name
+            (git-file-name "libtgvoip" version))
+           (sha256
+            (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/rlottie.git")
+             (commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")))
+           (file-name
+            (git-file-name "rlottie" version))
+           (sha256
+            (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       ("tg-owt" ,tg-owt)
+       ("tgcalls"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6891 bytes --]

From 4a40f77ba85953b65ea590e86b4d4b9fb7f312c2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>

fixup tg-owt
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c8a578549d..c1347120bb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 9c6905c0a107542ebc4a08cb7b8349d9c81bd557 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 48258c2c1bc21623985e208f0c943991d27d9f15 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 46f4660f5b23da77bffb620f00e943418af6bb65 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 3e49d1c88f0b768648e6bd1a59f7396211f6126b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 846051b9ac972e45b6a3c7e91824cca7d0c1d0ab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From b619c1bef5d21b4d9297da0d964e028b1e2558f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From ff1d90c02ee57a9a74a92e7a496eddbaaa0235bf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 224a511e7cb2d136512784ed4352ba4f03a39133 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 092da0e19bfe7618ff294d0a60027f8ea48eb76b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From c842b20ffa2dc4f925fd192b01dff982d41a3a96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From c2f89a5b71e3fdffbcd291e74057bc9df86aa1d4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..c8a578549d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v17)
  2021-01-20 10:41 ` [bug#45721] Telegram Desktop (v17) Raghav Gururajan
@ 2021-01-20 11:07   ` Leo Prikler
  2021-01-20 12:32     ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-20 11:07 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Hi Raghav,

Am Mittwoch, den 20.01.2021, 05:41 -0500 schrieb Raghav Gururajan:
> +       ;; Client applications must provide their own API-ID and API-
> HASH,
> +       ;; see also <https://core.telegram.org/api/obtaining_api_id>;
> .
> +       ;; In case, that the credentials below fail to work, contact
> +       ;;   Raghav Gururajan <rg@raghavgururajan.name>
> +       (list
> +        "-DTDESKTOP_API_ID=2791056"
> +        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2")
You're sadly missing the packaged font thing, that pineapples
mentioned.  Try this:
>        #:configure-flags
>        (list
>         ;; Client applications must provide their own API-ID and API-
> HASH,
>         ;; see also <https://core.telegram.org/api/obtaining_api_id>;
> .
>         ;; In case, that the credentials below fail to work, contact
>         ;;   Raghav Gururajan <rg@raghavgururajan.name>
>         "-DTDESKTOP_API_ID=2791056"
>         "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
>         ;; Use bundled fonts as fallback.
>         "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")

> +         (add-after 'unpack 'copy-inputs
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((to (string-append (getenv "TEMP") "/source"))
Should (getcwd) or "source" not suffice as to?

> +       ("lib_base"
> +        ,(origin
> +           (method git-fetch)
> +           (uri
> +            (git-reference
> +             (url "https://github.com/desktop-app/lib_base.git")
> +             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
> +           (file-name
> +            (git-file-name "lib_base" version))
> +           (sha256
> +            (base32
> "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
> +       [...]
Use the naming-scheme "<package>-for-telegram-desktop" and similarly
(git-file-name "<package>-for-telegram-desktop" version).  Substitute
underlines with hyphens in the input and file names.
> +       ("libtgvoip" [...])
> +       ("rlottie" [...])
> +       ("tgcalls" [...])
Likewise.

Also strip the "Signed-Off-By" line from commits, that you've amended
since, so as to not inadvertently confuse anyone.  For this patch set,
that's just 0013.

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v18)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (14 preceding siblings ...)
  2021-01-20 10:41 ` [bug#45721] Telegram Desktop (v17) Raghav Gururajan
@ 2021-01-20 12:29 ` Raghav Gururajan
  2021-01-20 13:49 ` [bug#45721] Telegram Desktop (v19) Raghav Gururajan
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-20 12:29 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 17648 bytes --]

From e40b4a6aaf9b323be7b0c7b88361fa2b62d037f2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 393 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 392 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..9183914694 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,372 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       ;; Client applications must provide their own API-ID and API-HASH,
+       ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+       ;; In case, that the credentials below fail to work, contact
+       ;;   Raghav Gururajan <rg@raghavgururajan.name>
+       (list
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (string-append (getenv "TEMP") "/source"))
+                    (cmake-helpers (assoc-ref inputs "cmake-helpers-for-telegram-desktop"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib-base (assoc-ref inputs "lib-base-for-telegram-desktop"))
+                    (lib-crl (assoc-ref inputs "lib-crl-for-telegram-desktop"))
+                    (lib-lottie (assoc-ref inputs "lib-lottie-for-telegram-desktop"))
+                    (lib-qr (assoc-ref inputs "lib-qr-for-telegram-desktop"))
+                    (lib-rlottie (assoc-ref inputs "lib-rlottie-for-telegram-desktop"))
+                    (lib-rpl (assoc-ref inputs "lib-rpl-for-telegram-desktop"))
+                    (lib-spellcheck (assoc-ref inputs "lib-spellcheck-for-telegram-desktop"))
+                    (lib-storage (assoc-ref inputs "lib-storage-for-telegram-desktop"))
+                    (lib-tl (assoc-ref inputs "lib-tl-for-telegram-desktop"))
+                    (lib-ui (assoc-ref inputs "lib-ui-for-telegram-desktop"))
+                    (lib-webrtc (assoc-ref inputs "lib-webrtc-for-telegram-desktop"))
+                    (libtgvoip (assoc-ref inputs "libtgvoip-for-telegram-desktop"))
+                    (rlottie (assoc-ref inputs "rlottie-for-telegram-desktop"))
+                    (tgcalls (assoc-ref inputs "tgcalls-for-telegram-desktop")))
+               (copy-recursively
+                cmake-helpers
+                (string-append to "/cmake"))
+               (copy-recursively
+                codegen
+                (string-append to "/Telegram/codegen"))
+               (copy-recursively
+                lib-base
+                (string-append to "/Telegram/lib_base"))
+               (copy-recursively
+                lib-crl
+                (string-append to "/Telegram/lib_crl"))
+               (copy-recursively
+                lib-lottie
+                (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively
+                lib-qr
+                (string-append to "/Telegram/lib_qr"))
+               (copy-recursively
+                lib-rlottie
+                (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively
+                lib-rpl
+                (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively
+                lib-spellcheck
+                (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively
+                lib-storage
+                (string-append to "/Telegram/lib_storage"))
+               (copy-recursively
+                lib-tl
+                (string-append to "/Telegram/lib_tl"))
+               (copy-recursively
+                lib-ui
+                (string-append to "/Telegram/lib_ui"))
+               (copy-recursively
+                lib-webrtc
+                (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively
+                libtgvoip
+                (string-append to "/Telegram/ThirdParty/libtgvoip"))
+               (copy-recursively
+                rlottie
+                (string-append to "/Telegram/ThirdParty/rlottie"))
+               (copy-recursively
+                tgcalls
+                (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-after 'copy-inputs 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib-base-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib-crl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib-webrtc-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/telegramdesktop/libtgvoip.git")
+             (commit "37d98e984fd6fa389262307db826d52ab86c8241")))
+           (file-name
+            (git-file-name "libtgvoip-for-telegram-desktop" version))
+           (sha256
+            (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/rlottie.git")
+             (commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")))
+           (file-name
+            (git-file-name "rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       ("tg-owt" ,tg-owt)
+       ("tgcalls-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6891 bytes --]

From 4a40f77ba85953b65ea590e86b4d4b9fb7f312c2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>

fixup tg-owt
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c8a578549d..c1347120bb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 9c6905c0a107542ebc4a08cb7b8349d9c81bd557 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 48258c2c1bc21623985e208f0c943991d27d9f15 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 46f4660f5b23da77bffb620f00e943418af6bb65 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 3e49d1c88f0b768648e6bd1a59f7396211f6126b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 846051b9ac972e45b6a3c7e91824cca7d0c1d0ab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From b619c1bef5d21b4d9297da0d964e028b1e2558f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From ff1d90c02ee57a9a74a92e7a496eddbaaa0235bf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 224a511e7cb2d136512784ed4352ba4f03a39133 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 092da0e19bfe7618ff294d0a60027f8ea48eb76b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From c842b20ffa2dc4f925fd192b01dff982d41a3a96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From c2f89a5b71e3fdffbcd291e74057bc9df86aa1d4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..c8a578549d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v17)
  2021-01-20 11:07   ` Leo Prikler
@ 2021-01-20 12:32     ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-20 12:32 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> You're sadly missing the packaged font thing, that pineapples
> mentioned.  Try this:

Updated in v18.

> Should (getcwd) or "source" not suffice as to?

Nah! it didn't work.

> Use the naming-scheme "<package>-for-telegram-desktop" and similarly
> (git-file-name "<package>-for-telegram-desktop" version).  Substitute
> underlines with hyphens in the input and file names.
> [...]
> Likewise.

Updated in v18.

> Also strip the "Signed-Off-By" line from commits, that you've amended
> since, so as to not inadvertently confuse anyone.  For this patch set,
> that's just 0013.

Updated in v18.

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v19)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (15 preceding siblings ...)
  2021-01-20 12:29 ` [bug#45721] Telegram Desktop (v18) Raghav Gururajan
@ 2021-01-20 13:49 ` Raghav Gururajan
  2021-01-20 14:42 ` [bug#45721] Telegram Desktop (v20) Raghav Gururajan
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-20 13:49 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 17693 bytes --]

From 545042345506215ab0ee9e51f90718855cde5c7e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 395 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 394 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 1bf4af8048..890c08b052 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "ace538a7dfe0fe5fc735f258ba49e7420a5d10b0")
@@ -141,3 +163,374 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "031mis4kxrml4dgh4zm1zkl3gy7vqr7cmfrfkjj3hlldb65xmfvv"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (getcwd))
+                    (cmake-helpers (assoc-ref inputs "cmake-helpers-for-telegram-desktop"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib-base (assoc-ref inputs "lib-base-for-telegram-desktop"))
+                    (lib-crl (assoc-ref inputs "lib-crl-for-telegram-desktop"))
+                    (lib-lottie (assoc-ref inputs "lib-lottie-for-telegram-desktop"))
+                    (lib-qr (assoc-ref inputs "lib-qr-for-telegram-desktop"))
+                    (lib-rlottie (assoc-ref inputs "lib-rlottie-for-telegram-desktop"))
+                    (lib-rpl (assoc-ref inputs "lib-rpl-for-telegram-desktop"))
+                    (lib-spellcheck (assoc-ref inputs "lib-spellcheck-for-telegram-desktop"))
+                    (lib-storage (assoc-ref inputs "lib-storage-for-telegram-desktop"))
+                    (lib-tl (assoc-ref inputs "lib-tl-for-telegram-desktop"))
+                    (lib-ui (assoc-ref inputs "lib-ui-for-telegram-desktop"))
+                    (lib-webrtc (assoc-ref inputs "lib-webrtc-for-telegram-desktop"))
+                    (libtgvoip (assoc-ref inputs "libtgvoip-for-telegram-desktop"))
+                    (rlottie (assoc-ref inputs "rlottie-for-telegram-desktop"))
+                    (tgcalls (assoc-ref inputs "tgcalls-for-telegram-desktop")))
+               (copy-recursively
+                cmake-helpers
+                (string-append to "/cmake"))
+               (copy-recursively
+                codegen
+                (string-append to "/Telegram/codegen"))
+               (copy-recursively
+                lib-base
+                (string-append to "/Telegram/lib_base"))
+               (copy-recursively
+                lib-crl
+                (string-append to "/Telegram/lib_crl"))
+               (copy-recursively
+                lib-lottie
+                (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively
+                lib-qr
+                (string-append to "/Telegram/lib_qr"))
+               (copy-recursively
+                lib-rlottie
+                (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively
+                lib-rpl
+                (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively
+                lib-spellcheck
+                (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively
+                lib-storage
+                (string-append to "/Telegram/lib_storage"))
+               (copy-recursively
+                lib-tl
+                (string-append to "/Telegram/lib_tl"))
+               (copy-recursively
+                lib-ui
+                (string-append to "/Telegram/lib_ui"))
+               (copy-recursively
+                lib-webrtc
+                (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively
+                libtgvoip
+                (string-append to "/Telegram/ThirdParty/libtgvoip"))
+               (copy-recursively
+                rlottie
+                (string-append to "/Telegram/ThirdParty/rlottie"))
+               (copy-recursively
+                tgcalls
+                (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-after 'copy-inputs 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "561273a2f88306072750283b28d763959cd58652")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0cvv713ajqp5b4l8pbpcd391hlkc7vkm2frnbg6qsai8wj0mdjvc"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("kwayland" ,kwayland)
+       ("lib-base-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "dc89f34be5387bef731c59aeca3ca201e042ecc3")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0j64h317k76sbncdwvrr0pizhw2p5a0fl2ghy7jnnlc39xinc6i3"))))
+       ("lib-crl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "9ebd51c8f89799d5b6125e34028528d52b0b0b8e")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "1myspc07gm1wx5z4ma80pj0ywlscq07fvddj7ig3qkpw7vsm3snw"))))
+       ("lib-webrtc-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "c9691526c98fa76f08de295052ca8bd3560ec80b")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "1v8aqqm9kfqscnpv0dbwi295g64wqw4lkfxsgb6mdjlchscrg5a0"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/telegramdesktop/libtgvoip.git")
+             (commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")))
+           (file-name
+            (git-file-name "libtgvoip-for-telegram-desktop" version))
+           (sha256
+            (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/rlottie.git")
+             (commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")))
+           (file-name
+            (git-file-name "rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       ("tg-owt" ,tg-owt)
+       ("tgcalls-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "b85f5e9a25171c08a0e9486c27f07331e26ff1eb")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qn0kh66x87c3mf7nkb0irq63iz96pmdjpy7chq77581acv3zx3x"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6817 bytes --]

From dc7f2ae1e82416394e1d780bda1025f7259e3d3e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c8a578549d..c1347120bb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..1bf4af8048
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "ace538a7dfe0fe5fc735f258ba49e7420a5d10b0")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0d4lcxh0v1gf2gq9f073vwk9lv4x23k0r3365n0bx979fjcn18xf"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 9c6905c0a107542ebc4a08cb7b8349d9c81bd557 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 48258c2c1bc21623985e208f0c943991d27d9f15 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 46f4660f5b23da77bffb620f00e943418af6bb65 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 3e49d1c88f0b768648e6bd1a59f7396211f6126b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 846051b9ac972e45b6a3c7e91824cca7d0c1d0ab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From b619c1bef5d21b4d9297da0d964e028b1e2558f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From ff1d90c02ee57a9a74a92e7a496eddbaaa0235bf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 224a511e7cb2d136512784ed4352ba4f03a39133 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 092da0e19bfe7618ff294d0a60027f8ea48eb76b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From c842b20ffa2dc4f925fd192b01dff982d41a3a96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From c2f89a5b71e3fdffbcd291e74057bc9df86aa1d4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..c8a578549d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v20)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (16 preceding siblings ...)
  2021-01-20 13:49 ` [bug#45721] Telegram Desktop (v19) Raghav Gururajan
@ 2021-01-20 14:42 ` Raghav Gururajan
  2021-01-20 15:10   ` Leo Prikler
  2021-01-21  3:44 ` [bug#45721] Telegram Desktop (v21) Raghav Gururajan
                   ` (5 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-20 14:42 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 17693 bytes --]

From 43bb02f67484a5a04d7799f24f10f72967831f26 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 395 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 394 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index eb85aad6d4..3f88fb1a00 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "ace538a7dfe0fe5fc735f258ba49e7420a5d10b0")
@@ -143,3 +165,374 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "031mis4kxrml4dgh4zm1zkl3gy7vqr7cmfrfkjj3hlldb65xmfvv"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (getcwd))
+                    (cmake-helpers (assoc-ref inputs "cmake-helpers-for-telegram-desktop"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib-base (assoc-ref inputs "lib-base-for-telegram-desktop"))
+                    (lib-crl (assoc-ref inputs "lib-crl-for-telegram-desktop"))
+                    (lib-lottie (assoc-ref inputs "lib-lottie-for-telegram-desktop"))
+                    (lib-qr (assoc-ref inputs "lib-qr-for-telegram-desktop"))
+                    (lib-rlottie (assoc-ref inputs "lib-rlottie-for-telegram-desktop"))
+                    (lib-rpl (assoc-ref inputs "lib-rpl-for-telegram-desktop"))
+                    (lib-spellcheck (assoc-ref inputs "lib-spellcheck-for-telegram-desktop"))
+                    (lib-storage (assoc-ref inputs "lib-storage-for-telegram-desktop"))
+                    (lib-tl (assoc-ref inputs "lib-tl-for-telegram-desktop"))
+                    (lib-ui (assoc-ref inputs "lib-ui-for-telegram-desktop"))
+                    (lib-webrtc (assoc-ref inputs "lib-webrtc-for-telegram-desktop"))
+                    (libtgvoip (assoc-ref inputs "libtgvoip-for-telegram-desktop"))
+                    (rlottie (assoc-ref inputs "rlottie-for-telegram-desktop"))
+                    (tgcalls (assoc-ref inputs "tgcalls-for-telegram-desktop")))
+               (copy-recursively
+                cmake-helpers
+                (string-append to "/cmake"))
+               (copy-recursively
+                codegen
+                (string-append to "/Telegram/codegen"))
+               (copy-recursively
+                lib-base
+                (string-append to "/Telegram/lib_base"))
+               (copy-recursively
+                lib-crl
+                (string-append to "/Telegram/lib_crl"))
+               (copy-recursively
+                lib-lottie
+                (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively
+                lib-qr
+                (string-append to "/Telegram/lib_qr"))
+               (copy-recursively
+                lib-rlottie
+                (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively
+                lib-rpl
+                (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively
+                lib-spellcheck
+                (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively
+                lib-storage
+                (string-append to "/Telegram/lib_storage"))
+               (copy-recursively
+                lib-tl
+                (string-append to "/Telegram/lib_tl"))
+               (copy-recursively
+                lib-ui
+                (string-append to "/Telegram/lib_ui"))
+               (copy-recursively
+                lib-webrtc
+                (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively
+                libtgvoip
+                (string-append to "/Telegram/ThirdParty/libtgvoip"))
+               (copy-recursively
+                rlottie
+                (string-append to "/Telegram/ThirdParty/rlottie"))
+               (copy-recursively
+                tgcalls
+                (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-after 'copy-inputs 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "561273a2f88306072750283b28d763959cd58652")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0cvv713ajqp5b4l8pbpcd391hlkc7vkm2frnbg6qsai8wj0mdjvc"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("kwayland" ,kwayland)
+       ("lib-base-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "dc89f34be5387bef731c59aeca3ca201e042ecc3")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0j64h317k76sbncdwvrr0pizhw2p5a0fl2ghy7jnnlc39xinc6i3"))))
+       ("lib-crl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "9ebd51c8f89799d5b6125e34028528d52b0b0b8e")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "1myspc07gm1wx5z4ma80pj0ywlscq07fvddj7ig3qkpw7vsm3snw"))))
+       ("lib-webrtc-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "c9691526c98fa76f08de295052ca8bd3560ec80b")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "1v8aqqm9kfqscnpv0dbwi295g64wqw4lkfxsgb6mdjlchscrg5a0"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/telegramdesktop/libtgvoip.git")
+             (commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")))
+           (file-name
+            (git-file-name "libtgvoip-for-telegram-desktop" version))
+           (sha256
+            (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/rlottie.git")
+             (commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")))
+           (file-name
+            (git-file-name "rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       ("tg-owt" ,tg-owt)
+       ("tgcalls-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "b85f5e9a25171c08a0e9486c27f07331e26ff1eb")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qn0kh66x87c3mf7nkb0irq63iz96pmdjpy7chq77581acv3zx3x"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6904 bytes --]

From ea40db36d27b03e1326e4393ba9edd61920d4d87 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 145 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 146 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c8a578549d..c1347120bb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..eb85aad6d4
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,145 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "ace538a7dfe0fe5fc735f258ba49e7420a5d10b0")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0d4lcxh0v1gf2gq9f073vwk9lv4x23k0r3365n0bx979fjcn18xf"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          ;; Shared build is broken in upstream.
+          "-DBUILD_SHARED_LIBS=OFF"
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 9c6905c0a107542ebc4a08cb7b8349d9c81bd557 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 48258c2c1bc21623985e208f0c943991d27d9f15 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 46f4660f5b23da77bffb620f00e943418af6bb65 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 3e49d1c88f0b768648e6bd1a59f7396211f6126b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 846051b9ac972e45b6a3c7e91824cca7d0c1d0ab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From b619c1bef5d21b4d9297da0d964e028b1e2558f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From ff1d90c02ee57a9a74a92e7a496eddbaaa0235bf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 224a511e7cb2d136512784ed4352ba4f03a39133 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 092da0e19bfe7618ff294d0a60027f8ea48eb76b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From c842b20ffa2dc4f925fd192b01dff982d41a3a96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From c2f89a5b71e3fdffbcd291e74057bc9df86aa1d4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..c8a578549d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v20)
  2021-01-20 14:42 ` [bug#45721] Telegram Desktop (v20) Raghav Gururajan
@ 2021-01-20 15:10   ` Leo Prikler
  0 siblings, 0 replies; 55+ messages in thread
From: Leo Prikler @ 2021-01-20 15:10 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Am Mittwoch, den 20.01.2021, 09:42 -0500 schrieb Raghav Gururajan:
> +             (let* ((to (getcwd))
> +                    (cmake-helpers (assoc-ref inputs "cmake-helpers-
> for-telegram-desktop"))
> +                    (codegen (assoc-ref inputs "codegen"))
> +                    (lib-base (assoc-ref inputs "lib-base-for-
> telegram-desktop"))
> +                    (lib-crl (assoc-ref inputs "lib-crl-for-
> telegram-desktop"))
> +                    (lib-lottie (assoc-ref inputs "lib-lottie-for-
> telegram-desktop"))
> +                    (lib-qr (assoc-ref inputs "lib-qr-for-telegram-
> desktop"))
> +                    (lib-rlottie (assoc-ref inputs "lib-rlottie-for-
> telegram-desktop"))
> +                    (lib-rpl (assoc-ref inputs "lib-rpl-for-
> telegram-desktop"))
> +                    (lib-spellcheck (assoc-ref inputs "lib-
> spellcheck-for-telegram-desktop"))
> +                    (lib-storage (assoc-ref inputs "lib-storage-for-
> telegram-desktop"))
> +                    (lib-tl (assoc-ref inputs "lib-tl-for-telegram-
> desktop"))
> +                    (lib-ui (assoc-ref inputs "lib-ui-for-telegram-
> desktop"))
> +                    (lib-webrtc (assoc-ref inputs "lib-webrtc-for-
> telegram-desktop"))
> +                    (libtgvoip (assoc-ref inputs "libtgvoip-for-
> telegram-desktop"))
> +                    (rlottie (assoc-ref inputs "rlottie-for-
> telegram-desktop"))
> +                    (tgcalls (assoc-ref inputs "tgcalls-for-
> telegram-desktop")))
> +               (copy-recursively
> +                cmake-helpers
> +                (string-append to "/cmake"))
> +               (copy-recursively
> +                codegen
> +                (string-append to "/Telegram/codegen"))
> +               (copy-recursively
> +                lib-base
> +                (string-append to "/Telegram/lib_base"))
> +               (copy-recursively
> +                lib-crl
> +                (string-append to "/Telegram/lib_crl"))
> +               (copy-recursively
> +                lib-lottie
> +                (string-append to "/Telegram/lib_lottie"))
> +               (copy-recursively
> +                lib-qr
> +                (string-append to "/Telegram/lib_qr"))
> +               (copy-recursively
> +                lib-rlottie
> +                (string-append to "/Telegram/lib_rlottie"))
> +               (copy-recursively
> +                lib-rpl
> +                (string-append to "/Telegram/lib_rpl"))
> +               (copy-recursively
> +                lib-spellcheck
> +                (string-append to "/Telegram/lib_spellcheck"))
> +               (copy-recursively
> +                lib-storage
> +                (string-append to "/Telegram/lib_storage"))
> +               (copy-recursively
> +                lib-tl
> +                (string-append to "/Telegram/lib_tl"))
> +               (copy-recursively
> +                lib-ui
> +                (string-append to "/Telegram/lib_ui"))
> +               (copy-recursively
> +                lib-webrtc
> +                (string-append to "/Telegram/lib_webrtc"))
> +               (copy-recursively
> +                libtgvoip
> +                (string-append to "/Telegram/ThirdParty/libtgvoip"))
> +               (copy-recursively
> +                rlottie
> +                (string-append to "/Telegram/ThirdParty/rlottie"))
> +               (copy-recursively
> +                tgcalls
> +                (string-append to "/Telegram/ThirdParty/tgcalls")))
You're catching up to where I am locally.
I'm writing the same as
  (for-each 
   (match-lambda 
     ((dst src) (copy-recursively src dst)))
   `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
     ("Telegram/codegen" ,(assoc-ref inputs "codegen-source")
     [...]))
though in my current version I also make dst writable because I swapped
the phase ordering for some reason.

To that end, I've renamed the inputs accordingly ("<package>-source"),
while keeping the file names intact.  This might also serve as a
reminder to those unbundling them.

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v21)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (17 preceding siblings ...)
  2021-01-20 14:42 ` [bug#45721] Telegram Desktop (v20) Raghav Gururajan
@ 2021-01-21  3:44 ` Raghav Gururajan
  2021-01-21 19:11   ` [bug#45721] [PATCH v22] Add Telegram Desktop Leo Prikler
  2021-01-22  4:27 ` [bug#45721] Telegram Desktop (v23) Raghav Gururajan
                   ` (4 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-21  3:44 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 17726 bytes --]

From 1a12e30930675959f63b9ac26071fb9894bc7896 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 395 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 394 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..84edec0306 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,374 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((to (string-append (getenv "TEMP") "/source"))
+                    (cmake-helpers (assoc-ref inputs "cmake-helpers-for-telegram-desktop"))
+                    (codegen (assoc-ref inputs "codegen"))
+                    (lib-base (assoc-ref inputs "lib-base-for-telegram-desktop"))
+                    (lib-crl (assoc-ref inputs "lib-crl-for-telegram-desktop"))
+                    (lib-lottie (assoc-ref inputs "lib-lottie-for-telegram-desktop"))
+                    (lib-qr (assoc-ref inputs "lib-qr-for-telegram-desktop"))
+                    (lib-rlottie (assoc-ref inputs "lib-rlottie-for-telegram-desktop"))
+                    (lib-rpl (assoc-ref inputs "lib-rpl-for-telegram-desktop"))
+                    (lib-spellcheck (assoc-ref inputs "lib-spellcheck-for-telegram-desktop"))
+                    (lib-storage (assoc-ref inputs "lib-storage-for-telegram-desktop"))
+                    (lib-tl (assoc-ref inputs "lib-tl-for-telegram-desktop"))
+                    (lib-ui (assoc-ref inputs "lib-ui-for-telegram-desktop"))
+                    (lib-webrtc (assoc-ref inputs "lib-webrtc-for-telegram-desktop"))
+                    (libtgvoip (assoc-ref inputs "libtgvoip-for-telegram-desktop"))
+                    (rlottie (assoc-ref inputs "rlottie-for-telegram-desktop"))
+                    (tgcalls (assoc-ref inputs "tgcalls-for-telegram-desktop")))
+               (copy-recursively
+                cmake-helpers
+                (string-append to "/cmake"))
+               (copy-recursively
+                codegen
+                (string-append to "/Telegram/codegen"))
+               (copy-recursively
+                lib-base
+                (string-append to "/Telegram/lib_base"))
+               (copy-recursively
+                lib-crl
+                (string-append to "/Telegram/lib_crl"))
+               (copy-recursively
+                lib-lottie
+                (string-append to "/Telegram/lib_lottie"))
+               (copy-recursively
+                lib-qr
+                (string-append to "/Telegram/lib_qr"))
+               (copy-recursively
+                lib-rlottie
+                (string-append to "/Telegram/lib_rlottie"))
+               (copy-recursively
+                lib-rpl
+                (string-append to "/Telegram/lib_rpl"))
+               (copy-recursively
+                lib-spellcheck
+                (string-append to "/Telegram/lib_spellcheck"))
+               (copy-recursively
+                lib-storage
+                (string-append to "/Telegram/lib_storage"))
+               (copy-recursively
+                lib-tl
+                (string-append to "/Telegram/lib_tl"))
+               (copy-recursively
+                lib-ui
+                (string-append to "/Telegram/lib_ui"))
+               (copy-recursively
+                lib-webrtc
+                (string-append to "/Telegram/lib_webrtc"))
+               (copy-recursively
+                libtgvoip
+                (string-append to "/Telegram/ThirdParty/libtgvoip"))
+               (copy-recursively
+                rlottie
+                (string-append to "/Telegram/ThirdParty/rlottie"))
+               (copy-recursively
+                tgcalls
+                (string-append to "/Telegram/ThirdParty/tgcalls")))
+             #t))
+         (add-after 'copy-inputs 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("kwayland" ,kwayland)
+       ("lib-base-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib-crl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib-webrtc-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/telegramdesktop/libtgvoip.git")
+             (commit "37d98e984fd6fa389262307db826d52ab86c8241")))
+           (file-name
+            (git-file-name "libtgvoip-for-telegram-desktop" version))
+           (sha256
+            (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/rlottie.git")
+             (commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")))
+           (file-name
+            (git-file-name "rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       ("tg-owt" ,tg-owt)
+       ("tgcalls-for-telegram-desktop"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6817 bytes --]

From 02e49ec324cbc6924c1a8f905a5b6a6fb053085f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c8a578549d..c1347120bb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #4: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 9c6905c0a107542ebc4a08cb7b8349d9c81bd557 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #5: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 48258c2c1bc21623985e208f0c943991d27d9f15 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #6: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 46f4660f5b23da77bffb620f00e943418af6bb65 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #7: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 3e49d1c88f0b768648e6bd1a59f7396211f6126b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 846051b9ac972e45b6a3c7e91824cca7d0c1d0ab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From b619c1bef5d21b4d9297da0d964e028b1e2558f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #10: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From ff1d90c02ee57a9a74a92e7a496eddbaaa0235bf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #11: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 224a511e7cb2d136512784ed4352ba4f03a39133 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #12: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 092da0e19bfe7618ff294d0a60027f8ea48eb76b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #13: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From c842b20ffa2dc4f925fd192b01dff982d41a3a96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #14: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From c2f89a5b71e3fdffbcd291e74057bc9df86aa1d4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..c8a578549d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v22] Add Telegram Desktop
  2021-01-21  3:44 ` [bug#45721] Telegram Desktop (v21) Raghav Gururajan
@ 2021-01-21 19:11   ` Leo Prikler
  2021-01-21 19:37     ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-21 19:11 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

I cleaned up the copying code and also updated the hash (it was still
the one for the recursive checkout).  For some reason, telegram also
builds without libjpeg (do they have a local copy that I accidentally
enabled that way?)

[-- Attachment #2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From 46160631b94c7117a0795607964a413107d38c07 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/13] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0553c12f28..86d31b2bbc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 03b84efdc8..c557c9e2ec 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From 26d5e6c10da1b454a6ffed46a518217f336daa76 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/13] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 467c1c99b6d0269b0667c9064588917095f90ba9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/13] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 86c49e4c6ba07d6e5809be8543fd647f0269b180 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/13] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From 45c6e70a00d8b08354dd28d4c5c3e5b68075b060 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/13] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From 507be8afc30eb52d4aad4f1a9c63d3630efcbe9c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/13] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 2d06679e6cc74521e824cc38e33139abea42f19e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/13] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 8428fb50befeb3e1b8e38821b75b36465c1e07f4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/13] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 5fd4cda5502ece52518393c9c2c9b854e2be9a3d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/13] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index c557c9e2ec..9e39cc0cd7 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From cba40624114c13d3bd55b858b234b2c2f8f96e0c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/13] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 9e39cc0cd7..56d4e0d562 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 58d92c2d88517f16cc0b5009e689f416b327f7f9 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/13] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6877 bytes --]

From 63f510571d098bfe85ecfc04c2ad0ff72265fb3b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/13] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 86d31b2bbc..0062fd9e9f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 15868 bytes --]

From 9c9147dc7cb59e11a86b037ffa12b91c34ccc187 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 09:30:22 -0500
Subject: [PATCH 13/13] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/telegram.scm | 358 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 357 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..17d84f3810 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,20 +18,42 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +163,337 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '(;; Custom forks which are incompatible with the ones in Guix.
+                    "libtgvoip" "rlottie"
+                    ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils)
+        (ice-9 match))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (match-lambda
+                ((dst src)
+                 (copy-recursively src dst)
+                 (for-each make-file-writable (find-files dst))))
+              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                ("Telegram/lib_lottie"
+                 ,(assoc-ref inputs "lib-lottie-source"))
+                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                ("Telegram/lib_rlottie"
+                 ,(assoc-ref inputs "lib-rlottie-source"))
+                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                ("Telegram/lib_spellcheck"
+                 ,(assoc-ref inputs "lib-spellcheck-source"))
+                ("Telegram/lib_storage"
+                 ,(assoc-ref inputs "lib-storage-source"))
+                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                ("Telegram/ThirdParty/libtgvoip"
+                 ,(assoc-ref inputs "libtgvoip-source"))
+                ("Telegram/ThirdParty/rlottie"
+                 ,(assoc-ref inputs "rlottie-source"))
+                ("Telegram/ThirdParty/tgcalls"
+                 ,(assoc-ref inputs "tgcalls-source"))))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ;; ("kwayland" ,kwayland) ; builds on master fail non-reproducibly
+       ("lib-base-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib-crl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib-webrtc-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libtgvoip-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/telegramdesktop/libtgvoip.git")
+             (commit "37d98e984fd6fa389262307db826d52ab86c8241")))
+           (file-name
+            (git-file-name "libtgvoip-for-telegram-desktop" version))
+           (sha256
+            (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/rlottie.git")
+             (commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")))
+           (file-name
+            (git-file-name "rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       ("tg-owt" ,tg-owt)
+       ("tgcalls-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v22] Add Telegram Desktop
  2021-01-21 19:11   ` [bug#45721] [PATCH v22] Add Telegram Desktop Leo Prikler
@ 2021-01-21 19:37     ` Raghav Gururajan
  2021-01-21 19:44       ` Leo Prikler
  0 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-21 19:37 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> I cleaned up the copying code and also updated the hash (it was still
> the one for the recursive checkout).  For some reason, telegram also
> builds without libjpeg (do they have a local copy that I accidentally
> enabled that way?)

Thanks! With out libjpeg as inputs, does it say 'libjpeg ... found' 
during configure phase?

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v22] Add Telegram Desktop
  2021-01-21 19:37     ` Raghav Gururajan
@ 2021-01-21 19:44       ` Leo Prikler
  2021-01-21 19:46         ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-21 19:44 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Am Donnerstag, den 21.01.2021, 14:37 -0500 schrieb Raghav Gururajan:
> Hi Leo!
> 
> > I cleaned up the copying code and also updated the hash (it was
> > still
> > the one for the recursive checkout).  For some reason, telegram
> > also
> > builds without libjpeg (do they have a local copy that I
> > accidentally
> > enabled that way?)
> 
> Thanks! With out libjpeg as inputs, does it say 'libjpeg ... found' 
> during configure phase?
Indeed it outputs
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
instead, but still succeeds.  Let's add it in regardless and try to
erase any existing copy in the sources.

Regards,
Leo






^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] [PATCH v22] Add Telegram Desktop
  2021-01-21 19:44       ` Leo Prikler
@ 2021-01-21 19:46         ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-21 19:46 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> Indeed it outputs
> -- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
> instead, but still succeeds.  Let's add it in regardless and try to
> erase any existing copy in the sources.

Yeah, if libjpeg is added as inputs, it uses it. If not, its either 
using bundled one (that we don't know of) or silently disabling some 
feature.

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v23)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (18 preceding siblings ...)
  2021-01-21  3:44 ` [bug#45721] Telegram Desktop (v21) Raghav Gururajan
@ 2021-01-22  4:27 ` Raghav Gururajan
  2021-01-22  7:42   ` Leo Prikler
  2021-01-28  0:41 ` [bug#45721] Telegram Desktop (v24) Raghav Gururajan
                   ` (3 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-22  4:27 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 6 bytes --]

Phew!

[-- Attachment #2: 0015-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 14821 bytes --]

From 7461dd8d4dc01e3889a377c00eb02bc11ae178f5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 21 Jan 2021 19:38:08 -0500
Subject: [PATCH 15/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 331 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 330 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index f47c82277c..9534433424 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,24 +18,45 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system meson))
+  #:use-module (guix build-system meson)
+  #:use-module (guix build-system qt))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -238,3 +259,311 @@ for rendering vector based animations and art in realtime.")
     (description "Tg-VoIP is the VoIP library for Telegram Desktop application.")
     (home-page "https://github.com/telegramdesktop/libtgvoip")
     (license license:unlicense)))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils)
+        (ice-9 match))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (match-lambda
+                ((dst src)
+                 (copy-recursively src dst)
+                 (for-each make-file-writable (find-files dst))))
+              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                ("Telegram/lib_lottie"
+                 ,(assoc-ref inputs "lib-lottie-source"))
+                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                ("Telegram/lib_rlottie"
+                 ,(assoc-ref inputs "lib-rlottie-source"))
+                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                ("Telegram/lib_spellcheck"
+                 ,(assoc-ref inputs "lib-spellcheck-source"))
+                ("Telegram/lib_storage"
+                 ,(assoc-ref inputs "lib-storage-source"))
+                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                ("Telegram/ThirdParty/tgcalls"
+                 ,(assoc-ref inputs "tgcalls-source"))))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib-base-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib-crl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib-webrtc-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("tg-owt" ,tg-owt)
+       ("tg-rlottie" ,tg-rlottie)
+       ("tg-voip" ,tg-voip)
+       ("tgcalls-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #3: 0014-gnu-Add-tg-voip.patch --]
[-- Type: text/x-patch, Size: 2958 bytes --]

From e83b805f35c59f0b0ec9a6b97db7105b4ca773ac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 21 Jan 2021 19:28:34 -0500
Subject: [PATCH 14/18] gnu: Add tg-voip.

* gnu/packages/telegram.scm (tg-voip): New variable.
---
 gnu/packages/telegram.scm | 52 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index e518a8dcd3..f47c82277c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -19,6 +19,7 @@
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
@@ -33,6 +34,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson))
 
 (define-public tg-owt
@@ -186,3 +188,53 @@ in telegram-desktop.  Rlottie is a platform independent standalone c++ library
 for rendering vector based animations and art in realtime.")
       (home-page "https://github.com/desktop-app/rlottie")
       (license license:expat))))
+
+(define-public tg-voip
+  (package
+    (name "tg-voip")
+    (version "2.4.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/libtgvoip.git")
+         (commit "37d98e984fd6fa389262307db826d52ab86c8241")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "--disable-static"
+        "--disable-dsp" ; FIXME
+        "--enable-audio-callback"
+        "--with-alsa"
+        "--with-pulse")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-linkers
+           (lambda _
+             (substitute* "Makefile.am"
+               (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
+                "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
+             (substitute* "tgvoip.pc.in"
+               (("libcrypto opus")
+                "libcrypto opus alsa libpulse"))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)))
+    (synopsis "Telegram VoIP Library")
+    (description "Tg-VoIP is the VoIP library for Telegram Desktop application.")
+    (home-page "https://github.com/telegramdesktop/libtgvoip")
+    (license license:unlicense)))
-- 
2.30.0


[-- Attachment #4: 0013-gnu-Add-tg-rlottie.patch --]
[-- Type: text/x-patch, Size: 2861 bytes --]

From 7217783db5e04297af929868d8f115d5b579aceb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 21 Jan 2021 19:23:02 -0500
Subject: [PATCH 13/18] gnu: Add tg-rlottie.

* gnu/packages/telegram.scm (tg-rlottie): New variable.
---
 gnu/packages/telegram.scm | 47 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0fd47f4f5d..e518a8dcd3 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -19,6 +19,7 @@
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
@@ -31,7 +32,8 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system meson))
 
 (define-public tg-owt
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -141,3 +143,46 @@ for its use in telegram desktop client.")
         license:gpl3
         ;; LibSRTP, LibVPx, UsrSCTP and Others
         license:bsd-3)))))
+
+(define-public tg-rlottie
+  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
+        (revision "1"))
+    (package
+      (name "tg-rlottie")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/rlottie.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+      (build-system meson-build-system)
+      (arguments
+       `(#:configure-flags
+         (list
+          "-Dlog=true"
+          "-Ddumptree=true"
+          "-Dtest=true")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'patch-cxx-flags
+             (lambda _
+               (substitute* "meson.build"
+                 (("werror=true")
+                  "werror=false"))
+               #t)))))
+      (native-inputs
+       `(("googletest" ,googletest)
+         ("pkg-config" ,pkg-config)))
+      (synopsis "Lottie Animation Library for Telegram-Desktop")
+      (description "TG-Rlottie is a custom fork of rlottie, modified for its use
+in telegram-desktop.  Rlottie is a platform independent standalone c++ library
+for rendering vector based animations and art in realtime.")
+      (home-page "https://github.com/desktop-app/rlottie")
+      (license license:expat))))
-- 
2.30.0


[-- Attachment #5: 0012-gnu-Add-tg-owt.patch --]
[-- Type: text/x-patch, Size: 6817 bytes --]

From 02e49ec324cbc6924c1a8f905a5b6a6fb053085f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add tg-owt.

* gnu/packages/telegram.scm: New module.
(tg-owt): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 143 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c8a578549d..c1347120bb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -534,6 +534,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0fd47f4f5d
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public tg-owt
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (package
+      (name "tg-owt")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/desktop-app/tg_owt.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+         (modules '((guix build utils)
+                    (ice-9 ftw)
+                    (srfi srfi-1)))
+         (snippet
+          `(begin
+             (let ((keep
+                    '( ;; Custom forks which are incompatible with the ones in Guix.
+                      "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                      ;; Not available in Guix.
+                      "pffft" "usrsctp"
+                      ;; Has cmake support files for libvpx input.
+                      "libvpx")))
+               (with-directory-excursion "src/third_party"
+                 (for-each delete-file-recursively
+                           (lset-difference string=?
+                                            (scandir ".")
+                                            (cons* "." ".." keep))))
+               #t)))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          "-DCMAKE_C_FLAGS=-fPIC"
+          "-DCMAKE_CXX_FLAGS=-fPIC")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'copy-inputs
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                      (libyuv-from (assoc-ref inputs "libyuv"))
+                      (libvpx-to (string-append (getcwd)
+                                                "/src/third_party/libvpx/source/libvpx"))
+                      (libyuv-to (string-append (getcwd)
+                                                "/src/third_party/libyuv")))
+                 (copy-recursively libvpx-from libvpx-to)
+                 (copy-recursively libyuv-from libyuv-to))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("python" ,python-wrapper)
+         ("yasm" ,yasm)))
+      (inputs
+       `(("alsa" ,alsa-lib)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libvpx"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/webm/libvpx")
+               (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+             (file-name
+              (git-file-name "libvpx-for-tg-owt" version))
+             (sha256
+              (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+         ("libyuv"
+          ,(origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://chromium.googlesource.com/libyuv/libyuv")
+               (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+             (file-name
+              (git-file-name "libyuv-for-tg-owt" version))
+             (sha256
+              (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+         ("openssl" ,openssl)
+         ("opus" ,opus)
+         ("protobuf" ,protobuf)
+         ("pulseaudio" ,pulseaudio)))
+      (synopsis "WebRTC support for Telegram-Desktop")
+      (description "Tg_owt is a custom WebRTC fork by Telegram project,
+for its use in telegram desktop client.")
+      (home-page "https://github.com/desktop-app/tg_owt")
+      (license
+       (list
+        ;; Abseil-CPP
+        license:asl2.0
+        ;; LibYuv
+        (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+        ;; OpenH264
+        license:bsd-2
+        ;; PFFFT
+        (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+        ;; RnNoise
+        license:gpl3
+        ;; LibSRTP, LibVPx, UsrSCTP and Others
+        license:bsd-3)))))
-- 
2.30.0


[-- Attachment #6: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 9c6905c0a107542ebc4a08cb7b8349d9c81bd557 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 60e4f43c6a..a0409b0060 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #7: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2215 bytes --]

From 48258c2c1bc21623985e208f0c943991d27d9f15 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 00:52:37 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/cpp.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 0d75b9237e..afb8be076f 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -39,12 +39,14 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -64,6 +66,37 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 (define-public range-v3
   (package
     (name "range-v3")
-- 
2.30.0


[-- Attachment #8: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From 46f4660f5b23da77bffb620f00e943418af6bb65 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 2514af5a84..0d75b9237e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From 3e49d1c88f0b768648e6bd1a59f7396211f6126b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 79d41b3e73..60e4f43c6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From 846051b9ac972e45b6a3c7e91824cca7d0c1d0ab Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #11: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From b619c1bef5d21b4d9297da0d964e028b1e2558f8 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #12: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From ff1d90c02ee57a9a74a92e7a496eddbaaa0235bf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #13: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 224a511e7cb2d136512784ed4352ba4f03a39133 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #14: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 092da0e19bfe7618ff294d0a60027f8ea48eb76b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #15: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From c842b20ffa2dc4f925fd192b01dff982d41a3a96 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #16: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From c2f89a5b71e3fdffbcd291e74057bc9df86aa1d4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb28104add..c8a578549d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -914,6 +914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 45d3faeafb..2514af5a84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v23)
  2021-01-22  4:27 ` [bug#45721] Telegram Desktop (v23) Raghav Gururajan
@ 2021-01-22  7:42   ` Leo Prikler
  2021-01-28  0:41     ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-22  7:42 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Hi,

Am Donnerstag, den 21.01.2021, 23:27 -0500 schrieb Raghav Gururajan:
> * gnu/packages/cpp.scm (rlottie): New variable.
I know I signed this off before, but this probably belongs in
animation.scm instead.

> +(define-public tg-rlottie
> +  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
> +        (revision "1"))
> +    (package
> +      (name "tg-rlottie")
> +      (version
> +       (git-version "0" revision commit))
Use the latest version previous to that commit as base.  If you can,
try to inherit from the rlottie package.
You should probably also call this "rlottie-for-telegram-desktop" in
just the variable name.

> +(define-public tg-voip
> +  (package
> +    (name "tg-voip")
> +    (version "2.4.4")
Use git-version, also call it "libtgvoip-for-telegram-desktop" as
above.
Both should also be hidden.  As an example for how to do this
"correctly", see ffmpeg-for-stepmania in video.scm

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v24)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (19 preceding siblings ...)
  2021-01-22  4:27 ` [bug#45721] Telegram Desktop (v23) Raghav Gururajan
@ 2021-01-28  0:41 ` Raghav Gururajan
  2021-01-28  7:47   ` Leo Prikler
  2021-01-30 17:04 ` [bug#45721] Telegram Desktop (v25) Raghav Gururajan
                   ` (2 subsequent siblings)
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-28  0:41 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 5902 bytes --]

From d2c058a8ef2d34f6a9c0e63a4eb565d6abcfb9d3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/15] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cc9b47b493..af848e9124 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -915,6 +915,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 73a3ceb2df..d19712275c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]

From ae7b4f2e2e74b0c82ea2edc5d82d5e9015bad3e7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/15] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 324c9fd7bf76bfc2f2c37feb6504f8ed88720a94 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/15] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From 400743163a4875972ac76a3677ce0804e18ad80e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/15] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4266 bytes --]

From 29bb86748beec07d5f7a3c2c95b1d3282467a74c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/15] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 6884 bytes --]

From 6a9b4a898bfef197c6286e5c78e2838d52c0614f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/15] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2264 bytes --]

From b2c98842c46da8e64990e6ad31e6df26b03adaac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/15] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2304 bytes --]

From e9233525cfc7c0699c54194a88c6db1d3bd8fd9f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/15] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 96a28ceb29..d1822e9707 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2274 bytes --]

From e16d011e04e7e523a80c4205f7c820b7afb4f7b2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/15] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index d19712275c..ae47490755 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2218 bytes --]

From a67abbc44f5660235b08e0506dfd1e5e9a0adb45 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 14:45:54 -0500
Subject: [PATCH 10/15] gnu: Add rlottie.

* gnu/packages/animation.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/animation.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/animation.scm b/gnu/packages/animation.scm
index 6bfe8f0a12..c92c4ae7e7 100644
--- a/gnu/packages/animation.scm
+++ b/gnu/packages/animation.scm
@@ -26,10 +26,12 @@
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages dejagnu)
@@ -53,6 +55,37 @@
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 ;; ETL, synfig, and Synfig Studio are updated in tandem.
 (define synfig-version "1.2.2")
 
-- 
2.30.0


[-- Attachment #12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2826 bytes --]

From 40871c75bc0f5db550298403838ead4f298101eb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/15] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d1822e9707..cef9c6802f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #13: 0012-gnu-Add-webrtc-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 7089 bytes --]

From ea52c3da0446ec23d38c4b9685ce5af30896811a Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/15] gnu: Add webrtc-for-telegram-desktop.

* gnu/packages/telegram.scm: New module.
(webrtc-for-telegram-desktop): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 144 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 145 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index af848e9124..25d83c3a92 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -535,6 +535,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..4263617903
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,144 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public webrtc-for-telegram-desktop
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "1"))
+    (hidden-package
+     (package
+       (name "webrtc-for-telegram-desktop")
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/tg_owt.git")
+            (commit commit)))
+          (file-name
+           (git-file-name name version))
+          (sha256
+           (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+          (modules '((guix build utils)
+                     (ice-9 ftw)
+                     (srfi srfi-1)))
+          (snippet
+           `(begin
+              (let ((keep
+                     '( ;; Custom forks which are incompatible with the ones in Guix.
+                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                       ;; Not available in Guix.
+                       "pffft" "usrsctp"
+                       ;; Has cmake support files for libvpx input.
+                       "libvpx")))
+                (with-directory-excursion "src/third_party"
+                  (for-each delete-file-recursively
+                            (lset-difference string=?
+                                             (scandir ".")
+                                             (cons* "." ".." keep))))
+                #t)))))
+       (build-system cmake-build-system)
+       (arguments
+        `(#:tests? #f                   ; No target
+          #:configure-flags
+          (list
+           "-DCMAKE_C_FLAGS=-fPIC"
+           "-DCMAKE_CXX_FLAGS=-fPIC")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'copy-inputs
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                       (libyuv-from (assoc-ref inputs "libyuv"))
+                       (libvpx-to (string-append (getcwd)
+                                                 "/src/third_party/libvpx/source/libvpx"))
+                       (libyuv-to (string-append (getcwd)
+                                                 "/src/third_party/libyuv")))
+                  (copy-recursively libvpx-from libvpx-to)
+                  (copy-recursively libyuv-from libyuv-to))
+                #t)))))
+       (native-inputs
+        `(("pkg-config" ,pkg-config)
+          ("python" ,python-wrapper)
+          ("yasm" ,yasm)))
+       (inputs
+        `(("alsa" ,alsa-lib)
+          ("ffmpeg" ,ffmpeg)
+          ("libjpeg" ,libjpeg-turbo)
+          ("libvpx"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/webm/libvpx")
+                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+              (file-name
+               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+          ("libyuv"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/libyuv/libyuv")
+                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+              (file-name
+               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+          ("openssl" ,openssl)
+          ("opus" ,opus)
+          ("protobuf" ,protobuf)
+          ("pulseaudio" ,pulseaudio)))
+       (synopsis "WebRTC support for Telegram Desktop")
+       (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
+Telegram project, for its use in telegram desktop client.")
+       (home-page "https://github.com/desktop-app/tg_owt")
+       (license
+        (list
+         ;; Abseil-CPP
+         license:asl2.0
+         ;; LibYuv
+         (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+         ;; OpenH264
+         license:bsd-2
+         ;; PFFFT
+         (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+         ;; RnNoise
+         license:gpl3
+         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         license:bsd-3))))))
-- 
2.30.0


[-- Attachment #14: 0013-gnu-Add-rlottie-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 2556 bytes --]

From 96168b8baf87a187ebd9797c09360100aca3b3b1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:37:39 -0500
Subject: [PATCH 13/15] gnu: Add rlottie-for-telegram-desktop.

* gnu/packages/telegram.scm (rlottie-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 4263617903..7c5daec706 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,7 +18,9 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
@@ -31,7 +33,8 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -142,3 +145,37 @@ Telegram project, for its use in telegram desktop client.")
          license:gpl3
          ;; LibSRTP, LibVPx, UsrSCTP and Others
          license:bsd-3))))))
+
+(define-public rlottie-for-telegram-desktop
+  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
+        (revision "1"))
+    (hidden-package
+     (package
+       (inherit rlottie)
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/rlottie.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "rlottie-for-telegram-desktop" version))
+          (sha256
+           (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "-Dlog=true"
+           "-Ddumptree=true"
+           "-Dtest=true")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-cxx-flags
+              (lambda _
+                (substitute* "meson.build"
+                  (("werror=true")
+                   "werror=false"))
+                #t)))))))))
-- 
2.30.0


[-- Attachment #15: 0014-gnu-Add-libtgvoip-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 3143 bytes --]

From 7ca6ed0673cb4d170995f8f2a7fa5010fd335321 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:57:44 -0500
Subject: [PATCH 14/15] gnu: Add libtgvoip-for-telegram-desktop.

* gnu/packages/telegram.scm (libtgvoip-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 7c5daec706..75877fb8eb 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -20,6 +20,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
@@ -27,6 +28,7 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
@@ -34,6 +36,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
@@ -179,3 +182,47 @@ Telegram project, for its use in telegram desktop client.")
                   (("werror=true")
                    "werror=false"))
                 #t)))))))))
+
+(define-public libtgvoip-for-telegram-desktop
+  (let ((commit "37d98e984fd6fa389262307db826d52ab86c8241")
+        (revision "1"))
+    (hidden-package
+     (package
+       (inherit libtgvoip)
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/telegramdesktop/libtgvoip.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "libtgvoip-for-telegram-desktop" version))
+          (sha256
+           (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "--disable-static"
+           "--disable-dsp"              ; FIXME
+           "--enable-audio-callback"
+           "--with-alsa"
+           "--with-pulse")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-linkers
+              (lambda _
+                (substitute* "Makefile.am"
+                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
+                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
+                (substitute* "tgvoip.pc.in"
+                  (("libcrypto opus")
+                   "libcrypto opus alsa libpulse"))
+                #t)))))
+       (native-inputs
+        `(("autoconf" ,autoconf)
+          ("automake" ,automake)
+          ("libtool" ,libtool)
+          ("pkg-config" ,pkg-config)))))))
-- 
2.30.0


[-- Attachment #16: 0015-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 14912 bytes --]

From 242b5fa062786edf9c7a603fc75bd069aa4c8f29 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 19:21:23 -0500
Subject: [PATCH 15/15] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 331 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 330 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 75877fb8eb..c827516a51 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,26 +18,47 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system meson))
+  #:use-module (guix build-system meson)
+  #:use-module (guix build-system qt))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -226,3 +247,311 @@ Telegram project, for its use in telegram desktop client.")
           ("automake" ,automake)
           ("libtool" ,libtool)
           ("pkg-config" ,pkg-config)))))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils)
+        (ice-9 match))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (match-lambda
+                ((dst src)
+                 (copy-recursively src dst)
+                 (for-each make-file-writable (find-files dst))))
+              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                ("Telegram/lib_lottie"
+                 ,(assoc-ref inputs "lib-lottie-source"))
+                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                ("Telegram/lib_rlottie"
+                 ,(assoc-ref inputs "lib-rlottie-source"))
+                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                ("Telegram/lib_spellcheck"
+                 ,(assoc-ref inputs "lib-spellcheck-source"))
+                ("Telegram/lib_storage"
+                 ,(assoc-ref inputs "lib-storage-source"))
+                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                ("Telegram/ThirdParty/tgcalls"
+                 ,(assoc-ref inputs "tgcalls-source"))))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib-base-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib-crl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib-webrtc-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie-for-telegram-desktop)
+       ("tgcalls-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("webrtc" ,webrtc-for-telegram-desktop)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v23)
  2021-01-22  7:42   ` Leo Prikler
@ 2021-01-28  0:41     ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-28  0:41 UTC (permalink / raw)
  To: Leo Prikler, 45721

Hi Leo!

> Am Donnerstag, den 21.01.2021, 23:27 -0500 schrieb Raghav Gururajan:
>> * gnu/packages/cpp.scm (rlottie): New variable.
> I know I signed this off before, but this probably belongs in
> animation.scm instead.
> 
>> +(define-public tg-rlottie
>> +  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
>> +        (revision "1"))
>> +    (package
>> +      (name "tg-rlottie")
>> +      (version
>> +       (git-version "0" revision commit))
> Use the latest version previous to that commit as base.  If you can,
> try to inherit from the rlottie package.
> You should probably also call this "rlottie-for-telegram-desktop" in
> just the variable name.
> 
>> +(define-public tg-voip
>> +  (package
>> +    (name "tg-voip")
>> +    (version "2.4.4")
> Use git-version, also call it "libtgvoip-for-telegram-desktop" as
> above.
> Both should also be hidden.  As an example for how to do this
> "correctly", see ffmpeg-for-stepmania in video.scm

I have made the changed in v24. :-)

Regards,
RG.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v24)
  2021-01-28  0:41 ` [bug#45721] Telegram Desktop (v24) Raghav Gururajan
@ 2021-01-28  7:47   ` Leo Prikler
  0 siblings, 0 replies; 55+ messages in thread
From: Leo Prikler @ 2021-01-28  7:47 UTC (permalink / raw)
  To: Raghav Gururajan, 45721

Am Mittwoch, den 27.01.2021, 19:41 -0500 schrieb Raghav Gururajan:
> (git-version "0" revision commit)
What are the closest releases of those packages?  At which point where
they forked?

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v25)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (20 preceding siblings ...)
  2021-01-28  0:41 ` [bug#45721] Telegram Desktop (v24) Raghav Gururajan
@ 2021-01-30 17:04 ` Raghav Gururajan
       [not found]   ` <e881733992b22e238f2b90149dbceac6c3467180.camel@student.tugraz.at>
  2021-01-30 18:02 ` [bug#45721] Telegram Desktop (v26) Raghav Gururajan
  2021-01-30 19:02 ` [bug#45721] Telegram Desktop (v27) Raghav Gururajan
  23 siblings, 1 reply; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-30 17:04 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 6076 bytes --]

From d2c058a8ef2d34f6a9c0e63a4eb565d6abcfb9d3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/19] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cc9b47b493..af848e9124 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -915,6 +915,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 73a3ceb2df..d19712275c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3621 bytes --]

From ae7b4f2e2e74b0c82ea2edc5d82d5e9015bad3e7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/19] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1391 bytes --]

From 324c9fd7bf76bfc2f2c37feb6504f8ed88720a94 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/19] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #1.1.5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3208 bytes --]

From 400743163a4875972ac76a3677ce0804e18ad80e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/19] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #1.1.6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4395 bytes --]

From 29bb86748beec07d5f7a3c2c95b1d3282467a74c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/19] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #1.1.7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 7066 bytes --]

From 6a9b4a898bfef197c6286e5c78e2838d52c0614f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/19] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #1.1.8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2333 bytes --]

From b2c98842c46da8e64990e6ad31e6df26b03adaac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/19] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #1.1.9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2376 bytes --]

From e9233525cfc7c0699c54194a88c6db1d3bd8fd9f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/19] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 96a28ceb29..d1822e9707 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #1.1.10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2347 bytes --]

From e16d011e04e7e523a80c4205f7c820b7afb4f7b2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/19] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index d19712275c..ae47490755 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #1.1.11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2288 bytes --]

From a67abbc44f5660235b08e0506dfd1e5e9a0adb45 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 14:45:54 -0500
Subject: [PATCH 10/19] gnu: Add rlottie.

* gnu/packages/animation.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/animation.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/animation.scm b/gnu/packages/animation.scm
index 6bfe8f0a12..c92c4ae7e7 100644
--- a/gnu/packages/animation.scm
+++ b/gnu/packages/animation.scm
@@ -26,10 +26,12 @@
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages dejagnu)
@@ -53,6 +55,37 @@
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 ;; ETL, synfig, and Synfig Studio are updated in tandem.
 (define synfig-version "1.2.2")
 
-- 
2.30.0


[-- Attachment #1.1.12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2907 bytes --]

From 40871c75bc0f5db550298403838ead4f298101eb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/19] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d1822e9707..cef9c6802f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #1.1.13: 0012-gnu-Add-webrtc-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 7269 bytes --]

From 51341705105c04fad218cf311e207b22654ce56d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/19] gnu: Add webrtc-for-telegram-desktop.

* gnu/packages/telegram.scm: New module.
(webrtc-for-telegram-desktop): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 144 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 145 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index af848e9124..25d83c3a92 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -535,6 +535,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..0558c766d8
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,144 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public webrtc-for-telegram-desktop
+  (let ((commit "be23804afce3bb2e80a1d57a7c1318c71b82b7de")
+        (revision "80"))
+    (hidden-package
+     (package
+       (name "webrtc-for-telegram-desktop")
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/tg_owt.git")
+            (commit commit)))
+          (file-name
+           (git-file-name name version))
+          (sha256
+           (base32 "11w56w548flmaqxgy9hwx308ah7mzlgqa339nq2q09r364g3b3vq"))
+          (modules '((guix build utils)
+                     (ice-9 ftw)
+                     (srfi srfi-1)))
+          (snippet
+           `(begin
+              (let ((keep
+                     '( ;; Custom forks which are incompatible with the ones in Guix.
+                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                       ;; Not available in Guix.
+                       "pffft" "usrsctp"
+                       ;; Has cmake support files for libvpx input.
+                       "libvpx")))
+                (with-directory-excursion "src/third_party"
+                  (for-each delete-file-recursively
+                            (lset-difference string=?
+                                             (scandir ".")
+                                             (cons* "." ".." keep))))
+                #t)))))
+       (build-system cmake-build-system)
+       (arguments
+        `(#:tests? #f                   ; No target
+          #:configure-flags
+          (list
+           "-DCMAKE_C_FLAGS=-fPIC"
+           "-DCMAKE_CXX_FLAGS=-fPIC")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'copy-inputs
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                       (libyuv-from (assoc-ref inputs "libyuv"))
+                       (libvpx-to (string-append (getcwd)
+                                                 "/src/third_party/libvpx/source/libvpx"))
+                       (libyuv-to (string-append (getcwd)
+                                                 "/src/third_party/libyuv")))
+                  (copy-recursively libvpx-from libvpx-to)
+                  (copy-recursively libyuv-from libyuv-to))
+                #t)))))
+       (native-inputs
+        `(("pkg-config" ,pkg-config)
+          ("python" ,python-wrapper)
+          ("yasm" ,yasm)))
+       (inputs
+        `(("alsa" ,alsa-lib)
+          ("ffmpeg" ,ffmpeg)
+          ("libjpeg" ,libjpeg-turbo)
+          ("libvpx"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/webm/libvpx")
+                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+              (file-name
+               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+          ("libyuv"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/libyuv/libyuv")
+                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+              (file-name
+               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+          ("openssl" ,openssl)
+          ("opus" ,opus)
+          ("protobuf" ,protobuf)
+          ("pulseaudio" ,pulseaudio)))
+       (synopsis "WebRTC support for Telegram Desktop")
+       (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
+Telegram project, for its use in telegram desktop client.")
+       (home-page "https://github.com/desktop-app/tg_owt")
+       (license
+        (list
+         ;; Abseil-CPP
+         license:asl2.0
+         ;; LibYuv
+         (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+         ;; OpenH264
+         license:bsd-2
+         ;; PFFFT
+         (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+         ;; RnNoise
+         license:gpl3
+         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         license:bsd-3))))))
-- 
2.30.0


[-- Attachment #1.1.14: 0013-gnu-Add-rlottie-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 2634 bytes --]

From f08d0b03c2341c970c6720594766ebf5ff841afb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:37:39 -0500
Subject: [PATCH 13/19] gnu: Add rlottie-for-telegram-desktop.

* gnu/packages/telegram.scm (rlottie-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 0558c766d8..81b2f861c6 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,7 +18,9 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
@@ -31,7 +33,8 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "be23804afce3bb2e80a1d57a7c1318c71b82b7de")
@@ -142,3 +145,37 @@ Telegram project, for its use in telegram desktop client.")
          license:gpl3
          ;; LibSRTP, LibVPx, UsrSCTP and Others
          license:bsd-3))))))
+
+(define-public rlottie-for-telegram-desktop
+  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
+        (revision "12"))
+    (hidden-package
+     (package
+       (inherit rlottie)
+       (version
+        (git-version "0.2" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/rlottie.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "rlottie-for-telegram-desktop" version))
+          (sha256
+           (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "-Dlog=true"
+           "-Ddumptree=true"
+           "-Dtest=true")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-cxx-flags
+              (lambda _
+                (substitute* "meson.build"
+                  (("werror=true")
+                   "werror=false"))
+                #t)))))))))
-- 
2.30.0


[-- Attachment #1.1.15: 0014-gnu-Add-libtgvoip-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 3237 bytes --]

From c97aba1234c2cb1136e067574673c4e819fdf0fc Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:57:44 -0500
Subject: [PATCH 14/19] gnu: Add libtgvoip-for-telegram-desktop.

* gnu/packages/telegram.scm (libtgvoip-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 81b2f861c6..a2da79a08e 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -20,6 +20,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
@@ -27,6 +28,7 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
@@ -34,6 +36,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
@@ -179,3 +182,47 @@ Telegram project, for its use in telegram desktop client.")
                   (("werror=true")
                    "werror=false"))
                 #t)))))))))
+
+(define-public libtgvoip-for-telegram-desktop
+  (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
+        (revision "88"))
+    (hidden-package
+     (package
+       (inherit libtgvoip)
+       (version
+        (git-version "2.4.4" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/telegramdesktop/libtgvoip.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "libtgvoip-for-telegram-desktop" version))
+          (sha256
+           (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "--disable-static"
+           "--disable-dsp"              ; FIXME
+           "--enable-audio-callback"
+           "--with-alsa"
+           "--with-pulse")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-linkers
+              (lambda _
+                (substitute* "Makefile.am"
+                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
+                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
+                (substitute* "tgvoip.pc.in"
+                  (("libcrypto opus")
+                   "libcrypto opus alsa libpulse"))
+                #t)))))
+       (native-inputs
+        `(("autoconf" ,autoconf)
+          ("automake" ,automake)
+          ("libtool" ,libtool)
+          ("pkg-config" ,pkg-config)))))))
-- 
2.30.0


[-- Attachment #1.1.16: 0015-gnu-kwayland-Disable-failing-tests.patch --]
[-- Type: text/x-patch, Size: 1188 bytes --]

From cf7065c7e4b0ef2af7e0a6a018d6a3d8da279cc1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 30 Jan 2021 11:42:12 -0500
Subject: [PATCH 15/19] gnu: kwayland: Disable failing tests.

* gnu/packages/kde-frameworks.scm (kwayland) [arguments]<#:phases>
['disable-failing-tests]: New phase.
---
 gnu/packages/kde-frameworks.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 8c2028b978..cf5840f3f3 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -1049,6 +1049,12 @@ integration with a custom editor as well as a ready-to-use
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "autotests/client/CMakeLists.txt"
+               (("    add_test\\(NAME kwayland-testPlasmaWindowModel COMMAND testPlasmaWindowModel\\)")
+                ""))
+             #t))
          (add-before 'check 'check-setup
            (lambda _
              (setenv "XDG_RUNTIME_DIR" "/tmp")
-- 
2.30.0


[-- Attachment #1.1.17: 0016-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 15322 bytes --]

From 80ef6c171be7b9d1271617d1babb49fbe1510311 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 19:21:23 -0500
Subject: [PATCH 16/19] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 332 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 331 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index a2da79a08e..4aa9fdbb6f 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,26 +18,47 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system meson))
+  #:use-module (guix build-system meson)
+  #:use-module (guix build-system qt))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "be23804afce3bb2e80a1d57a7c1318c71b82b7de")
@@ -226,3 +247,312 @@ Telegram project, for its use in telegram desktop client.")
           ("automake" ,automake)
           ("libtool" ,libtool)
           ("pkg-config" ,pkg-config)))))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.8")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1kdizvzvzip1x902b8hm2np55qgbdfbd7xwkapkc98h22b2v3qip"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils)
+        (ice-9 match))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (match-lambda
+                ((dst src)
+                 (copy-recursively src dst)
+                 (for-each make-file-writable (find-files dst))))
+              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                ("Telegram/lib_lottie"
+                 ,(assoc-ref inputs "lib-lottie-source"))
+                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                ("Telegram/lib_rlottie"
+                 ,(assoc-ref inputs "lib-rlottie-source"))
+                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                ("Telegram/lib_spellcheck"
+                 ,(assoc-ref inputs "lib-spellcheck-source"))
+                ("Telegram/lib_storage"
+                 ,(assoc-ref inputs "lib-storage-source"))
+                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                ("Telegram/ThirdParty/tgcalls"
+                 ,(assoc-ref inputs "tgcalls-source"))))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "561273a2f88306072750283b28d763959cd58652")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0cvv713ajqp5b4l8pbpcd391hlkc7vkm2frnbg6qsai8wj0mdjvc"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("kwayland" ,kwayland)
+       ("lib-base-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "2bf29ab1a5458003c8ed250886e08c61cce5ff72")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "1i92pj6wjgl78sv7l9f6xas0ar7313a4wx95p49hshpf5bc820ca"))))
+       ("lib-crl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "d94cb34219e5795efc0efe24d980c54e40eb42e3")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "1l3h4hxpmvx7m5x354h4mxz2nfk1hc95i86rnyj2r3lzwq2dqdpy"))))
+       ("lib-webrtc-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "af7269454c371b7e1045429d60cd728f7580ee4a")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "087005hjw5rw5s8q54x991xkbc1g4q5dgy6gxhhlfr47x4n8k1xx"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie-for-telegram-desktop)
+       ("tgcalls-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "bea2e218959244590fa57b62803bf2a7a5e15bc7")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "0y1k7i0vpzmv3sf32a8gk67ljjy7g6qb1p0lx1z1a9ig3gpv824i"))))
+       ("webrtc" ,webrtc-for-telegram-desktop)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #1.1.18: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v26)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (21 preceding siblings ...)
  2021-01-30 17:04 ` [bug#45721] Telegram Desktop (v25) Raghav Gururajan
@ 2021-01-30 18:02 ` Raghav Gururajan
  2021-01-30 19:02 ` [bug#45721] Telegram Desktop (v27) Raghav Gururajan
  23 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-30 18:02 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 6076 bytes --]

From d2c058a8ef2d34f6a9c0e63a4eb565d6abcfb9d3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/19] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cc9b47b493..af848e9124 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -915,6 +915,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 73a3ceb2df..d19712275c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3621 bytes --]

From ae7b4f2e2e74b0c82ea2edc5d82d5e9015bad3e7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/19] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1391 bytes --]

From 324c9fd7bf76bfc2f2c37feb6504f8ed88720a94 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/19] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #1.1.5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3208 bytes --]

From 400743163a4875972ac76a3677ce0804e18ad80e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/19] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #1.1.6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4395 bytes --]

From 29bb86748beec07d5f7a3c2c95b1d3282467a74c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/19] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #1.1.7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 7066 bytes --]

From 6a9b4a898bfef197c6286e5c78e2838d52c0614f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/19] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #1.1.8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2333 bytes --]

From b2c98842c46da8e64990e6ad31e6df26b03adaac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/19] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #1.1.9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2376 bytes --]

From e9233525cfc7c0699c54194a88c6db1d3bd8fd9f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/19] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 96a28ceb29..d1822e9707 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #1.1.10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2347 bytes --]

From e16d011e04e7e523a80c4205f7c820b7afb4f7b2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/19] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index d19712275c..ae47490755 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #1.1.11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2288 bytes --]

From a67abbc44f5660235b08e0506dfd1e5e9a0adb45 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 14:45:54 -0500
Subject: [PATCH 10/19] gnu: Add rlottie.

* gnu/packages/animation.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/animation.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/animation.scm b/gnu/packages/animation.scm
index 6bfe8f0a12..c92c4ae7e7 100644
--- a/gnu/packages/animation.scm
+++ b/gnu/packages/animation.scm
@@ -26,10 +26,12 @@
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages dejagnu)
@@ -53,6 +55,37 @@
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 ;; ETL, synfig, and Synfig Studio are updated in tandem.
 (define synfig-version "1.2.2")
 
-- 
2.30.0


[-- Attachment #1.1.12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2907 bytes --]

From 40871c75bc0f5db550298403838ead4f298101eb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/19] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d1822e9707..cef9c6802f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #1.1.13: 0012-gnu-Add-webrtc-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 7324 bytes --]

From bb46d5dd0dd29108e573785e25ba3c56e797930f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/19] gnu: Add webrtc-for-telegram-desktop.

* gnu/packages/telegram.scm: New module.
(webrtc-for-telegram-desktop): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 145 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 146 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index af848e9124..25d83c3a92 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -535,6 +535,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..adcdd3a6b3
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,145 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public webrtc-for-telegram-desktop
+  (let ((commit "be23804afce3bb2e80a1d57a7c1318c71b82b7de")
+        (revision "80"))
+    (hidden-package
+     (package
+       (name "webrtc-for-telegram-desktop")
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/tg_owt.git")
+            (commit commit)))
+          (file-name
+           (git-file-name name version))
+          (sha256
+           (base32 "11w56w548flmaqxgy9hwx308ah7mzlgqa339nq2q09r364g3b3vq"))
+          (modules '((guix build utils)
+                     (ice-9 ftw)
+                     (srfi srfi-1)))
+          (snippet
+           `(begin
+              (let ((keep
+                     '( ;; Custom forks which are incompatible with the ones in Guix.
+                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                       ;; Not available in Guix.
+                       "pffft" "usrsctp"
+                       ;; Has cmake support files for libvpx input.
+                       "libvpx")))
+                (with-directory-excursion "src/third_party"
+                  (for-each delete-file-recursively
+                            (lset-difference string=?
+                                             (scandir ".")
+                                             (cons* "." ".." keep))))
+                #t)))))
+       (build-system cmake-build-system)
+       (arguments
+        `(#:tests? #f                   ; No target
+          #:configure-flags
+          (list
+           "-DBUILD_SHARED_LIBS=0" ; Broken upstream
+           "-DCMAKE_C_FLAGS=-fPIC"
+           "-DCMAKE_CXX_FLAGS=-fPIC")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'copy-inputs
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                       (libyuv-from (assoc-ref inputs "libyuv"))
+                       (libvpx-to (string-append (getcwd)
+                                                 "/src/third_party/libvpx/source/libvpx"))
+                       (libyuv-to (string-append (getcwd)
+                                                 "/src/third_party/libyuv")))
+                  (copy-recursively libvpx-from libvpx-to)
+                  (copy-recursively libyuv-from libyuv-to))
+                #t)))))
+       (native-inputs
+        `(("pkg-config" ,pkg-config)
+          ("python" ,python-wrapper)
+          ("yasm" ,yasm)))
+       (inputs
+        `(("alsa" ,alsa-lib)
+          ("ffmpeg" ,ffmpeg)
+          ("libjpeg" ,libjpeg-turbo)
+          ("libvpx"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/webm/libvpx")
+                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+              (file-name
+               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+          ("libyuv"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/libyuv/libyuv")
+                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+              (file-name
+               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+          ("openssl" ,openssl)
+          ("opus" ,opus)
+          ("protobuf" ,protobuf)
+          ("pulseaudio" ,pulseaudio)))
+       (synopsis "WebRTC support for Telegram Desktop")
+       (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
+Telegram project, for its use in telegram desktop client.")
+       (home-page "https://github.com/desktop-app/tg_owt")
+       (license
+        (list
+         ;; Abseil-CPP
+         license:asl2.0
+         ;; LibYuv
+         (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+         ;; OpenH264
+         license:bsd-2
+         ;; PFFFT
+         (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+         ;; RnNoise
+         license:gpl3
+         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         license:bsd-3))))))
-- 
2.30.0


[-- Attachment #1.1.14: 0013-gnu-Add-rlottie-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 2634 bytes --]

From 67e422fea757dbe2d01bccd872333354af0057b6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:37:39 -0500
Subject: [PATCH 13/19] gnu: Add rlottie-for-telegram-desktop.

* gnu/packages/telegram.scm (rlottie-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index adcdd3a6b3..a087252400 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,7 +18,9 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
@@ -31,7 +33,8 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "be23804afce3bb2e80a1d57a7c1318c71b82b7de")
@@ -143,3 +146,37 @@ Telegram project, for its use in telegram desktop client.")
          license:gpl3
          ;; LibSRTP, LibVPx, UsrSCTP and Others
          license:bsd-3))))))
+
+(define-public rlottie-for-telegram-desktop
+  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
+        (revision "12"))
+    (hidden-package
+     (package
+       (inherit rlottie)
+       (version
+        (git-version "0.2" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/rlottie.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "rlottie-for-telegram-desktop" version))
+          (sha256
+           (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "-Dlog=true"
+           "-Ddumptree=true"
+           "-Dtest=true")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-cxx-flags
+              (lambda _
+                (substitute* "meson.build"
+                  (("werror=true")
+                   "werror=false"))
+                #t)))))))))
-- 
2.30.0


[-- Attachment #1.1.15: 0014-gnu-Add-libtgvoip-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 3237 bytes --]

From 894bc3c104ac8a46b210b1a42285b74807a80144 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:57:44 -0500
Subject: [PATCH 14/19] gnu: Add libtgvoip-for-telegram-desktop.

* gnu/packages/telegram.scm (libtgvoip-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index a087252400..027cc44067 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -20,6 +20,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
@@ -27,6 +28,7 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
@@ -34,6 +36,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
@@ -180,3 +183,47 @@ Telegram project, for its use in telegram desktop client.")
                   (("werror=true")
                    "werror=false"))
                 #t)))))))))
+
+(define-public libtgvoip-for-telegram-desktop
+  (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
+        (revision "88"))
+    (hidden-package
+     (package
+       (inherit libtgvoip)
+       (version
+        (git-version "2.4.4" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/telegramdesktop/libtgvoip.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "libtgvoip-for-telegram-desktop" version))
+          (sha256
+           (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "--disable-static"
+           "--disable-dsp"              ; FIXME
+           "--enable-audio-callback"
+           "--with-alsa"
+           "--with-pulse")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-linkers
+              (lambda _
+                (substitute* "Makefile.am"
+                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
+                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
+                (substitute* "tgvoip.pc.in"
+                  (("libcrypto opus")
+                   "libcrypto opus alsa libpulse"))
+                #t)))))
+       (native-inputs
+        `(("autoconf" ,autoconf)
+          ("automake" ,automake)
+          ("libtool" ,libtool)
+          ("pkg-config" ,pkg-config)))))))
-- 
2.30.0


[-- Attachment #1.1.16: 0015-gnu-kwayland-Disable-failing-tests.patch --]
[-- Type: text/x-patch, Size: 1188 bytes --]

From ff347294a44097f9b6a64ad41fedf89c3d0e87dd Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 30 Jan 2021 11:42:12 -0500
Subject: [PATCH 15/19] gnu: kwayland: Disable failing tests.

* gnu/packages/kde-frameworks.scm (kwayland) [arguments]<#:phases>
['disable-failing-tests]: New phase.
---
 gnu/packages/kde-frameworks.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 8c2028b978..cf5840f3f3 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -1049,6 +1049,12 @@ integration with a custom editor as well as a ready-to-use
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "autotests/client/CMakeLists.txt"
+               (("    add_test\\(NAME kwayland-testPlasmaWindowModel COMMAND testPlasmaWindowModel\\)")
+                ""))
+             #t))
          (add-before 'check 'check-setup
            (lambda _
              (setenv "XDG_RUNTIME_DIR" "/tmp")
-- 
2.30.0


[-- Attachment #1.1.17: 0016-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 15322 bytes --]

From 7de8b083754fc4580bb85fb698ecda8c609f6b38 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 19:21:23 -0500
Subject: [PATCH 16/19] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 332 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 331 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 027cc44067..1298056bcb 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,26 +18,47 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system meson))
+  #:use-module (guix build-system meson)
+  #:use-module (guix build-system qt))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "be23804afce3bb2e80a1d57a7c1318c71b82b7de")
@@ -227,3 +248,312 @@ Telegram project, for its use in telegram desktop client.")
           ("automake" ,automake)
           ("libtool" ,libtool)
           ("pkg-config" ,pkg-config)))))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.8")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1kdizvzvzip1x902b8hm2np55qgbdfbd7xwkapkc98h22b2v3qip"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils)
+        (ice-9 match))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (match-lambda
+                ((dst src)
+                 (copy-recursively src dst)
+                 (for-each make-file-writable (find-files dst))))
+              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                ("Telegram/lib_lottie"
+                 ,(assoc-ref inputs "lib-lottie-source"))
+                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                ("Telegram/lib_rlottie"
+                 ,(assoc-ref inputs "lib-rlottie-source"))
+                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                ("Telegram/lib_spellcheck"
+                 ,(assoc-ref inputs "lib-spellcheck-source"))
+                ("Telegram/lib_storage"
+                 ,(assoc-ref inputs "lib-storage-source"))
+                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                ("Telegram/ThirdParty/tgcalls"
+                 ,(assoc-ref inputs "tgcalls-source"))))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "561273a2f88306072750283b28d763959cd58652")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0cvv713ajqp5b4l8pbpcd391hlkc7vkm2frnbg6qsai8wj0mdjvc"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("kwayland" ,kwayland)
+       ("lib-base-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "2bf29ab1a5458003c8ed250886e08c61cce5ff72")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "1i92pj6wjgl78sv7l9f6xas0ar7313a4wx95p49hshpf5bc820ca"))))
+       ("lib-crl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "d94cb34219e5795efc0efe24d980c54e40eb42e3")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "1l3h4hxpmvx7m5x354h4mxz2nfk1hc95i86rnyj2r3lzwq2dqdpy"))))
+       ("lib-webrtc-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "af7269454c371b7e1045429d60cd728f7580ee4a")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "087005hjw5rw5s8q54x991xkbc1g4q5dgy6gxhhlfr47x4n8k1xx"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie-for-telegram-desktop)
+       ("tgcalls-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "bea2e218959244590fa57b62803bf2a7a5e15bc7")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "0y1k7i0vpzmv3sf32a8gk67ljjy7g6qb1p0lx1z1a9ig3gpv824i"))))
+       ("webrtc" ,webrtc-for-telegram-desktop)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #1.1.18: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v25)
       [not found]     ` <e5040a67-824f-17c8-e16f-1a68531b3d5f@raghavgururajan.name>
@ 2021-01-30 18:24       ` Leo Prikler
  2021-01-30 19:30         ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-30 18:24 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: 45721

Am Samstag, den 30.01.2021, 12:46 -0500 schrieb Raghav Gururajan:
> Hi Leo!
> 
> > > +  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
> > > +        (revision "12"))
> > > +    (hidden-package
> > > +     (package
> > > +       (inherit rlottie)
> > > +       (version
> > > +        (git-version "0.2" revision commit))
> > According to Github, Telegram's rlottie is 19 commits ahead and 193
> > commits behind Samsung's rlottie, whereas Samsung has had 34
> > commits to
> > master since the release of 0.2.  In other words, this should still
> > be
> > 0.1, and I'm not too sure about revision 12.
> 
> The desktop-app/rlottie forked samsung/rlottie at a commit
> corresponding 
> to v0.2. After forking, desktop-app/rlottie made 19 commits. The
> 12th 
> commit is what the package is what this package is building from.
> Hence 
> the revision number 12.
That timeline makes little sense.  The v0.2 release was on August 19th
2020, but the two libraries diverge on August 7th -- again according to
Github.  The files also indicate 0.1.

> > > +    (name "telegram-desktop")
> > > +    (version "2.5.8")
> > Any news w.r.t. tdesktop#10182 in this build?
> 
> Nope! :-(
> 
> But build fails w.r.t updated version of tg_owt. I'll have to send
> v26.
I don't think building static libraries is very guixy.  If 2.5.8 is no
significant improvement over 2.5.1 in that regard, let's stay with the
latter while we can still build shared libraries.

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
                   ` (22 preceding siblings ...)
  2021-01-30 18:02 ` [bug#45721] Telegram Desktop (v26) Raghav Gururajan
@ 2021-01-30 19:02 ` Raghav Gururajan
  2021-01-31  8:37   ` bug#45721: " Leo Prikler
  2021-01-31 13:57   ` Jonathan Brielmaier
  23 siblings, 2 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-30 19:02 UTC (permalink / raw)
  To: 45721; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-c-gsl.patch --]
[-- Type: text/x-patch, Size: 6076 bytes --]

From d2c058a8ef2d34f6a9c0e63a4eb565d6abcfb9d3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 18:48:03 -0500
Subject: [PATCH 01/18] gnu: Add c++-gsl.

* gnu/packages/cpp.scm (c++-gsl): New variable.
* gnu/packages/patches/c++-gsl-find-system-gtest.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/cpp.scm                          | 29 ++++++
 .../patches/c++-gsl-find-system-gtest.patch   | 96 +++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cc9b47b493..af848e9124 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -915,6 +915,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cursynth-wave-rand.patch			\
   %D%/packages/patches/cvs-CVE-2017-12836.patch		\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch		\
+  %D%/packages/patches/c++-gsl-find-system-gtest.patch		\
   %D%/packages/patches/date-output-pkg-config-files.patch	\
   %D%/packages/patches/datefudge-gettimeofday.patch		\
   %D%/packages/patches/dbacl-include-locale.h.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 73a3ceb2df..d19712275c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,35 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
new file mode 100644
index 0000000000..2def650292
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch
@@ -0,0 +1,96 @@
+From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns@ya.ru>
+Date: Sat, 18 Apr 2020 13:30:17 +0300
+Subject: [PATCH] Search for GoogleTest via pkg-config first
+
+---
+ tests/CMakeLists.txt | 55 ++++++++++++++++++++++++--------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 02193197..53d475c2 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,36 +1,41 @@
+ cmake_minimum_required(VERSION 3.0.2)
+ 
+ project(GSLTests CXX)
++include(FindPkgConfig)
+ 
+ # will make visual studio generated project group files
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ 
+-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++pkg_search_module(GTestMain gtest_main)
++if (NOT GTestMain_FOUND)
++    configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-execute_process(
+-    COMMAND ${CMAKE_COMMAND} --build .
+-    RESULT_VARIABLE result
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
+-)
+-if(result)
+-    message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+-endif()
++    execute_process(
++        COMMAND ${CMAKE_COMMAND} --build .
++        RESULT_VARIABLE result
++        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download
++    )
++    if(result)
++        message(FATAL_ERROR "CMake step for googletest failed: ${result}")
++    endif()
+ 
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
++    set(GTestMain_LIBRARIES gtest_main)
+ 
+-add_subdirectory(
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
+-    ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
+-    EXCLUDE_FROM_ALL
+-)
++    add_subdirectory(
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
++        ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
++        EXCLUDE_FROM_ALL
++    )
++endif()
+ 
+ if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
+     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
+@@ -149,7 +154,7 @@ function(add_gsl_test name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+         ${name}
+@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name)
+     target_link_libraries(${name}
+         GSL
+         gsl_tests_config_noexcept
+-        gtest_main
++        ${GTestMain_LIBRARIES}
+     )
+     add_test(
+       ${name}
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-fcitx-qt5.patch --]
[-- Type: text/x-patch, Size: 3621 bytes --]

From ae7b4f2e2e74b0c82ea2edc5d82d5e9015bad3e7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 22:23:51 -0500
Subject: [PATCH 02/18] gnu: Add fcitx-qt5.

* gnu/packages/fcitx.scm (fcitx-qt5): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/fcitx.scm | 61 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index d52edf1750..93cea7a24d 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -19,11 +19,13 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages fcitx)
-  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages enchant)
@@ -33,14 +35,69 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages man)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
+
+(define-public fcitx-qt5
+  (package
+    (name "fcitx-qt5")
+    (version "1.2.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fcitx/fcitx-qt5.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-install-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "quickphrase-editor/CMakeLists.txt"
+               (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/fcitx")))
+             (substitute* "platforminputcontext/CMakeLists.txt"
+               (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
+                (string-append
+                 (assoc-ref outputs "out")
+                 "/lib/qt5/plugins")))
+             #t)))))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fcitx" ,fcitx)
+       ("libintl" ,intltool)
+       ("libxkbcommon" ,libxkbcommon)))
+    (propagated-inputs
+     `(("qtbase" ,qtbase)))
+    (synopsis "Fcitx Qt5 Input Context")
+    (description "This package provides a Qt5 frontend for fcitx.")
+    (home-page "https://github.com/fcitx/fcitx-qt5/")
+    (license
+     (list
+      ;; Plugin
+      bsd-3
+      ;; Others
+      gpl2+))))
 
 (define-public presage
   (package
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-libappindicator-Propagate-some-inputs-as-per-.pc.patch --]
[-- Type: text/x-patch, Size: 1391 bytes --]

From 324c9fd7bf76bfc2f2c37feb6504f8ed88720a94 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 2 Jan 2021 23:51:51 -0500
Subject: [PATCH 03/18] gnu: libappindicator: Propagate some inputs as per .pc
 file.

* gnu/packages/freedesktop.scm (libappindicator) [inputs]: Move gtk+
and libdbusmenu to ...
[propagated-inputs]: ... here.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/freedesktop.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ef35349ec2..6dd37005ae 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2021,14 +2021,15 @@ useful with system integration.")
        ("xvfb" ,xorg-server-for-tests)))
     (inputs
      `(("dbus-glib" ,dbus-glib)
-       ("gtk+" ,gtk+)
-       ("libdbusmenu" ,libdbusmenu)
        ("libindicator" ,libindicator)
        ("python@2" ,python-2)
        ("python2-pygtk" ,python2-pygtk)
        ("python2-pygobject-2" ,python2-pygobject-2)
        ;; ("mono" ,mono) ; requires non-packaged gapi
        ("vala" ,vala)))
+    (propagated-inputs
+     `(("gtk+" ,gtk+)
+       ("libdbusmenu" ,libdbusmenu)))
     (arguments
      ;; FIXME: do not hardcode gtk version
      `(#:configure-flags '("--with-gtk=3")
-- 
2.30.0


[-- Attachment #1.1.5: 0004-gnu-Add-libchewing.patch --]
[-- Type: text/x-patch, Size: 3208 bytes --]

From 400743163a4875972ac76a3677ce0804e18ad80e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 00:53:40 -0500
Subject: [PATCH 04/18] gnu: Add libchewing.

* gnu/packages/language.scm (libchewing): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 61 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 3f17465039..621bc7f6e5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -31,12 +31,14 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
@@ -53,6 +55,65 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public libchewing
+  (package
+    (name "libchewing")
+    (version "0.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/chewing/libchewing.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (substitute* "test/Makefile.am"
+               (("	test-bopomofo ")
+                "")
+               (("	test-config ")
+                "")
+               (("	test-reset ")
+                "")
+               (("	test-symbol ")
+                "")
+               (("	test-keyboardless ")
+                "")
+               (("	test-special-symbol ")
+                "")
+               (("	test-keyboard ")
+                "")
+               (("	test-regression ")
+                "")
+               (("	test-userphrase ")
+                ""))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sqlite" ,sqlite)))
+    (synopsis "Chinese phonetic input method")
+    (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
+method, one of the most popular choices for Traditional Chinese users.")
+    (home-page "http://chewing.im/")
+    (license lgpl2.1+)))
+
 (define-public liblouis
   (package
     (name "liblouis")
-- 
2.30.0


[-- Attachment #1.1.6: 0005-gnu-Add-hime.patch --]
[-- Type: text/x-patch, Size: 4395 bytes --]

From 29bb86748beec07d5f7a3c2c95b1d3282467a74c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:02:08 -0500
Subject: [PATCH 05/18] gnu: Add hime.

* gnu/packages/language.scm (hime): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 78 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 621bc7f6e5..221848f2b5 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -23,8 +23,11 @@
 
 (define-module (gnu packages language)
   #:use-module (gnu packages)
+  #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages java)
@@ -38,6 +41,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
@@ -45,16 +49,88 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module ((guix licenses)
                 #:select
-                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
+                (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1 fdl1.2+))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public hime
+  (package
+    (name "hime")
+    (version "0.9.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hime-ime/hime.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        ;; FIXME
+        ;; error: unknown type name ‘GtkStatusIcon’
+        "--disable-system-tray")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-std
+           (lambda _
+             (substitute* "configure"
+               (("gnu17")
+                "gnu11")
+               (("gnu++17")
+                "gnu++11"))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ("whereis" ,util-linux)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("chewing" ,libchewing)
+       ("gtk+" ,gtk+)
+       ("qtbase" ,qtbase)
+       ("xtst" ,libxtst)))
+    (synopsis "HIME Input Method Editor")
+    (description "Hime is an extremely easy-to-use input method framework.  It
+is lightweight, stable, powerful and supports many commonly used input methods,
+including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
+Random Cage Fighting Birds, Cool Music etc.")
+    (home-page "http://hime-ime.github.io/")
+    (license
+     (list
+      gpl2+
+      lgpl2.1+
+      ;; Documentation
+      fdl1.2+))))
+
 (define-public libchewing
   (package
     (name "libchewing")
-- 
2.30.0


[-- Attachment #1.1.7: 0006-gnu-Add-nimf.patch --]
[-- Type: text/x-patch, Size: 7066 bytes --]

From 6a9b4a898bfef197c6286e5c78e2838d52c0614f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 14 Jan 2021 01:07:16 -0500
Subject: [PATCH 06/18] gnu: Add nimf.

* gnu/packages/language.scm (nimf): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/language.scm | 138 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 221848f2b5..67b519aa56 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -26,10 +26,15 @@
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -47,6 +52,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
   #:use-module (guix build-system cmake)
@@ -62,6 +68,138 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public nimf
+  (package
+    (name "nimf")
+    (version "1.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hamonikr/nimf.git")
+         (commit
+          (string-append "nimf-" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:imported-modules
+       (,@%glib-or-gtk-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build glib-or-gtk-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:configure-flags
+       (list
+        "--with-im-config-data"
+        "--with-imsettings-data"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("-Werror")
+                "-Wno-error"))
+             #t))
+         (add-after 'patch-flags 'patch-docbook-xml
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "docs"
+               (substitute* "nimf-docs.xml"
+                 (("http://www.oasis-open.org/docbook/xml/4.3/")
+                  (string-append (assoc-ref inputs "docbook-xml-4.3")
+                                 "/xml/dtd/docbook/"))))
+             #t))
+         (add-after 'patch-docbook-xml 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("/usr/share/anthy/anthy.dic")
+                (string-append (assoc-ref inputs "anthy")
+                               "/share/anthy/anthy.dic")))
+             (substitute* "configure.ac"
+               (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
+                (string-append (assoc-ref inputs "gtk+:bin")
+                               "/bin:$GTK3_LIBDIR/libgtk-3-0"))
+               (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
+                (string-append (assoc-ref inputs "gtk+-2:bin")
+                               "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
+             (substitute* "modules/clients/gtk/Makefile.am"
+               (("\\$\\(GTK3_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib"))
+               (("\\$\\(GTK2_LIBDIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt4/Makefile.am"
+               (("\\$\\(QT4_LIB_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib")))
+             (substitute* "modules/clients/qt5/Makefile.am"
+               (("\\$\\(QT5_IM_MODULE_DIR\\)")
+                (string-append (assoc-ref outputs "out")
+                               "/lib/qt5/plugins/inputmethods")))
+             (substitute* '("bin/nimf-settings/Makefile.am"
+                            "data/apparmor-abstractions/Makefile.am"
+                            "data/Makefile.am" "data/im-config/Makefile.am"
+                            "data/imsettings/Makefile.am")
+               (("/etc")
+                (string-append (assoc-ref outputs "out")
+                               "/etc"))
+               (("/usr/share")
+                (string-append (assoc-ref outputs "out")
+                               "/share")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("docbook-xml-4.3" ,docbook-xml-4.3)
+       ("gettext" ,gettext-minimal)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2:bin" ,gtk+-2 "bin")
+       ("gtk+:bin" ,gtk+ "bin")
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("anthy" ,anthy)
+       ("appindicator" ,libappindicator)
+       ("gtk+-2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("hangul" ,libhangul)
+       ("m17n-db" ,m17n-db)
+       ("m17n-lib" ,m17n-lib)
+       ("qt-4" ,qt-4)
+       ("qtbase" ,qtbase)
+       ("rime" ,librime)
+       ("rsvg" ,librsvg)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)
+       ("x11" ,libx11)
+       ("xkbcommon" ,libxkbcommon)
+       ("xklavier" ,libxklavier)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "Lightweight input method framework")
+    (description "Nimf is a lightweight, fast and extensible input method
+framework.  This package provides a fork of the original nimf project, that
+focusses especially on Korean input (Hangul, Hanja, ...).")
+    (home-page "https://github.com/hamonikr/nimf/")
+    (license lgpl3+)))
+
 (define-public hime
   (package
     (name "hime")
-- 
2.30.0


[-- Attachment #1.1.8: 0007-gnu-Add-cmake-shared.patch --]
[-- Type: text/x-patch, Size: 2333 bytes --]

From b2c98842c46da8e64990e6ad31e6df26b03adaac Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:03:00 -0500
Subject: [PATCH 07/18] gnu: Add cmake-shared.

* gnu/packages/cmake.scm (cmake-shared): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cmake.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 56b32792fe..ab74650066 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
   #:use-module (guix build-system gnu)
@@ -43,6 +44,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages serialization)
@@ -52,6 +54,33 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public cmake-shared
+  (package
+    (name "cmake-shared")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/cmake-shared.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1srd3jmlalf0szgyp88ymhbnwds4qiywmf8lq1pif9g8irjjhdry"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))                    ; No target
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (synopsis "Shared CMake functions and macros")
+    (description "CMake-Shared are shared functions and macros for projects
+using the CMake build system.")
+    (home-page "https://github.com/lirios/cmake-shared/")
+    (license license:bsd-3)))
+
 ;;; Build phases shared between 'cmake-bootstrap' and the later variants
 ;;; that use cmake-build-system.
 (define %common-build-phases
-- 
2.30.0


[-- Attachment #1.1.9: 0008-gnu-Add-materialdecoration.patch --]
[-- Type: text/x-patch, Size: 2376 bytes --]

From e9233525cfc7c0699c54194a88c6db1d3bd8fd9f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 3 Jan 2021 19:08:43 -0500
Subject: [PATCH 08/18] gnu: Add materialdecoration.

* gnu/packages/qt.scm (materialdecoration): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 96a28ceb29..d1822e9707 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -45,6 +45,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix packages)
   #:use-module (guix deprecation)
   #:use-module (guix utils)
@@ -72,6 +73,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -103,6 +105,36 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public materialdecoration
+  (package
+    (name "materialdecoration")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/lirios/materialdecoration.git")
+         (commit "2079487116c6c794af3a15452342a69293039b46")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "1pczmxbmnsgj9s1g6ap55qq2q4ccibcnhsw9b6cl5rzgc48izy06"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtwayland" ,qtwayland)
+       ("wayland" ,wayland)))
+    (synopsis "Material Decoration for Qt")
+    (description "MaterialDecoration is a client-side decoration for Qt
+applications on Wayland.")
+    (home-page "https://github.com/lirios/materialdecoration")
+    (license license:lgpl3+)))
+
 (define-public grantlee
   (package
     (name "grantlee")
-- 
2.30.0


[-- Attachment #1.1.10: 0009-gnu-Add-range-v3.patch --]
[-- Type: text/x-patch, Size: 2347 bytes --]

From e16d011e04e7e523a80c4205f7c820b7afb4f7b2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 4 Jan 2021 23:59:17 -0500
Subject: [PATCH 09/18] gnu: Add range-v3.

* gnu/packages/cpp.scm (range-v3): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index d19712275c..ae47490755 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
@@ -63,6 +64,45 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstration layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
 (define-public c++-gsl
   (package
     (name "c++-gsl")
-- 
2.30.0


[-- Attachment #1.1.11: 0010-gnu-Add-rlottie.patch --]
[-- Type: text/x-patch, Size: 2288 bytes --]

From a67abbc44f5660235b08e0506dfd1e5e9a0adb45 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 14:45:54 -0500
Subject: [PATCH 10/18] gnu: Add rlottie.

* gnu/packages/animation.scm (rlottie): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/animation.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/animation.scm b/gnu/packages/animation.scm
index 6bfe8f0a12..c92c4ae7e7 100644
--- a/gnu/packages/animation.scm
+++ b/gnu/packages/animation.scm
@@ -26,10 +26,12 @@
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages dejagnu)
@@ -53,6 +55,37 @@
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph))
 
+(define-public rlottie
+  (package
+    (name "rlottie")
+    (version "0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/Samsung/rlottie.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        "-Dlog=true"
+        "-Dtest=true")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Lottie Animation Library")
+    (description "Rlottie is a platform independent standalone c++ library for
+rendering vector based animations and art in realtime.")
+    (home-page "https://github.com/Samsung/rlottie/")
+    (license license:expat)))
+
 ;; ETL, synfig, and Synfig Studio are updated in tandem.
 (define synfig-version "1.2.2")
 
-- 
2.30.0


[-- Attachment #1.1.12: 0011-gnu-Add-qt5ct.patch --]
[-- Type: text/x-patch, Size: 2907 bytes --]

From 40871c75bc0f5db550298403838ead4f298101eb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Tue, 5 Jan 2021 17:50:16 -0500
Subject: [PATCH 11/18] gnu: Add qt5ct.

* gnu/packages/qt.scm (qt5ct): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
---
 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d1822e9707..cef9c6802f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -105,6 +105,61 @@
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qt5ct
+  (package
+    (name "qt5ct")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
+       (sha256
+        (base32 "1lnx4wqk87lbr6lqc64w5g5ppjjv75kq2r0q0bz9gfpryzdw8xxg"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%gnu-build-system-modules
+        (guix build cmake-build-system)
+        (guix build qt-build-system))
+       #:modules
+       ((guix build gnu-build-system)
+        ((guix build qt-build-system)
+         #:prefix qt:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "qt5ct.pro"
+               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                (string-append (assoc-ref inputs "qttools")
+                               "/bin/lrelease")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (invoke "qmake"
+                       (string-append "PREFIX=" out)
+                       (string-append "BINDIR=" out "/bin")
+                       (string-append "DATADIR=" out "/share")
+                       (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))
+             #t))
+         (add-after 'install 'qt-wrap
+           (assoc-ref qt:%standard-phases 'qt-wrap)))))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)))
+    (synopsis "Qt5 Configuration Tool")
+    (description "Qt5CT is a program that allows users to configure Qt5
+settings (such as icons, themes, and fonts) in desktop environments or
+window managers, that don't provide Qt integration by themselves.")
+    (home-page "https://qt5ct.sourceforge.io/")
+    (license license:bsd-2)))
+
 (define-public materialdecoration
   (package
     (name "materialdecoration")
-- 
2.30.0


[-- Attachment #1.1.13: 0012-gnu-Add-webrtc-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 7269 bytes --]

From 49373cecda7122678a86f85734af365a6b522490 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 7 Jan 2021 19:41:42 -0500
Subject: [PATCH 12/18] gnu: Add webrtc-for-telegram-desktop.

* gnu/packages/telegram.scm: New module.
(webrtc-for-telegram-desktop): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |   1 +
 gnu/packages/telegram.scm | 144 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 145 insertions(+)
 create mode 100644 gnu/packages/telegram.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index af848e9124..25d83c3a92 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -535,6 +535,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/task-management.scm		\
   %D%/packages/tbb.scm				\
   %D%/packages/tcl.scm				\
+  %D%/packages/telegram.scm                 \
   %D%/packages/telephony.scm			\
   %D%/packages/terminals.scm			\
   %D%/packages/terraform.scm			\
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
new file mode 100644
index 0000000000..8efa8f2a0a
--- /dev/null
+++ b/gnu/packages/telegram.scm
@@ -0,0 +1,144 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages telegram)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages xiph)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake))
+
+(define-public webrtc-for-telegram-desktop
+  (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
+        (revision "52"))
+    (hidden-package
+     (package
+       (name "webrtc-for-telegram-desktop")
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/tg_owt.git")
+            (commit commit)))
+          (file-name
+           (git-file-name name version))
+          (sha256
+           (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l"))
+          (modules '((guix build utils)
+                     (ice-9 ftw)
+                     (srfi srfi-1)))
+          (snippet
+           `(begin
+              (let ((keep
+                     '( ;; Custom forks which are incompatible with the ones in Guix.
+                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                       ;; Not available in Guix.
+                       "pffft" "usrsctp"
+                       ;; Has cmake support files for libvpx input.
+                       "libvpx")))
+                (with-directory-excursion "src/third_party"
+                  (for-each delete-file-recursively
+                            (lset-difference string=?
+                                             (scandir ".")
+                                             (cons* "." ".." keep))))
+                #t)))))
+       (build-system cmake-build-system)
+       (arguments
+        `(#:tests? #f                   ; No target
+          #:configure-flags
+          (list
+           "-DCMAKE_C_FLAGS=-fPIC"
+           "-DCMAKE_CXX_FLAGS=-fPIC")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'copy-inputs
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
+                       (libyuv-from (assoc-ref inputs "libyuv"))
+                       (libvpx-to (string-append (getcwd)
+                                                 "/src/third_party/libvpx/source/libvpx"))
+                       (libyuv-to (string-append (getcwd)
+                                                 "/src/third_party/libyuv")))
+                  (copy-recursively libvpx-from libvpx-to)
+                  (copy-recursively libyuv-from libyuv-to))
+                #t)))))
+       (native-inputs
+        `(("pkg-config" ,pkg-config)
+          ("python" ,python-wrapper)
+          ("yasm" ,yasm)))
+       (inputs
+        `(("alsa" ,alsa-lib)
+          ("ffmpeg" ,ffmpeg)
+          ("libjpeg" ,libjpeg-turbo)
+          ("libvpx"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/webm/libvpx")
+                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+              (file-name
+               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+          ("libyuv"
+           ,(origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://chromium.googlesource.com/libyuv/libyuv")
+                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+              (file-name
+               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
+              (sha256
+               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+          ("openssl" ,openssl)
+          ("opus" ,opus)
+          ("protobuf" ,protobuf)
+          ("pulseaudio" ,pulseaudio)))
+       (synopsis "WebRTC support for Telegram Desktop")
+       (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
+Telegram project, for its use in telegram desktop client.")
+       (home-page "https://github.com/desktop-app/tg_owt")
+       (license
+        (list
+         ;; Abseil-CPP
+         license:asl2.0
+         ;; LibYuv
+         (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
+         ;; OpenH264
+         license:bsd-2
+         ;; PFFFT
+         (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
+         ;; RnNoise
+         license:gpl3
+         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         license:bsd-3))))))
-- 
2.30.0


[-- Attachment #1.1.14: 0013-gnu-Add-rlottie-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 2633 bytes --]

From 94af32ab5f51cff6987d0838f2324acab1d3e343 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:37:39 -0500
Subject: [PATCH 13/18] gnu: Add rlottie-for-telegram-desktop.

* gnu/packages/telegram.scm (rlottie-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 8efa8f2a0a..461681dcfa 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,7 +18,9 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
@@ -31,7 +33,8 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -142,3 +145,37 @@ Telegram project, for its use in telegram desktop client.")
          license:gpl3
          ;; LibSRTP, LibVPx, UsrSCTP and Others
          license:bsd-3))))))
+
+(define-public rlottie-for-telegram-desktop
+  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
+        (revision "671"))
+    (hidden-package
+     (package
+       (inherit rlottie)
+       (version
+        (git-version "0" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/desktop-app/rlottie.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "rlottie-for-telegram-desktop" version))
+          (sha256
+           (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "-Dlog=true"
+           "-Ddumptree=true"
+           "-Dtest=true")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-cxx-flags
+              (lambda _
+                (substitute* "meson.build"
+                  (("werror=true")
+                   "werror=false"))
+                #t)))))))))
-- 
2.30.0


[-- Attachment #1.1.15: 0014-gnu-Add-libtgvoip-for-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 3237 bytes --]

From ca9dea43a7d66b3176bbd0609b81d034f814ccec Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 18:57:44 -0500
Subject: [PATCH 14/18] gnu: Add libtgvoip-for-telegram-desktop.

* gnu/packages/telegram.scm (libtgvoip-for-telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 461681dcfa..86b0abfbfb 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -20,6 +20,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
@@ -27,6 +28,7 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
@@ -34,6 +36,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson))
 
 (define-public webrtc-for-telegram-desktop
@@ -179,3 +182,47 @@ Telegram project, for its use in telegram desktop client.")
                   (("werror=true")
                    "werror=false"))
                 #t)))))))))
+
+(define-public libtgvoip-for-telegram-desktop
+  (let ((commit "37d98e984fd6fa389262307db826d52ab86c8241")
+        (revision "87"))
+    (hidden-package
+     (package
+       (inherit libtgvoip)
+       (version
+        (git-version "2.4.4" revision commit))
+       (source
+        (origin
+          (method git-fetch)
+          (uri
+           (git-reference
+            (url "https://github.com/telegramdesktop/libtgvoip.git")
+            (commit commit)))
+          (file-name
+           (git-file-name "libtgvoip-for-telegram-desktop" version))
+          (sha256
+           (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h"))))
+       (arguments
+        `(#:configure-flags
+          (list
+           "--disable-static"
+           "--disable-dsp"              ; FIXME
+           "--enable-audio-callback"
+           "--with-alsa"
+           "--with-pulse")
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-linkers
+              (lambda _
+                (substitute* "Makefile.am"
+                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
+                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
+                (substitute* "tgvoip.pc.in"
+                  (("libcrypto opus")
+                   "libcrypto opus alsa libpulse"))
+                #t)))))
+       (native-inputs
+        `(("autoconf" ,autoconf)
+          ("automake" ,automake)
+          ("libtool" ,libtool)
+          ("pkg-config" ,pkg-config)))))))
-- 
2.30.0


[-- Attachment #1.1.16: 0015-gnu-Add-telegram-desktop.patch --]
[-- Type: text/x-patch, Size: 15290 bytes --]

From c11fe92956c894a05bdb788bebd237e757e32fb6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 19:21:23 -0500
Subject: [PATCH 15/18] gnu: Add telegram-desktop.

* gnu/packages/telegram.scm (telegram-desktop): New variable.
---
 gnu/packages/telegram.scm | 331 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 330 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 86b0abfbfb..178b196114 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -18,26 +18,47 @@
 
 (define-module (gnu packages telegram)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
   #:use-module (gnu packages animation)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages digest)
+  #:use-module (gnu packages fcitx)
+  #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lxqt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system meson))
+  #:use-module (guix build-system meson)
+  #:use-module (guix build-system qt))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9")
@@ -226,3 +247,311 @@ Telegram project, for its use in telegram desktop client.")
           ("automake" ,automake)
           ("libtool" ,libtool)
           ("pkg-config" ,pkg-config)))))))
+
+(define-public telegram-desktop
+  (package
+    (name "telegram-desktop")
+    (version "2.5.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/telegramdesktop/tdesktop.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (let ((keep
+                  '( ;; Not available in Guix.
+                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+             (with-directory-excursion "Telegram/ThirdParty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep))))
+             #t)))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:imported-modules
+       (,@%qt-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build qt-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils)
+        (ice-9 match))
+       #:configure-flags
+       (list
+        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+        ;; In case, that the credentials below fail to work, contact
+        ;;   Raghav Gururajan <rg@raghavgururajan.name>
+        "-DTDESKTOP_API_ID=2791056"
+        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        ;; Use bundled fonts as fallback.
+        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'make-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (add-after 'make-writable 'copy-inputs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (match-lambda
+                ((dst src)
+                 (copy-recursively src dst)
+                 (for-each make-file-writable (find-files dst))))
+              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                ("Telegram/lib_lottie"
+                 ,(assoc-ref inputs "lib-lottie-source"))
+                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                ("Telegram/lib_rlottie"
+                 ,(assoc-ref inputs "lib-rlottie-source"))
+                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                ("Telegram/lib_spellcheck"
+                 ,(assoc-ref inputs "lib-spellcheck-source"))
+                ("Telegram/lib_storage"
+                 ,(assoc-ref inputs "lib-storage-source"))
+                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                ("Telegram/ThirdParty/tgcalls"
+                 ,(assoc-ref inputs "tgcalls-source"))))
+             #t))
+         (add-before 'configure 'patch-cxx-flags
+           (lambda _
+             (substitute* "cmake/options_linux.cmake"
+               (("class-memaccess") "all"))
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+    (native-inputs
+     `(("cmake-helpers"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/cmake_helpers.git")
+             (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b")))
+           (file-name
+            (git-file-name "cmake-helpers-for-telegram-desktop" version))
+           (sha256
+            (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248"))))
+       ("cmake-shared" ,cmake-shared)
+       ("extra-cmake-modules" ,extra-cmake-modules)
+       ("gcc" ,gcc-9)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("alsa" ,alsa-lib)
+       ("c++-gsl" ,c++-gsl)
+       ("catch" ,catch-framework2)
+       ("codegen-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/codegen.git")
+             (commit "127968de8129e8ccfa6ac50721c70415a5a087c3")))
+           (file-name
+            (git-file-name "codegen" version))
+           (sha256
+            (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2"))))
+       ("expected" ,libexpected)
+       ("fcitx-qt5" ,fcitx-qt5)
+       ("fcitx5-qt" ,fcitx5-qt)
+       ("ffmpeg" ,ffmpeg)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("hime" ,hime)
+       ("hunspell" ,hunspell)
+       ("iconv" ,libiconv)
+       ("lib-base-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_base.git")
+             (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad")))
+           (file-name
+            (git-file-name "lib-base-for-telegram-desktop" version))
+           (sha256
+            (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217"))))
+       ("lib-crl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_crl.git")
+             (commit "16150bf71d79382738114b913f137ec1a1a7630c")))
+           (file-name
+            (git-file-name "lib-crl-for-telegram-desktop" version))
+           (sha256
+            (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q"))))
+       ("lib-lottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_lottie.git")
+             (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae")))
+           (file-name
+            (git-file-name "lib-lottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw"))))
+       ("lib-qr-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_qr.git")
+             (commit "92ce41a690a463eb462089a4eb1e51e019308018")))
+           (file-name
+            (git-file-name "lib-qr-for-telegram-desktop" version))
+           (sha256
+            (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj"))))
+       ("lib-rlottie-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rlottie.git")
+             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+           (file-name
+            (git-file-name "lib-rlottie-for-telegram-desktop" version))
+           (sha256
+            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+       ("lib-rpl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_rpl.git")
+             (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f")))
+           (file-name
+            (git-file-name "lib-rpl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss"))))
+       ("lib-spellcheck-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_spellcheck.git")
+             (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277")))
+           (file-name
+            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+           (sha256
+            (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7"))))
+       ("lib-storage-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_storage.git")
+             (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936")))
+           (file-name
+            (git-file-name "lib-storage-for-telegram-desktop" version))
+           (sha256
+            (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87"))))
+       ("lib-tl-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_tl.git")
+             (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e")))
+           (file-name
+            (git-file-name "lib-tl-for-telegram-desktop" version))
+           (sha256
+            (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f"))))
+       ("lib-ui-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_ui.git")
+             (commit "1e2799245cf2720a329ecb5cf5644fded669cce6")))
+           (file-name
+            (git-file-name "lib-ui-for-telegram-desktop" version))
+           (sha256
+            (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw"))))
+       ("lib-webrtc-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/desktop-app/lib_webrtc.git")
+             (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e")))
+           (file-name
+            (git-file-name "lib-webrtc-for-telegram-desktop" version))
+           (sha256
+            (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal"))))
+       ("libdbusmenu-qt" ,libdbusmenu-qt)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
+       ("lz4" ,lz4)
+       ("materialdecoration" ,materialdecoration)
+       ("minizip" ,minizip)
+       ("nimf" ,nimf)
+       ("openal" ,openal)
+       ("openssl" ,openssl)
+       ("opus" ,opus)
+       ("pulseaudio" ,pulseaudio)
+       ("qrcodegen" ,qrcodegen-cpp)
+       ("qt" ,qtbase)
+       ("qt5ct" ,qt5ct)
+       ("qtimageformats" ,qtimageformats)
+       ("qtwayland" ,qtwayland)
+       ("range-v3" ,range-v3)
+       ("rlottie" ,rlottie-for-telegram-desktop)
+       ("tgcalls-source"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/TelegramMessenger/tgcalls.git")
+             (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d")))
+           (file-name
+            (git-file-name "tgcalls-for-telegram-desktop" version))
+           (sha256
+            (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0"))))
+       ("webrtc" ,webrtc-for-telegram-desktop)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-keysyms" ,xcb-util-keysyms)
+       ("xxhash" ,xxhash)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "Telegram Desktop")
+    (description "Telegram desktop is the official desktop version of the
+Telegram instant messager.")
+    (home-page "https://desktop.telegram.org/")
+    (license
+     (list
+      ;; ThirdParty
+      license:lgpl2.1+
+      ;; Others
+      license:gpl3+))))
-- 
2.30.0


[-- Attachment #1.1.17: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v25)
  2021-01-30 18:24       ` Leo Prikler
@ 2021-01-30 19:30         ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-30 19:30 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 45721


[-- Attachment #1.1.1: Type: text/plain, Size: 1481 bytes --]

Hi Leo!

>>>> +  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
>>>> +        (revision "12"))
>>>> +    (hidden-package
>>>> +     (package
>>>> +       (inherit rlottie)
>>>> +       (version
>>>> +        (git-version "0.2" revision commit))
>>> According to Github, Telegram's rlottie is 19 commits ahead and 193
>>> commits behind Samsung's rlottie, whereas Samsung has had 34
>>> commits to
>>> master since the release of 0.2.  In other words, this should still
>>> be
>>> 0.1, and I'm not too sure about revision 12.
>>
>> The desktop-app/rlottie forked samsung/rlottie at a commit
>> corresponding
>> to v0.2. After forking, desktop-app/rlottie made 19 commits. The
>> 12th
>> commit is what the package is what this package is building from.
>> Hence
>> the revision number 12.
> That timeline makes little sense.  The v0.2 release was on August 19th
> 2020, but the two libraries diverge on August 7th -- again according to
> Github.  The files also indicate 0.1.
> 
>>>> +    (name "telegram-desktop")
>>>> +    (version "2.5.8")
>>> Any news w.r.t. tdesktop#10182 in this build?
>>
>> Nope! :-(
>>
>> But build fails w.r.t updated version of tg_owt. I'll have to send
>> v26.
> I don't think building static libraries is very guixy.  If 2.5.8 is no
> significant improvement over 2.5.1 in that regard, let's stay with the
> latter while we can still build shared libraries.

Agreed. I have sent v27.

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 55+ messages in thread

* bug#45721: Telegram Desktop (v27)
  2021-01-30 19:02 ` [bug#45721] Telegram Desktop (v27) Raghav Gururajan
@ 2021-01-31  8:37   ` Leo Prikler
  2021-01-31 19:11     ` [bug#45721] " Raghav Gururajan
  2021-01-31 13:57   ` Jonathan Brielmaier
  1 sibling, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-31  8:37 UTC (permalink / raw)
  To: Raghav Gururajan, 45721-done

Pushed with a small change – instead of using 0 for the rlottie base
version, it's 0.0.1 in line with upstream.

Thanks for your hard work!





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-30 19:02 ` [bug#45721] Telegram Desktop (v27) Raghav Gururajan
  2021-01-31  8:37   ` bug#45721: " Leo Prikler
@ 2021-01-31 13:57   ` Jonathan Brielmaier
  2021-01-31 14:10     ` Leo Prikler
  1 sibling, 1 reply; 55+ messages in thread
From: Jonathan Brielmaier @ 2021-01-31 13:57 UTC (permalink / raw)
  To: Raghav Gururajan, 45721; +Cc: Leo Prikler

Hi Raghav,

thanks for your hard work on Telegram! I always avoided it as I know
from openSUSE packaging that it's quite a bunch for work...

`libchewing` has FAILs in the test suite when building with my standard
12 cores:
test-easy-symbol
test-fullshape

When building with `--cores=1` the test suite passes, maybe we should
set the build on parallel. It doesn't take much longer...

~Jonathan




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-31 13:57   ` Jonathan Brielmaier
@ 2021-01-31 14:10     ` Leo Prikler
  2021-01-31 16:50       ` Jonathan Brielmaier
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-31 14:10 UTC (permalink / raw)
  To: Jonathan Brielmaier, Raghav Gururajan, 45721

Hi Jonathan,
Am Sonntag, den 31.01.2021, 14:57 +0100 schrieb Jonathan Brielmaier:
> Hi Raghav,
> 
> thanks for your hard work on Telegram! I always avoided it as I know
> from openSUSE packaging that it's quite a bunch for work...
> 
> `libchewing` has FAILs in the test suite when building with my
> standard
> 12 cores:
> test-easy-symbol
> test-fullshape
> 
> When building with `--cores=1` the test suite passes, maybe we should
> set the build on parallel. It doesn't take much longer...
> 
> ~Jonathan
If you're willing to write up a patch, I'd be happy to push that for
you.  It seems libchewing fails on CI as well.  Is that the same issue
you're experiencing or is it a different one?

Regards,
Leo





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-31 14:10     ` Leo Prikler
@ 2021-01-31 16:50       ` Jonathan Brielmaier
  2021-01-31 16:56         ` Leo Prikler
  0 siblings, 1 reply; 55+ messages in thread
From: Jonathan Brielmaier @ 2021-01-31 16:50 UTC (permalink / raw)
  To: Leo Prikler, Raghav Gururajan, 45721

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]

On 31.01.21 15:10, Leo Prikler wrote:
> Hi Jonathan,
> Am Sonntag, den 31.01.2021, 14:57 +0100 schrieb Jonathan Brielmaier:
>> Hi Raghav,
>>
>> thanks for your hard work on Telegram! I always avoided it as I know
>> from openSUSE packaging that it's quite a bunch for work...
>>
>> `libchewing` has FAILs in the test suite when building with my
>> standard
>> 12 cores:
>> test-easy-symbol
>> test-fullshape
>>
>> When building with `--cores=1` the test suite passes, maybe we should
>> set the build on parallel. It doesn't take much longer...
>>
>> ~Jonathan
> If you're willing to write up a patch, I'd be happy to push that for
> you.  It seems libchewing fails on CI as well.  Is that the same issue
> you're experiencing or is it a different one?

On i686 and aarch64 are the same both tests mentioned above failing.

So I guess a `#:parallel-tests? #f` is the best solution here. Attached
is my patch, which I would push later if you have no objections...

[-- Attachment #2: 0001-gnu-libchewing-Disable-parallel-tests.patch --]
[-- Type: text/x-patch, Size: 1113 bytes --]

From 67286626b74daff396c33fe9d8fca6f77f58642b Mon Sep 17 00:00:00 2001
From: Jonathan Brielmaier <jonathan.brielmaier@web.de>
Date: Sun, 31 Jan 2021 17:47:20 +0100
Subject: [PATCH] gnu: libchewing: Disable parallel tests.

Some tests fail constant when building with multiple threads.

* gnu/packages/language.scm (libchewing)[arguments]: Set
`parallel-tests` to false.
---
 gnu/packages/language.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 67b519aa56..ed6c0e6686 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -287,7 +287,9 @@ Random Cage Fighting Birds, Cool Music etc.")
         (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
+      ;; test-easy-symbol and test-fullshape fail with multiple cores.
+     `(#:parallel-tests? #f
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'disable-failing-tests
            (lambda _
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-31 16:50       ` Jonathan Brielmaier
@ 2021-01-31 16:56         ` Leo Prikler
  2021-01-31 17:01           ` Jonathan Brielmaier
  0 siblings, 1 reply; 55+ messages in thread
From: Leo Prikler @ 2021-01-31 16:56 UTC (permalink / raw)
  To: Jonathan Brielmaier, Raghav Gururajan, 45721

Am Sonntag, den 31.01.2021, 17:50 +0100 schrieb Jonathan Brielmaier:
> On 31.01.21 15:10, Leo Prikler wrote:
> > Hi Jonathan,
> > Am Sonntag, den 31.01.2021, 14:57 +0100 schrieb Jonathan
> > Brielmaier:
> > > Hi Raghav,
> > > 
> > > thanks for your hard work on Telegram! I always avoided it as I
> > > know
> > > from openSUSE packaging that it's quite a bunch for work...
> > > 
> > > `libchewing` has FAILs in the test suite when building with my
> > > standard
> > > 12 cores:
> > > test-easy-symbol
> > > test-fullshape
> > > 
> > > When building with `--cores=1` the test suite passes, maybe we
> > > should
> > > set the build on parallel. It doesn't take much longer...
> > > 
> > > ~Jonathan
> > If you're willing to write up a patch, I'd be happy to push that
> > for
> > you.  It seems libchewing fails on CI as well.  Is that the same
> > issue
> > you're experiencing or is it a different one?
> 
> On i686 and aarch64 are the same both tests mentioned above failing.
> 
> So I guess a `#:parallel-tests? #f` is the best solution here.
> Attached
> is my patch, which I would push later if you have no objections...
I'd personally pack the comment inside the list, otherwise LGTM.





^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-31 16:56         ` Leo Prikler
@ 2021-01-31 17:01           ` Jonathan Brielmaier
  2021-01-31 19:14             ` Raghav Gururajan
  0 siblings, 1 reply; 55+ messages in thread
From: Jonathan Brielmaier @ 2021-01-31 17:01 UTC (permalink / raw)
  To: Leo Prikler, Raghav Gururajan, 45721

On 31.01.21 17:56, Leo Prikler wrote:
>> On i686 and aarch64 are the same both tests mentioned above failing.
>>
>> So I guess a `#:parallel-tests? #f` is the best solution here.
>> Attached
>> is my patch, which I would push later if you have no objections...
> I'd personally pack the comment inside the list, otherwise LGTM.
>

Hint accepted and pushed as 63c237d0448d92b3f0b0f9e9c337b2078a27a715.




^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-31  8:37   ` bug#45721: " Leo Prikler
@ 2021-01-31 19:11     ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-31 19:11 UTC (permalink / raw)
  To: Leo Prikler, 45721-done


[-- Attachment #1.1.1: Type: text/plain, Size: 206 bytes --]

Hi Leo!

> Pushed with a small change – instead of using 0 for the rlottie base
> version, it's 0.0.1 in line with upstream.

Thanks a lot.

> Thanks for your hard work!

:-)

Regards,
RG.


[-- Attachment #1.1.2: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [bug#45721] Telegram Desktop (v27)
  2021-01-31 17:01           ` Jonathan Brielmaier
@ 2021-01-31 19:14             ` Raghav Gururajan
  0 siblings, 0 replies; 55+ messages in thread
From: Raghav Gururajan @ 2021-01-31 19:14 UTC (permalink / raw)
  To: Jonathan Brielmaier, Leo Prikler, 45721


[-- Attachment #1.1.1: Type: text/plain, Size: 441 bytes --]

Hi Jonathan!

>>> On i686 and aarch64 are the same both tests mentioned above failing.
>>>
>>> So I guess a `#:parallel-tests? #f` is the best solution here.
>>> Attached
>>> is my patch, which I would push later if you have no objections...
>> I'd personally pack the comment inside the list, otherwise LGTM.
>>
> 
> Hint accepted and pushed as 63c237d0448d92b3f0b0f9e9c337b2078a27a715.

Thanks for fixing it.

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2021-01-31 19:17 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08  0:20 [bug#45721] Telegram Desktop Raghav Gururajan
2021-01-08  0:44 ` [bug#45721] Telegram Desktop (v2) Raghav Gururajan
2021-01-12  3:12 ` [bug#45721] Telegram Desktop (v3) Raghav Gururajan
2021-01-12  3:27 ` [bug#45721] Telegram Desktop (v4) Raghav Gururajan
2021-01-13 22:13 ` [bug#45721] Telegram Desktop (v5) Raghav Gururajan
2021-01-14  5:39 ` [bug#45721] Telegram Desktop (v6) Raghav Gururajan
2021-01-14  6:41 ` [bug#45721] Telegram Desktop (v7) Raghav Gururajan
2021-01-14 10:38 ` [bug#45721] Telegram Desktop (v8) Raghav Gururajan
2021-01-16 16:08 ` [bug#45721] Telegram Desktop (v9) Raghav Gururajan
2021-01-16 17:15   ` Nicolò Balzarotti
2021-01-16 21:22     ` Raghav Gururajan
2021-01-16 18:04 ` Leo Prikler
2021-01-17  0:19   ` Raghav Gururajan
2021-01-17  0:36     ` Leo Prikler
2021-01-17  1:10       ` Raghav Gururajan
2021-01-17  0:05 ` [bug#45721] Telegram Desktop (v10) Raghav Gururajan
2021-01-17  0:29 ` [bug#45721] Telegram Desktop (v11) Raghav Gururajan
2021-01-17  1:04 ` [bug#45721] Telegram Desktop (v12) Raghav Gururajan
2021-01-17  1:52 ` [bug#45721] Telegram Desktop (v13) Raghav Gururajan
2021-01-17 12:13   ` Leo Prikler
2021-01-17 14:49     ` Raghav Gururajan
2021-01-17 19:08       ` [bug#45721] [PATCH v15] Add Telegram Desktop Leo Prikler
2021-01-17 21:59         ` Raghav Gururajan
2021-01-19 10:11         ` [bug#45721] [PATCH v16] " Leo Prikler
2021-01-17 14:43 ` [bug#45721] Telegram Desktop (v14) Raghav Gururajan
2021-01-20 10:41 ` [bug#45721] Telegram Desktop (v17) Raghav Gururajan
2021-01-20 11:07   ` Leo Prikler
2021-01-20 12:32     ` Raghav Gururajan
2021-01-20 12:29 ` [bug#45721] Telegram Desktop (v18) Raghav Gururajan
2021-01-20 13:49 ` [bug#45721] Telegram Desktop (v19) Raghav Gururajan
2021-01-20 14:42 ` [bug#45721] Telegram Desktop (v20) Raghav Gururajan
2021-01-20 15:10   ` Leo Prikler
2021-01-21  3:44 ` [bug#45721] Telegram Desktop (v21) Raghav Gururajan
2021-01-21 19:11   ` [bug#45721] [PATCH v22] Add Telegram Desktop Leo Prikler
2021-01-21 19:37     ` Raghav Gururajan
2021-01-21 19:44       ` Leo Prikler
2021-01-21 19:46         ` Raghav Gururajan
2021-01-22  4:27 ` [bug#45721] Telegram Desktop (v23) Raghav Gururajan
2021-01-22  7:42   ` Leo Prikler
2021-01-28  0:41     ` Raghav Gururajan
2021-01-28  0:41 ` [bug#45721] Telegram Desktop (v24) Raghav Gururajan
2021-01-28  7:47   ` Leo Prikler
2021-01-30 17:04 ` [bug#45721] Telegram Desktop (v25) Raghav Gururajan
     [not found]   ` <e881733992b22e238f2b90149dbceac6c3467180.camel@student.tugraz.at>
     [not found]     ` <e5040a67-824f-17c8-e16f-1a68531b3d5f@raghavgururajan.name>
2021-01-30 18:24       ` Leo Prikler
2021-01-30 19:30         ` Raghav Gururajan
2021-01-30 18:02 ` [bug#45721] Telegram Desktop (v26) Raghav Gururajan
2021-01-30 19:02 ` [bug#45721] Telegram Desktop (v27) Raghav Gururajan
2021-01-31  8:37   ` bug#45721: " Leo Prikler
2021-01-31 19:11     ` [bug#45721] " Raghav Gururajan
2021-01-31 13:57   ` Jonathan Brielmaier
2021-01-31 14:10     ` Leo Prikler
2021-01-31 16:50       ` Jonathan Brielmaier
2021-01-31 16:56         ` Leo Prikler
2021-01-31 17:01           ` Jonathan Brielmaier
2021-01-31 19:14             ` Raghav Gururajan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).