diff mbox series

[bug#45721] Telegram Desktop (v13)

Message ID ae71c9c2-cdb8-0f13-b212-0a0c8fc4369b@raghavgururajan.name
State Accepted
Headers show
Series [bug#45721] Telegram Desktop (v13) | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Raghav Gururajan Jan. 17, 2021, 1:52 a.m. UTC

Comments

Leo Prikler Jan. 17, 2021, 12:13 p.m. UTC | #1
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
Raghav Gururajan Jan. 17, 2021, 2:49 p.m. UTC | #2
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.
diff mbox series

Patch

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