From 6762d1c1ce777ee8529afbc6e4d5aff2d994a8db Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 10 Feb 2025 18:15:49 +0100 Subject: [PATCH 1/6] [FIX/WIP] remove .guix from gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 5f7d56c..09b6fd1 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,7 @@ tags !.forgejo/* !.forgejo/** +!.guix +!.guix/* +!.guix/** + From a2c1de52dceb9ef39e1afacd0afafddd86141b1b Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 10 Feb 2025 18:16:24 +0100 Subject: [PATCH 2/6] [ADD] new guix.scm with cytoplasm --- .guix/modules/parsee.scm | 43 ++++++++++++++++++++++++++++++++++++++++ guix.scm | 1 + 2 files changed, 44 insertions(+) create mode 100644 .guix/modules/parsee.scm create mode 120000 guix.scm diff --git a/.guix/modules/parsee.scm b/.guix/modules/parsee.scm new file mode 100644 index 0000000..f2d6f48 --- /dev/null +++ b/.guix/modules/parsee.scm @@ -0,0 +1,43 @@ +(define-module (parsee) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix utils) + #:use-module (gnu packages tls) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public cytoplasm + (package + (name "cytoplasm") + (version "0.4.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.telodendria.io/Telodendria/Cytoplasm") + (commit (string-append "v" version)))) + (sha256 + (base32 "13iwh37xfmz98vmb6dzl4v6vlxcis5q85c8rzmv3fs28khsfk45n")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f + #:phases #~(modify-phases %standard-phases + (add-before 'configure 'add-ld-flags + (lambda _ + (substitute* "./configure" + (("(LDFLAGS=\"\\$\\{LIBS\\} \\$\\{LDFLAGS\\})\"" all flags) + (string-append flags " -Wl,-rpath=" #$output "/lib\""))) + (mkdir-p (string-append #$output "/lib")))) + (replace 'configure + (lambda* (#:key configure-flags #:allow-other-keys) + (apply invoke `("./configure" + ,(string-append "--prefix=" #$output) + ,@configure-flags))))))) + (inputs (list openssl)) + (home-page "https://git.telodendria.io/Telodendria/Cytoplasm") + (synopsis "General-purpose high-level networked C library") + (description "Cytoplasm is a general-purpose C library for creating +high-level (particularly networked and multi-threaded) C applications.") + (license license:expat))) diff --git a/guix.scm b/guix.scm new file mode 120000 index 0000000..021acc5 --- /dev/null +++ b/guix.scm @@ -0,0 +1 @@ +.guix/modules/parsee.scm \ No newline at end of file From b50b9bd6155ffc03baa7c683e35702c4b84127e3 Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 10 Feb 2025 22:23:03 +0100 Subject: [PATCH 3/6] [FIX] pin cytoplasm to the latest commit --- .guix/modules/parsee.scm | 68 +++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/.guix/modules/parsee.scm b/.guix/modules/parsee.scm index f2d6f48..3c5ce83 100644 --- a/.guix/modules/parsee.scm +++ b/.guix/modules/parsee.scm @@ -8,36 +8,40 @@ #:use-module ((guix licenses) #:prefix license:)) (define-public cytoplasm - (package - (name "cytoplasm") - (version "0.4.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.telodendria.io/Telodendria/Cytoplasm") - (commit (string-append "v" version)))) - (sha256 - (base32 "13iwh37xfmz98vmb6dzl4v6vlxcis5q85c8rzmv3fs28khsfk45n")))) - (build-system gnu-build-system) - (arguments - (list - #:tests? #f - #:phases #~(modify-phases %standard-phases - (add-before 'configure 'add-ld-flags - (lambda _ - (substitute* "./configure" - (("(LDFLAGS=\"\\$\\{LIBS\\} \\$\\{LDFLAGS\\})\"" all flags) - (string-append flags " -Wl,-rpath=" #$output "/lib\""))) - (mkdir-p (string-append #$output "/lib")))) - (replace 'configure - (lambda* (#:key configure-flags #:allow-other-keys) - (apply invoke `("./configure" - ,(string-append "--prefix=" #$output) - ,@configure-flags))))))) - (inputs (list openssl)) - (home-page "https://git.telodendria.io/Telodendria/Cytoplasm") - (synopsis "General-purpose high-level networked C library") - (description "Cytoplasm is a general-purpose C library for creating + (let ((commit "32f31fe6d61583630995d956ed7bd7566c4dc14f") + (revision "0")) + (package + (name "cytoplasm") + (version (git-version "0.4.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.telodendria.io/Telodendria/Cytoplasm") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "09x5xfswryf3wjs1synh972yr2fmpjmffi7pjyjdzb4asqh4whrv")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f + #:configure-flags #~'("--with-lmdb") + #:phases #~(modify-phases %standard-phases + (add-before 'configure 'add-ld-flags + (lambda _ + (substitute* "./configure" + (("(LDFLAGS=\"\\$\\{LIBS\\} \\$\\{LDFLAGS\\})\"" all flags) + (string-append flags " -Wl,-rpath=" #$output "/lib\""))) + (mkdir-p (string-append #$output "/lib")))) + (replace 'configure + (lambda* (#:key configure-flags #:allow-other-keys) + (apply invoke `("./configure" + ,(string-append "--prefix=" #$output) + ,@configure-flags))))))) + (inputs (list openssl lmdb)) + (home-page "https://git.telodendria.io/Telodendria/Cytoplasm") + (synopsis "General-purpose high-level networked C library") + (description "Cytoplasm is a general-purpose C library for creating high-level (particularly networked and multi-threaded) C applications.") - (license license:expat))) + (license license:expat)))) From 44473878d09b806e40d0ad146b867610712dd8a9 Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 10 Feb 2025 22:23:39 +0100 Subject: [PATCH 4/6] [ADD] add parsee guix package --- .guix/modules/parsee.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.guix/modules/parsee.scm b/.guix/modules/parsee.scm index 3c5ce83..75b8b64 100644 --- a/.guix/modules/parsee.scm +++ b/.guix/modules/parsee.scm @@ -5,8 +5,14 @@ #:use-module (guix gexp) #:use-module (guix utils) #:use-module (gnu packages tls) + #:use-module (gnu packages databases) #:use-module ((guix licenses) #:prefix license:)) +(define vcs-file? + (or (git-predicate + (dirname (dirname (current-source-directory)))) + (const #t))) + (define-public cytoplasm (let ((commit "32f31fe6d61583630995d956ed7bd7566c4dc14f") (revision "0")) @@ -45,3 +51,32 @@ (description "Cytoplasm is a general-purpose C library for creating high-level (particularly networked and multi-threaded) C applications.") (license license:expat)))) + +(define-public parsee + (package + (name "parsee") + (version "0.0.1-git") + (source + (local-file "../.." "parsee-checkout" + #:recursive? #t + #:select? vcs-file?)) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f + #:make-flags #~(list "CC=gcc" + (string-append "CYTO_INC=" #$cytoplasm "/include") + (string-append "CYTO_LIB=" #$cytoplasm "/lib") + (string-append "PREFIX=" #$output)) + #:phases #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs #:allow-other-keys) + (let ((gcc (string-append (assoc-ref inputs "gcc") "/bin/gcc"))) + (invoke gcc "configure.c" "-o" "configure") + (invoke "./configure"))))))) + (home-page "https://git.kappach.at/lda/Parsee") + (synopsis "Jealous Matrix to XMPP bridge") + (description "Parsee is a Matrix-XMPP bridge written in C99 with Cytoplasm.") + (license license:agpl3+))) + +parsee From 680b4261c25f74ed1551ec75d9efc07346e6bf56 Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 10 Feb 2025 22:54:45 +0100 Subject: [PATCH 5/6] [ADD] small documentation paragraph --- README.MD | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.MD b/README.MD index ce51662..ee223de 100644 --- a/README.MD +++ b/README.MD @@ -43,6 +43,13 @@ Parsee tries to avoid dependencies aside from [Cytoplasm](https://git.telodendri Itself optionally depends on a good POSIX implementation, and optionally OpenSSL/LMDB (highly recommended, but you can get away without those if you're adventurous). +### BUILDING WITH GUIX +If you have [Guix](https://guix.gnu.org/) installed, you can build Parsee using `guix package -f guix.scm`, or test it +using `guix shell -f guix.scm`. You can also generate a Docker/OCI image. +```sh +guix pack -f docker -S /bin=bin -L.guix/modules parsee +``` + ## RUNNING First off, you may want to configure Parsee by running the `config` tool(generally named `parsee-config` in most cases), with the correct flags, like here. From e21ebed134bd553dd7dd8e79f431467494b66fd6 Mon Sep 17 00:00:00 2001 From: lda Date: Sun, 23 Feb 2025 22:38:38 +0000 Subject: [PATCH 6/6] [META/ADD] Add Guix to the CHANGELOG quick und dirty --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04358d7..9b12530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ TBD - Parsee can now access the homeserver/component locally (rather than over the network) - The endpoint for media has been changed to '/media/[SERV]/[ID]?hmac=...' - Add parsee-plumb tool to manage plumbing from outside Parsee if it is not running. +- Add packaging for Guix (see #18) #### Bugfixes - Fix potential infinite loops when processing some messages. - Parsee now handles pinging puppets from Matrix more sanely.