diff mbox series

[bug#38325] gnu: Add tdlib.

Message ID 87blsx91w0.fsf@posteo.net
State Accepted
Headers show
Series [bug#38325] gnu: Add tdlib. | expand

Commit Message

Brett Gilio Nov. 27, 2019, 8:09 a.m. UTC

Comments

Brett Gilio Nov. 27, 2019, 8:18 a.m. UTC | #1
Brett Gilio <brettg@posteo.net> writes:

> From d584c09c37d8e2b70fb5b6b1b2c685698f7ac73d Mon Sep 17 00:00:00 2001
> From: Brett Gilio <brettg@posteo.net>
> Date: Wed, 27 Nov 2019 02:08:02 -0600
> Subject: [PATCH] gnu: Add tdlib.
>
> * gnu/packages/messaging.scm (tdlib): New variable.
> ---
>  gnu/packages/messaging.scm | 47 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
>
> diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
> index 33e752c9a0..b268805b9b 100644
> --- a/gnu/packages/messaging.scm
> +++ b/gnu/packages/messaging.scm
> @@ -16,6 +16,7 @@
>  ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
>  ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
>  ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
> +;;; Copyright © 2019 Brett Gilio <brettg@posteo.net>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -57,6 +58,7 @@
>    #:use-module (gnu packages glib)
>    #:use-module (gnu packages gnome)
>    #:use-module (gnu packages gnupg)
> +  #:use-module (gnu packages gperf)
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages guile)
>    #:use-module (gnu packages icu4c)
> @@ -72,6 +74,7 @@
>    #:use-module (gnu packages pcre)
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages photo)
> +  #:use-module (gnu packages php)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages protobuf)
>    #:use-module (gnu packages python)
> @@ -1946,4 +1949,48 @@ Telegram messenger.")
>      ;; itself is GPLv2+.
>      (license license:gpl2+)))
>  
> +(define-public tdlib
> +  (let ((commit "afca63a4f43531058a079e91eb5c81f54ad744b5")
> +	(revision "1")
> +	(version "1.5.0"))
> +    (package
> +      (name "tdlib")
> +      (version (git-version version revision commit))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/tdlib/td.git")
> +                      (commit commit)))
> +                (sha256
> +                 (base32
> +                  "1aa3p4k32mfshgc6fv58gwg8pnaix39rv455hfx6znj7llr8na6k"))
> +                (file-name (git-file-name name version))))
> +      (build-system cmake-build-system)
> +      (arguments
> +       `(#:tests? #t
> +         #:phases
> +         (modify-phases %standard-phases
> +           (add-after 'unpack 'remove-failing-tests
> +             (lambda _
> +               (substitute* "test/CMakeLists.txt"
> +                 ;; The test cases are compiled into a distinct binary
> +                 ;; which uses mtproto.cpp to attempt to connect to
> +                 ;; a remote server. Removing this file from the sources
> +                 ;; list disables those specific test cases.
> +                 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/mtproto.cpp") ""))
> +               #t)))))
> +      (native-inputs
> +       `(("gperf" ,gperf)
> +         ("openssl" ,openssl)
> +         ("zlib" ,zlib)
> +         ("php" ,php)
> +         ("doxygen" ,doxygen)))
> +      (synopsis "Cross-platform library for building Telegram clients")
> +      (description "Tdlib is a cross-platform library for creating custom
> +Telegram clients following the official Telegram API.  It can be easily used
> +from almost any programming language with a C-FFI and features first-class
> +support for high performance Telegram Bot creation.")
> +      (home-page "https://core.telegram.org/tdlib")
> +      (license license:boost1.0))))
> +
>  ;;; messaging.scm ends here

Ludo,

Hopefully this one is better. I also described how I
rectified the issue with the test suite. I suppose I could have removed
#:tests? #t, but I was just happy I believe I found the right
solution. The test suite for this project is more than a little
unconventional (at least to my experience).

Brett Gilio
Brett Gilio Nov. 28, 2019, 7:08 p.m. UTC | #2
Brett Gilio <brettg@posteo.net> writes:

> Brett Gilio <brettg@posteo.net> writes:
>
>> From d584c09c37d8e2b70fb5b6b1b2c685698f7ac73d Mon Sep 17 00:00:00 2001
>> From: Brett Gilio <brettg@posteo.net>
>> Date: Wed, 27 Nov 2019 02:08:02 -0600
>> Subject: [PATCH] gnu: Add tdlib.
>>
>> * gnu/packages/messaging.scm (tdlib): New variable.
>> ---
>>  gnu/packages/messaging.scm | 47 ++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 47 insertions(+)
>>
>> diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
>> index 33e752c9a0..b268805b9b 100644
>> --- a/gnu/packages/messaging.scm
>> +++ b/gnu/packages/messaging.scm
>> @@ -16,6 +16,7 @@
>>  ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
>>  ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
>>  ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
>> +;;; Copyright © 2019 Brett Gilio <brettg@posteo.net>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -57,6 +58,7 @@
>>    #:use-module (gnu packages glib)
>>    #:use-module (gnu packages gnome)
>>    #:use-module (gnu packages gnupg)
>> +  #:use-module (gnu packages gperf)
>>    #:use-module (gnu packages gtk)
>>    #:use-module (gnu packages guile)
>>    #:use-module (gnu packages icu4c)
>> @@ -72,6 +74,7 @@
>>    #:use-module (gnu packages pcre)
>>    #:use-module (gnu packages perl)
>>    #:use-module (gnu packages photo)
>> +  #:use-module (gnu packages php)
>>    #:use-module (gnu packages pkg-config)
>>    #:use-module (gnu packages protobuf)
>>    #:use-module (gnu packages python)
>> @@ -1946,4 +1949,48 @@ Telegram messenger.")
>>      ;; itself is GPLv2+.
>>      (license license:gpl2+)))
>>  
>> +(define-public tdlib
>> +  (let ((commit "afca63a4f43531058a079e91eb5c81f54ad744b5")
>> +	(revision "1")
>> +	(version "1.5.0"))
>> +    (package
>> +      (name "tdlib")
>> +      (version (git-version version revision commit))
>> +      (source (origin
>> +                (method git-fetch)
>> +                (uri (git-reference
>> +                      (url "https://github.com/tdlib/td.git")
>> +                      (commit commit)))
>> +                (sha256
>> +                 (base32
>> +                  "1aa3p4k32mfshgc6fv58gwg8pnaix39rv455hfx6znj7llr8na6k"))
>> +                (file-name (git-file-name name version))))
>> +      (build-system cmake-build-system)
>> +      (arguments
>> +       `(#:tests? #t
>> +         #:phases
>> +         (modify-phases %standard-phases
>> +           (add-after 'unpack 'remove-failing-tests
>> +             (lambda _
>> +               (substitute* "test/CMakeLists.txt"
>> +                 ;; The test cases are compiled into a distinct binary
>> +                 ;; which uses mtproto.cpp to attempt to connect to
>> +                 ;; a remote server. Removing this file from the sources
>> +                 ;; list disables those specific test cases.
>> +                 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/mtproto.cpp") ""))
>> +               #t)))))
>> +      (native-inputs
>> +       `(("gperf" ,gperf)
>> +         ("openssl" ,openssl)
>> +         ("zlib" ,zlib)
>> +         ("php" ,php)
>> +         ("doxygen" ,doxygen)))
>> +      (synopsis "Cross-platform library for building Telegram clients")
>> +      (description "Tdlib is a cross-platform library for creating custom
>> +Telegram clients following the official Telegram API.  It can be easily used
>> +from almost any programming language with a C-FFI and features first-class
>> +support for high performance Telegram Bot creation.")
>> +      (home-page "https://core.telegram.org/tdlib")
>> +      (license license:boost1.0))))
>> +
>>  ;;; messaging.scm ends here
>
> Ludo,
>
> Hopefully this one is better. I also described how I
> rectified the issue with the test suite. I suppose I could have removed
> #:tests? #t, but I was just happy I believe I found the right
> solution. The test suite for this project is more than a little
> unconventional (at least to my experience).
>
> Brett Gilio

Is there any further need for review for this revised patch? If not, can
we get it tested and merged. :)

Thanks!
Ludovic Courtès Nov. 29, 2019, 1:10 p.m. UTC | #3
Hi Brett,

Brett Gilio <brettg@posteo.net> skribis:

>>From d584c09c37d8e2b70fb5b6b1b2c685698f7ac73d Mon Sep 17 00:00:00 2001
> From: Brett Gilio <brettg@posteo.net>
> Date: Wed, 27 Nov 2019 02:08:02 -0600
> Subject: [PATCH] gnu: Add tdlib.
>
> * gnu/packages/messaging.scm (tdlib): New variable.

Applied, thanks.

And apologies for the delay!

Ludo’.
Brett Gilio Nov. 29, 2019, 7:08 p.m. UTC | #4
Ludovic Courtès <ludo@gnu.org> writes:

> Hi Brett,
>
> Brett Gilio <brettg@posteo.net> skribis:
>
>>>From d584c09c37d8e2b70fb5b6b1b2c685698f7ac73d Mon Sep 17 00:00:00 2001
>> From: Brett Gilio <brettg@posteo.net>
>> Date: Wed, 27 Nov 2019 02:08:02 -0600
>> Subject: [PATCH] gnu: Add tdlib.
>>
>> * gnu/packages/messaging.scm (tdlib): New variable.
>
> Applied, thanks.
>
> And apologies for the delay!
>
> Ludo’.

Thank you :).
diff mbox series

Patch

From d584c09c37d8e2b70fb5b6b1b2c685698f7ac73d Mon Sep 17 00:00:00 2001
From: Brett Gilio <brettg@posteo.net>
Date: Wed, 27 Nov 2019 02:08:02 -0600
Subject: [PATCH] gnu: Add tdlib.

* gnu/packages/messaging.scm (tdlib): New variable.
---
 gnu/packages/messaging.scm | 47 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 33e752c9a0..b268805b9b 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -16,6 +16,7 @@ 
 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019 Brett Gilio <brettg@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,6 +58,7 @@ 
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages gperf)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages icu4c)
@@ -72,6 +74,7 @@ 
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages photo)
+  #:use-module (gnu packages php)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
@@ -1946,4 +1949,48 @@  Telegram messenger.")
     ;; itself is GPLv2+.
     (license license:gpl2+)))
 
+(define-public tdlib
+  (let ((commit "afca63a4f43531058a079e91eb5c81f54ad744b5")
+	(revision "1")
+	(version "1.5.0"))
+    (package
+      (name "tdlib")
+      (version (git-version version revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/tdlib/td.git")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "1aa3p4k32mfshgc6fv58gwg8pnaix39rv455hfx6znj7llr8na6k"))
+                (file-name (git-file-name name version))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #t
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'remove-failing-tests
+             (lambda _
+               (substitute* "test/CMakeLists.txt"
+                 ;; The test cases are compiled into a distinct binary
+                 ;; which uses mtproto.cpp to attempt to connect to
+                 ;; a remote server. Removing this file from the sources
+                 ;; list disables those specific test cases.
+                 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/mtproto.cpp") ""))
+               #t)))))
+      (native-inputs
+       `(("gperf" ,gperf)
+         ("openssl" ,openssl)
+         ("zlib" ,zlib)
+         ("php" ,php)
+         ("doxygen" ,doxygen)))
+      (synopsis "Cross-platform library for building Telegram clients")
+      (description "Tdlib is a cross-platform library for creating custom
+Telegram clients following the official Telegram API.  It can be easily used
+from almost any programming language with a C-FFI and features first-class
+support for high performance Telegram Bot creation.")
+      (home-page "https://core.telegram.org/tdlib")
+      (license license:boost1.0))))
+
 ;;; messaging.scm ends here
-- 
2.24.0