diff mbox series

[bug#45721] Telegram Desktop (v23)

Message ID 577c0bdc-7144-7c35-ff9e-74d5e7143a06@raghavgururajan.name
State Accepted
Headers show
Series [bug#45721] Telegram Desktop (v23) | expand

Checks

Context Check Description
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. 22, 2021, 4:27 a.m. UTC
Phew!

Comments

Leo Prikler Jan. 22, 2021, 7:42 a.m. UTC | #1
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
Raghav Gururajan Jan. 28, 2021, 12:41 a.m. UTC | #2
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.
diff mbox series

Patch

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