Subject: [bug#45954] Telegram-CLI (v6)

From: Leo Prikler <[email-masked]>
Date: Mon, 01 Feb 2021 09:30:43 +0100

Am Sonntag, den 31.01.2021, 14:46 -0500 schrieb Raghav Gururajan:
> +(define-public tgl
> +  (package
> +    (name "tgl")
> +    (version "2.0.1")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference
> +         (url "https://github.com/vysheng/tgl.git")
> +         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
The commit does not match up with the version.  If this is intended,
use git-version instead.

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin-to (string-append out "/bin"))
> +                    (include-to (string-append out "/include"))
> +                    (lib-to (string-append out "/lib"))
> +                    (source (string-append (getenv "TEMP")
> "/source"))
> +                    (bin-from (string-append source "/bin"))
> +                    (lib-from (string-append source "/libs")))
> +               ;; Install executables.
> +               (with-directory-excursion bin-from
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file bin-to))
> +                  (list
> +                   "generate")))
> +               ;; Install headers.
> +               (with-directory-excursion source
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file (string-append include-to
> "/tgl/crypto"))
> +                    (delete-file file))
> +                  (find-files "crypto" "\\.h$"))
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file (string-append include-to
> "/tgl/auto"))
> +                    (delete-file file))
> +                  (find-files "auto" "\\.h$"))
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file (string-append include-to
> "/tgl"))
> +                    (delete-file file))
> +                  (find-files "." "\\.h$")))
> +               ;; Install libraries.
> +               (for-each
> +                (lambda (file)
> +                  (install-file file (string-append lib-to "/tgl")))
> +                (find-files lib-from "\\.(a|so)$")))
> +             #t)))))
You might want to write that in terms of copy-build-system.

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (source (string-append (getenv "TEMP")
> "/source")))
> +               ;; Install client.
> +               (install-file
> +                (string-append source "/bin/telegram-cli")
> +                (string-append out "/bin"))
> +               ;; Install daemon.
> +               (install-file
> +                (string-append source "/start-telegram-daemon")
> +                (string-append out "/bin"))
> +               ;; Install daemon script.
> +               (install-file
> +                (string-append source "/telegram-daemon")
> +                (string-append out "/etc/init.d"))
> +               ;; Install server public-key.
> +               (install-file
> +                (string-append source "/server.pub")
> +                (string-append out "/etc/telegram-cli")))
> +             #t))
Same here.  Also, I'm not sure if SysV init scripts are that compatible
with Guix running on Shepherd.  Is there a more direct way of launching
the daemon?

> +                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr
> /sbin:/usr/bin")
> +                    "$PATH")
Not that it makes much of a difference, as I doubt this file will still
be needed, but PATH=$PATH is a noop.  Perhaps you want (getenv "PATH")
instead?

Regards,
Leo