Replies: 6 comments 3 replies
-
Hi @Kabouik, Thanks for providing a very detailed background. I don't know the answer, but I'll try to look into it. Meanwhile if anyone else is familiar with Guix, feel free to chip in. |
Beta Was this translation helpful? Give feedback.
-
Below is a variation that is not meant to replace the previous one, but that allows installing (define-module (nchat-master)
#:use-module (guix build-system cmake)
#:use-module (gnu packages ccache)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages gcc)
#:use-module (gnu packages golang)
#:use-module (gnu packages gperf)
#:use-module (gnu packages llvm)
#:use-module (gnu packages man)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages tls)
#:use-module (gnu packages readline)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages compression)
#:use-module ((guix licenses)
#:prefix license:)
#:use-module (guix packages)
#:use-module (guix git)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (guix deprecation)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1))
(define-public nchat
(package
(name "nchat")
(version "master")
(source
(git-checkout
(url "https://github.com/d99kris/nchat")
(branch "master")))
(build-system cmake-build-system)
(arguments
(list #:tests? #f ; no tests
#:phases #~(modify-phases %standard-phases
(add-before 'configure 'set-compilers-and-home
(lambda* (#:key inputs #:allow-other-keys)
(setenv "CC" "clang")
(setenv "CXX" "clang++")
(setenv "HOME" "/tmp")
#t)))))
(native-inputs (list ccache gperf cmake help2man go))
(inputs (list ncurses openssl readline sqlite zlib clang))
(synopsis "Terminal-based Telegram/WhatsApp client")
(description
"@command{nchat} is a terminal-based Telegram and WhatsApp client.
This version is based on the master branch and may be unstable.")
(home-page "https://github.com/d99kris/nchat")
(license license:expat))) I have both packages in my Guix private channel right now (kind of like a PPA repository) and they both work. I don't think the |
Beta Was this translation helpful? Give feedback.
-
Hey,
Yes, this is already what I did but I haven't reported it in this issue yet, only in the Telegram group. This builds fine (even on the phone, and at some point it takes more than 1.5GB, which is surprising), it just takes forever to build, so I would like to investigate ways to build using `make.sh` to optimize the number of cores being used.
…On 2023-11-20 15:29 Kristofer Berggren ***@***.***> wrote:
I haven't gotten a chance to look into this properly yet, but just
wanted to share that I found
https://guix.gnu.org/manual/en/html_node/Build-Phases.html which
states
```
build
Run make with the list of flags specified with #:make-flags. If the
#:parallel-build? argument is true (the default), build with make
-j.
```
`make -j` means using any number of concurrent jobs/processes, so it
could result in a very high memory usage. I would suggest trying to
set this `parallel-build` argument to false (I don't have to do it in
practise though, but maybe you're familiar).
It will be slow though. Tdlib (official Telegram client library) is a
quite large library.
--
Reply to this email directly or view it on GitHub:
#151 (comment)
0165
You are receiving this because you were mentioned.
Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I forgot to post the WIP packages, here they are: master (will always fetch the latest commit): (define-module (nchat-master)
#:use-module (gnu packages ccache)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages golang)
#:use-module (gnu packages gperf)
#:use-module (gnu packages llvm)
#:use-module (gnu packages man)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages tls)
#:use-module (gnu packages readline)
#:use-module (gnu packages sqlite)
#:use-module (guix build-system cmake)
#:use-module (guix deprecation)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1))
(define-public nchat
(package
(name "nchat")
(version "master")
(source
(git-checkout
(url "https://github.com/d99kris/nchat")
(branch "master")))
(build-system cmake-build-system)
(arguments
(list #:tests? #f ; no tests
#:parallel-build? #f
#:phases #~(modify-phases %standard-phases
(add-before 'configure 'set-compilers-and-home
(lambda* (#:key inputs #:allow-other-keys)
(setenv "CC" "clang")
(setenv "CXX" "clang++")
(setenv "HOME" "/tmp")
#t)))))
(native-inputs (list ccache gperf cmake help2man go))
(inputs (list ncurses openssl readline sqlite zlib clang))
(synopsis "Terminal-based Telegram/WhatsApp client")
(description
"@command{nchat} is a terminal-based Telegram and WhatsApp client.
This version is based on the master branch and may be unstable.")
(home-page "https://github.com/d99kris/nchat")
(license license:expat))) v3.67: (define-module (nchat)
#:use-module (gnu packages ccache)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages golang)
#:use-module (gnu packages gperf)
#:use-module (gnu packages llvm)
#:use-module (gnu packages man)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages tls)
#:use-module (gnu packages readline)
#:use-module (gnu packages sqlite)
#:use-module (guix build-system cmake)
#:use-module (guix deprecation)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1))
(define-public nchat
(package
(name "nchat")
(version "3.67")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/d99kris/nchat")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1hi66yda2vkzc1p7ahfhysricgg93vifc3w3rrnkm82j7dxdj6ry"))))
(build-system cmake-build-system)
(arguments
(list #:tests? #f ; no tests
#:parallel-build? #f
#:phases #~(modify-phases %standard-phases
(add-before 'configure 'set-compilers-and-home
(lambda* (#:key inputs #:allow-other-keys)
(setenv "CC" "clang")
(setenv "CXX" "clang++")
(setenv "HOME" "/tmp")
#t)))))
(native-inputs (list ccache gperf cmake help2man go clang))
(inputs (list ncurses openssl readline sqlite zlib))
(synopsis "Terminal-based Telegram/WhatsApp client")
(description
"@command{nchat} is a terminal-based Telegram and WhatsApp client.")
(home-page "https://github.com/d99kris/nchat")
(license license:expat))) |
Beta Was this translation helpful? Give feedback.
-
So after some experiments and discussion with @d99kris over the week-end, it seems a major difficulty will be Whatsapp support. Packaging We do have many Go packages in Guix so I believe the package manager makes it so dependencies are picked for the build environment instead of the Internet if they are packaged for Guix too and added as inputs for the final package, so it should be possible to package all dependencies. I made a (draft) attempt at nchat-deps.scm which should cover dependencies for As far as I understad, @d99kris already bundles Once this is solved, another issue is Now I am not sure what path the dependencies would be built in if they are packaged, and I haven't found a proper way to test things quickly: typically, at the moment, I need to commit changes to the packages so that they are in the git private channel, Finally, patching (source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/d99kris/nchat")
(commit (string-append "v" version))))
(sha256
(base32 "1hi66yda2vkzc1p7ahfhysricgg93vifc3w3rrnkm82j7dxdj6ry"))
(patches (search-patches "nchat-go-deps.patch"))
(file-name (git-file-name name version)))) However, this works for Not asking anything to @d99kris with this long message, just trying to write down the observations before I forget them. |
Beta Was this translation helpful? Give feedback.
-
Will proceed to close this discussion for now, feel free to re-open it for any follow-up discussions. |
Beta Was this translation helpful? Give feedback.
-
Here is a first attempt at a package definition for Guix:
It builds nicely with
guix build -f /path/to/nchat.scm
and could be submitted as a patch already, but given the RAM use, I don't think it's taking into account theCC
andCXX
variables to build with the low-memory procedure described inLOWMEMORY.md
. I am not trying to do the source split withphp-cli
, but just build withclang
andclang++
would allow the package to work even on old or cheap hardware, or servers.In case you want to have a go at it, the Guix package manager is available to any distribution, so there is no need to create a Guix System VM, you could just add Guix package manager to a testing VM you may already have.
Guix packages are typically release-based, at least for the main and official package channel.
Beta Was this translation helpful? Give feedback.
All reactions