2 Commits

Author SHA1 Message Date
self 76985222e7 feat: build channel plugins in substitute baseline 2026-05-02 23:42:58 +02:00
self 5ecd1fbffe fix: compile bundled tribes_ui plugin
Compile the in-tree tribes_ui Mix project during the Tribes release build and install its ebin output into the packaged plugin directory so the runtime plugin loader can load the entry module.
2026-05-02 22:24:17 +02:00
8 changed files with 170 additions and 13 deletions
+4 -2
View File
@@ -4,7 +4,8 @@
#:use-module (tribes packages otp)
#:use-module (tribes packages source)
#:use-module (tribes packages terminals)
#:use-module (tribes packages web))
#:use-module (tribes packages web)
#:use-module (tribes plugins registry))
(define %tribes-node-specifications
'("nss-certs"
@@ -42,6 +43,7 @@
hitch
vinyl
lego
(tribes-node-package)))))
(tribes-node-package))
(guix-tribes-plugin-substitute-packages))))
(make-tribes-node-manifest)
+2 -2
View File
@@ -2,9 +2,9 @@
(name 'guix)
(url "https://git.teralink.net/tribes/guix-fork.git")
(branch "master")
;; Guix v1.5.0
;; guix-fork master
(commit
"6f9c3cd1761f0a3f8b70223cb0e0f47e29582d90")
"906f6b2d3a4f9f80c5ad6f9e5f6369706a1a301d")
(introduction
(make-channel-introduction
"6f9c3cd1761f0a3f8b70223cb0e0f47e29582d90"
+2 -2
View File
@@ -3,9 +3,9 @@
(name 'guix)
(url "https://git.teralink.net/tribes/guix-fork.git")
(branch "master")
;; Guix v1.5.0
;; guix-fork master
(commit
"6f9c3cd1761f0a3f8b70223cb0e0f47e29582d90")
"906f6b2d3a4f9f80c5ad6f9e5f6369706a1a301d")
(introduction
(make-channel-introduction
"6f9c3cd1761f0a3f8b70223cb0e0f47e29582d90"
+1 -2
View File
@@ -200,8 +200,7 @@ package-lock.json."
(mkdir-p out)
(copy-recursively (string-append plugin-assets-dir "/node_modules")
out
#:follow-symlinks? #t)))
out)))
#:options
`(#:hash ,(base32 sha256)
#:hash-algo sha256
+14 -3
View File
@@ -251,9 +251,20 @@ lib/*/ebin."
(when (file-exists? node-modules-dir)
(delete-file-recursively node-modules-dir))
(copy-recursively #+asset-deps-source
node-modules-dir
#:follow-symlinks? #t)
(invoke "chmod" "-R" "u+w" node-modules-dir)))
node-modules-dir)
(invoke "chmod" "-R" "u+w" node-modules-dir)
(invoke "find"
node-modules-dir
"-type" "f"
"-path" "*/.bin/*"
"-exec" "chmod" "+x" "{}" "+")
(let ((bin-dir (string-append node-modules-dir "/.bin")))
(when (file-exists? bin-dir)
(for-each
(lambda (script)
(patch-shebang (canonicalize-path script)
(list #$(file-append node "/bin"))))
(find-files bin-dir))))))
plugin-api-setup-gexp))
(resolved-asset-build-gexp
(cond
+15 -1
View File
@@ -463,6 +463,10 @@ mix.lock and assets/package-lock.json."
(invoke "mix" "phx.digest"))
#:install-gexp
#~(begin
(when (file-exists? "plugins/tribes_ui/mix.exs")
(with-directory-excursion "plugins/tribes_ui"
(invoke "mix" "compile")))
(invoke "mix" "release" "--path" out)
(let ((launcher (string-append out "/bin/" #$name))
(launcher-app (string-append out "/bin/" #$name "-app")))
@@ -472,7 +476,17 @@ mix.lock and assets/package-lock.json."
(when (file-exists? "plugins")
(copy-recursively "plugins"
(string-append out "/plugins")
#:follow-symlinks? #t))))))
#:follow-symlinks? #t))
(let ((tribes-ui-ebin "_build/prod/lib/tribes_ui/ebin")
(tribes-ui-out (string-append out "/plugins/tribes_ui/ebin")))
(when (file-exists? tribes-ui-ebin)
(when (file-exists? tribes-ui-out)
(delete-file-recursively tribes-ui-out))
(mkdir-p (dirname tribes-ui-out))
(copy-recursively tribes-ui-ebin
tribes-ui-out
#:follow-symlinks? #t)))))))
(define* (local-tribes-package directory
#:key
+16 -1
View File
@@ -1,16 +1,19 @@
(define-module (tribes plugins registry)
#:use-module (tribes packages plugins)
#:use-module (tribes plugins aether)
#:use-module (tribes plugins sender)
#:use-module (tribes plugins supertest)
#:use-module (srfi srfi-1)
#:export (guix-tribes-plugin-catalog
guix-tribes-plugin-definition-by-name
guix-tribes-plugin-definitions
guix-tribes-external-plugins))
guix-tribes-external-plugins
guix-tribes-plugin-substitute-packages))
(define guix-tribes-plugin-definitions
(list
(aether-plugin-definition)
(sender-plugin-definition)
(supertest-plugin-definition)))
(define guix-tribes-plugin-catalog
@@ -20,6 +23,18 @@
(map tribes-plugin-definition-external-plugin
guix-tribes-plugin-definitions))
(define (guix-tribes-plugin-substitute-packages)
"Return packages needed to prebuild channel-owned plugin closures."
(delete-duplicates
(append-map
(lambda (plugin)
(let ((external-plugin
(tribes-plugin-definition-external-plugin plugin)))
(cons (tribes-external-plugin-package external-plugin)
(tribes-external-plugin-extra-packages external-plugin))))
guix-tribes-plugin-definitions)
eq?))
(define (guix-tribes-plugin-definition-by-name name)
(find (lambda (plugin-definition)
(string=? (tribes-plugin-definition-name plugin-definition) name))
+116
View File
@@ -0,0 +1,116 @@
(define-module (tribes plugins sender)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages video)
#:use-module (tribes packages plugins)
#:use-module (tribes packages source)
#:export (sender-package
sender-plugin-definition
sender-external-plugin
local-sender-package))
(define %sender-home-page
"https://git.teralink.net/tribes/tribes-plugin-sender")
(define %sender-source-url
%sender-home-page)
(define %sender-commit
"1f3df4c8ed13ec3d2abdc542d34246b50c397da1")
(define %sender-revision "1")
(define %sender-version
(git-version "0.1.0" %sender-revision %sender-commit))
(define %sender-source-sha256
"1gq4kag3q9iz17j8a4hqg07v9pw2b6lgrbssb0bxkfqk3zl07ckj")
(define %sender-mix-deps-sha256
"0dacj6c9mhxw37ykksjbhmnsqdhrwpkfsbswm68d2wvcwchqazw9")
(define %sender-npm-deps-sha256
"1inziz2028pidg5xag40qqrlpigbvs23jirm41in7d58avlmxmh7")
(define %sender-source
(origin
(method git-fetch)
(uri (git-reference
(url %sender-source-url)
(commit %sender-commit)))
(file-name (git-file-name "tribes-plugin-sender" %sender-version))
(sha256
(base32 %sender-source-sha256))))
(define* (sender-package-from-source source
#:key
(host-source tribes-upstream-source)
(mix-deps-sha256 %sender-mix-deps-sha256)
(asset-deps-sha256 %sender-npm-deps-sha256)
(version %sender-version))
"Build the pinned Sender source as an external Tribes plugin artifact."
(tribes-plugin-package
source
#:host-source host-source
#:mix-deps-sha256 mix-deps-sha256
#:build-assets? #t
#:digest-assets? #t
#:asset-deps-sha256 asset-deps-sha256
#:name "tribes-plugin-sender"
#:version version
#:home-page %sender-home-page
#:synopsis "RTMP ingest and HLS streaming plugin for Tribes"
#:description
"External Tribes plugin artifact for RTMP ingest and HLS streaming,
packaged as a Guix-managed plugin directory."))
(define sender-package
(sender-package-from-source %sender-source))
(define* (local-sender-package directory
#:key
host-source
host-source-directory
(build-assets? #t)
(digest-assets? #t)
(mix-deps-sha256 %sender-mix-deps-sha256)
(asset-deps-sha256 %sender-npm-deps-sha256)
(version "dev"))
"Build a local checkout of tribes-plugin-sender as an external plugin
artifact."
(local-tribes-plugin-package
directory
#:host-source host-source
#:host-source-directory host-source-directory
#:mix-deps-sha256 mix-deps-sha256
#:build-assets? build-assets?
#:digest-assets? digest-assets?
#:asset-deps-sha256 asset-deps-sha256
#:name "tribes-plugin-sender"
#:version version
#:home-page %sender-home-page
#:synopsis "RTMP ingest and HLS streaming plugin for Tribes"
#:description
"External Tribes plugin artifact for RTMP ingest and HLS streaming,
packaged as a Guix-managed plugin directory."))
(define* (sender-plugin-definition #:key (package sender-package))
"Return the channel-owned plugin definition for Sender."
(tribes-plugin-definition
(name "sender")
(package-name "tribes-plugin-sender")
(version "0.1.0")
(synopsis "RTMP ingest and HLS streaming plugin for Tribes")
(home-page %sender-home-page)
(provides '("streaming@1"))
(requires '("ecto@1" "ui@1"))
(external-plugin (sender-external-plugin #:package package))))
(define* (sender-external-plugin #:key package)
"Return the channel-owned Guix integration record for the Sender plugin."
(tribes-external-plugin
(name "sender")
(package package)
(extra-packages (list ffmpeg))
(extra-services (lambda (_node-config) '()))))