diff options
46 files changed, 5738 insertions, 1460 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 037ed371d1..f3f3fe2129 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -44746,53 +44746,63 @@ available for each configured user. @cindex OCI-backed, Shepherd services @subsubheading OCI backed services -Should you wish to manage your Docker containers with the same consistent -interface you use for your other Shepherd services, -@var{oci-container-service-type} is the tool to use: given an -@acronym{Open Container Initiative, OCI} container image, it will run it in a +Should you wish to manage your @acronym{Open Container Initiative, OCI} containers +with the same consistent interface you use for your other Shepherd services, +@var{oci-service-type} is the tool to use: given an +OCI container image, it will run it in a Shepherd service. One example where this is useful: it lets you run services -that are available as Docker/OCI images but not yet packaged for Guix. +that are available as OCI images but not yet packaged for Guix. -@defvar oci-container-service-type +@defvar oci-service-type -This is a thin wrapper around Docker's CLI that executes OCI images backed +This is a thin wrapper around Docker's or Podman's CLI that executes OCI images backed processes as Shepherd Services. @lisp -(service oci-container-service-type - (list - (oci-container-configuration - (network "host") - (image - (oci-image - (repository "guile") - (tag "3") - (value (specifications->manifest '("guile"))) - (pack-options '(#:symlinks (("/bin/guile" -> "bin/guile")) - #:max-layers 2)))) - (entrypoint "/bin/guile") - (command - '("-c" "(display \"hello!\n\")"))) - (oci-container-configuration - (image "prom/prometheus") - (ports - '(("9000" . "9000") - ("9090" . "9090")))) - (oci-container-configuration - (image "grafana/grafana:10.0.1") - (network "host") - (volumes - '("/var/lib/grafana:/var/lib/grafana"))))) +(simple-service 'oci-provisioning + oci-service-type + (oci-extension + (networks + (list + (oci-network-configuration (name "monitoring")))) + (containers + (list + (oci-container-configuration + (network "monitoring") + (image + (oci-image + (repository "guile") + (tag "3") + (value (specifications->manifest '("guile"))) + (pack-options '(#:symlinks (("/bin/guile" -> "bin/guile")) + #:max-layers 2)))) + (entrypoint "/bin/guile") + (command + '("-c" "(display \"hello!\n\")"))) + (oci-container-configuration + (image "prom/prometheus") + (network "host") + (ports + '(("9000" . "9000") + ("9090" . "9090")))) + (oci-container-configuration + (image "grafana/grafana:10.0.1") + (network "host") + (volumes + '("/var/lib/grafana:/var/lib/grafana"))))))) @end lisp In this example three different Shepherd services are going to be added to the system. Each @code{oci-container-configuration} record translates to a -@code{docker run} invocation and its fields directly map to options. You can -refer to the -@url{https://docs.docker.com/engine/reference/commandline/run,upstream} -documentation for the semantics of each value. If the images are not found, -they will be -@url{https://docs.docker.com/engine/reference/commandline/pull/,pulled}. The +@samp{docker run} or @samp{podman run} invocation and its fields directly +map to options. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html,Podman} +upstream documentation for semantics of each value. If the images are not found, +they will be pulled. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/pull/,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-pull.1.html,Podman} +upstream documentation for semantics. The services with @code{(network "host")} are going to be attached to the host network and are supposed to behave like native processes with regard to networking. @@ -44801,6 +44811,99 @@ networking. @c %start of fragment +@deftp {Data Type} oci-configuration +Available @code{oci-configuration} fields are: + +@table @asis +@item @code{runtime} (default: @code{'docker}) (type: symbol) +The OCI runtime to use to run commands. It can be either @code{'docker} or +@code{'podman}. + +@item @code{runtime-cli} (type: maybe-package-or-string) +The OCI runtime command line to be installed in the system profile and used +to provision OCI resources, it can be either a package or a string representing +an absolute file name to the runtime binary entrypoint. When unset it will default +to @code{docker-cli} package for the @code{'docker} runtime or to @code{podman} +package for the @code{'podman} runtime. + +@item @code{runtime-extra-arguments} (default: @code{'()}) (type: list) +A list of strings, gexps or file-like objects that will be placed +after each @command{docker} or @command{podman} invokation. + +@item @code{user} (type: maybe-string) +The user name under whose authority OCI commands will be run. This field will +override the @code{user} field of @code{oci-configuration}. + +@item @code{group} (type: maybe-string) +The group name under whose authority OCI commands will be run. When +using the @code{'podman} OCI runtime, this field will be ignored and the +default group of the user configured in the @code{user} field will be used. +This field will override the @code{group} field of @code{oci-configuration}. + +@item @code{subuids-range} (type: maybe-subid-range) +An optional @code{subid-range} record allocating subuids for the user from +the @code{user} field. When unset, with the rootless Podman OCI runtime, it +defaults to @code{(subid-range (name "oci-container"))}. + +@item @code{subgids-range} (type: maybe-subid-range) +An optional @code{subid-range} record allocating subgids for the user from +the @code{user} field. When unset, with the rootless Podman OCI runtime, it +defaults to @code{(subid-range (name "oci-container"))}. + +@item @code{containers} (default: @code{'()}) (type: list-of-oci-containers) +The list of @code{oci-container-configuration} records representing the +containers to provision. The use of the @code{oci-extension} record should +be preferred for most cases. + +@item @code{networks} (default: @code{'()}) (type: list-of-oci-networks) +The list of @code{oci-network-configuration} records representing the +containers to provision. The use of the @code{oci-extension} record should +be preferred for most cases. + +@item @code{volumes} (default: @code{'()}) (type: list-of-oci-volumes) +The list of @code{oci-volumes-configuration} records representing the +containers to provision. The use of the @code{oci-extension} record should +be preferred for most cases. + +@item @code{verbose?} (default: @code{#f}) (type: boolean) +When true, additional output will be printed, allowing to better follow the +flow of execution. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} oci-extension +Available @code{oci-extension} fields are: + +@table @asis +@item @code{containers} (default: @code{'()}) (type: list-of-oci-containers) +The list of @code{oci-container-configuration} records representing the +containers to provision. + +@item @code{networks} (default: @code{'()}) (type: list-of-oci-networks) +The list of @code{oci-network-configuration} records representing the +containers to provision. + +@item @code{volumes} (default: @code{'()}) (type: list-of-oci-volumes) +The list of @code{oci-volumes-configuration} records representing the +containers to provision. + +@end table + +@end deftp + + +@c %end of fragment + + +@c %start of fragment + @deftp {Data Type} oci-container-configuration Available @code{oci-container-configuration} fields are: @@ -44818,16 +44921,16 @@ Overwrite the default command (@code{CMD}) of the image. Overwrite the default entrypoint (@code{ENTRYPOINT}) of the image. @item @code{host-environment} (default: @code{'()}) (type: list) -Set environment variables in the host environment where @command{docker -run} is invoked. This is especially useful to pass secrets from the -host to the container without having them on the @command{docker run}'s -command line: by setting the @code{MYSQL_PASSWORD} on the host and by passing +Set environment variables in the host environment where @samp{docker run} +or @samp{podman run} are invoked. This is especially useful to pass secrets +from the host to the container without having them on the OCI runtime command line, +for example: by setting the @code{MYSQL_PASSWORD} on the host and by passing @code{--env MYSQL_PASSWORD} through the @code{extra-arguments} field, it is possible to securely set values in the container environment. This field's value can be a list of pairs or strings, even mixed: @lisp -(list '("LANGUAGE\" . "eo:ca:eu") +(list '("LANGUAGE" . "eo:ca:eu") "JAVA_HOME=/opt/java") @end lisp @@ -44835,22 +44938,24 @@ Pair members can be strings, gexps or file-like objects. Strings are passed directly to @code{make-forkexec-constructor}. @item @code{environment} (default: @code{'()}) (type: list) -Set environment variables. This can be a list of pairs or strings, even mixed: +Set environment variables inside the container. This can be a list of pairs +or strings, even mixed: @lisp (list '("LANGUAGE" . "eo:ca:eu") "JAVA_HOME=/opt/java") @end lisp -Pair members can be strings, gexps or file-like objects. -Strings are passed directly to the Docker CLI. You can refer to the -@uref{https://docs.docker.com/engine/reference/commandline/run/#env,upstream} -documentation for semantics. +Pair members can be strings, gexps or file-like objects. Strings are passed +directly to the OCI runtime CLI. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run/#env,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#env-e-env,Podman} +upstream documentation for semantics. @item @code{image} (type: string-or-oci-image) The image used to build the container. It can be a string or an -@code{oci-image} record. Strings are resolved by the Docker Engine, and -follow the usual format +@code{oci-image} record. Strings are resolved by the OCI runtime, +and follow the usual format @code{myregistry.local:5000/testing/test-image:tag}. @item @code{provision} (default: @code{""}) (type: string) @@ -44878,7 +44983,7 @@ This is a list of @code{shepherd-action} records defining actions supported by the service. @item @code{network} (default: @code{""}) (type: string) -Set a Docker network for the spawned container. +Set an OCI network for the spawned container. @item @code{ports} (default: @code{'()}) (type: list) Set the port or port ranges to expose from the spawned container. This can be a @@ -44889,10 +44994,11 @@ list of pairs or strings, even mixed: "10443:443") @end lisp -Pair members can be strings, gexps or file-like objects. -Strings are passed directly to the Docker CLI. You can refer to the -@uref{https://docs.docker.com/engine/reference/commandline/run/#publish,upstream} -documentation for semantics. +Pair members can be strings, gexps or file-like objects. Strings are passed +directly to the OCI runtime CLI. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run/#publish,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#publish-p-ip-hostport-containerport-protocol,Podman} +upstream documentation for semantics. @item @code{volumes} (default: @code{'()}) (type: list) Set volume mappings for the spawned container. This can be a @@ -44903,25 +45009,97 @@ list of pairs or strings, even mixed: "/gnu/store:/gnu/store") @end lisp -Pair members can be strings, gexps or file-like objects. -Strings are passed directly to the Docker CLI. You can refer to the -@uref{https://docs.docker.com/engine/reference/commandline/run/#volume,upstream} -documentation for semantics. +Pair members can be strings, gexps or file-like objects. Strings are passed +directly to the OCI runtime CLI. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run/#volume,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#volume-v-source-volume-host-dir-container-dir-options,Podman} +upstream documentation for semantics. @item @code{container-user} (default: @code{""}) (type: string) Set the current user inside the spawned container. You can refer to the -@url{https://docs.docker.com/engine/reference/run/#user,upstream} -documentation for semantics. +@url{https://docs.docker.com/engine/reference/run/#user,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#user-u-user-group,Podman} +upstream documentation for semantics. @item @code{workdir} (default: @code{""}) (type: string) Set the current working directory for the spawned Shepherd service. You can refer to the -@url{https://docs.docker.com/engine/reference/run/#workdir,upstream} -documentation for semantics. +@url{https://docs.docker.com/engine/reference/run/#workdir,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#workdir-w-dir,Podman} +upstream documentation for semantics. + +@item @code{extra-arguments} (default: @code{'()}) (type: list) +A list of strings, gexps or file-like objects that will be directly passed +to the @samp{docker run} or @samp{podman run} invokation. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} oci-network-configuration +Available @code{oci-network-configuration} fields are: + +@table @asis +@item @code{name} (type: string) +The name of the OCI network to provision. + +@item @code{driver} (type: maybe-string) +The driver to manage the network. + +@item @code{gateway} (type: maybe-string) +IPv4 or IPv6 gateway for the subnet. + +@item @code{internal?} (default: @code{#f}) (type: boolean) +Restrict external access to the network + +@item @code{ip-range} (type: maybe-string) +Allocate container ip from a sub-range in CIDR format. + +@item @code{ipam-driver} (type: maybe-string) +IP Address Management Driver. + +@item @code{ipv6?} (default: @code{#f}) (type: boolean) +Enable IPv6 networking. + +@item @code{subnet} (type: maybe-string) +Subnet in CIDR format that represents a network segment. + +@item @code{labels} (default: @code{'()}) (type: list) +The list of labels that will be used to tag the current volume. + +@item @code{extra-arguments} (default: @code{'()}) (type: list) +A list of strings, gexps or file-like objects that will be directly passed +to the @samp{docker network create} or @samp{podman network create} +invokation. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} oci-volume-configuration +Available @code{oci-volume-configuration} fields are: + +@table @asis +@item @code{name} (type: string) +The name of the OCI volume to provision. + +@item @code{labels} (default: @code{'()}) (type: list) +The list of labels that will be used to tag the current volume. @item @code{extra-arguments} (default: @code{'()}) (type: list) -A list of strings, gexps or file-like objects that will be directly -passed to the @command{docker run} invocation. +A list of strings, gexps or file-like objects that will be directly passed +to the @samp{docker volume create} or @samp{podman volume create} +invokation. @end table @@ -52824,6 +53002,120 @@ For details about @code{readymedia-configuration}, check out the documentation of the system service (@pxref{Miscellaneous Services, @code{readymedia-service-type}}). +@subsubheading OCI backed services + +@cindex OCI-backed, for Home +The @code{(gnu home services containers)} module provides the following service: + +@defvar home-oci-service-type +This is the type of the service that allows to manage your OCI containers with +the same consistent interface you use for your other Home Shepherd services. +@end defvar + +This service is a direct mapping of the @code{oci-service-type} system +service (@pxref{Miscellaneous Services, OCI backed services}). You can +use it like this: + +@lisp +(use-modules (gnu services containers) + (gnu home services containers)) + +(simple-service 'home-oci-provisioning + home-oci-service-type + (oci-extension + (volumes + (list + (oci-volume-configuration (name "prometheus")) + (oci-volume-configuration (name "grafana")))) + (networks + (list + (oci-network-configuration (name "monitoring")))) + (containers + (list + (oci-container-configuration + (network "monitoring") + (image + (oci-image + (repository "guile") + (tag "3") + (value (specifications->manifest '("guile"))) + (pack-options '(#:symlinks (("/bin/guile" -> "bin/guile")) + #:max-layers 2)))) + (entrypoint "/bin/guile") + (command + '("-c" "(display \"hello!\n\")"))) + (oci-container-configuration + (image "prom/prometheus") + (network "monitoring") + (ports + '(("9000" . "9000") + ("9090" . "9090"))) + (volumes + (list + '(("prometheus" . "/var/lib/prometheus"))))) + (oci-container-configuration + (image "grafana/grafana:10.0.1") + (network "monitoring") + (volumes + '(("grafana:/var/lib/grafana")))))))) + +@end lisp + +You may specify a custom configuration by providing a +@code{oci-configuration} record, exactly like for +@code{oci-service-type}, but wrapping it in @code{for-home}: + +@lisp +(use-modules (gnu services) + (gnu services containers) + (gnu home services containers)) + +(service home-oci-service-type + (for-home + (oci-configuration + (runtime 'podman) + (verbose? #t)))) + +(simple-service 'home-oci-provisioning + home-oci-service-type + (oci-extension + (volumes + (list + (oci-volume-configuration (name "prometheus")) + (oci-volume-configuration (name "grafana")))) + (networks + (list + (oci-network-configuration (name "monitoring")))) + (containers + (list + (oci-container-configuration + (network "monitoring") + (image + (oci-image + (repository "guile") + (tag "3") + (value (specifications->manifest '("guile"))) + (pack-options '(#:symlinks (("/bin/guile" -> "bin/guile")) + #:max-layers 2)))) + (entrypoint "/bin/guile") + (command + '("-c" "(display \"hello!\n\")"))) + (oci-container-configuration + (image "prom/prometheus") + (network "monitoring") + (ports + '(("9000" . "9000") + ("9090" . "9090"))) + (volumes + (list + '(("prometheus" . "/var/lib/prometheus"))))) + (oci-container-configuration + (image "grafana/grafana:10.0.1") + (network "monitoring") + (volumes + '(("grafana:/var/lib/grafana")))))))) +@end lisp + @node Invoking guix home @section Invoking @command{guix home} diff --git a/gnu/build/oci-containers.scm b/gnu/build/oci-containers.scm new file mode 100644 index 0000000000..38704e9e4a --- /dev/null +++ b/gnu/build/oci-containers.scm @@ -0,0 +1,210 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2025 Giacomo Leidi <goodoldpaul@autistici.org> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: +;;; +;;; This module contains helpers used as part of the oci-service-type +;;; definition. +;;; +;;; Code: + +(define-module (gnu build oci-containers) + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (ice-9 popen) + #:use-module (ice-9 rdelim) + #:use-module (ice-9 textual-ports) + #:use-module (srfi srfi-1) + #:export (oci-read-lines + oci-system* + oci-object-exists? + oci-object-service-available? + oci-image-load + oci-log-verbose + oci-container-execlp + oci-object-create)) + +(define* (oci-read-lines invocation #:key verbose?) + (define (get-lines port) + (let ((lines-string (get-string-all port))) + (string-split lines-string #\newline))) + + (define command + (string-join invocation " ")) + + (when verbose? (format #t "Running ~a~%" command)) + + (with-input-from-port (open-input-pipe command) + (lambda _ + (get-lines (current-input-port))))) + +(define* (oci-log-verbose invocation) + (format #t "Running in verbose mode... +Current user: ~a ~a +Current group: ~a ~a +Current directory: ~a~%" + (getuid) (passwd:name (getpwuid (getuid))) + (getgid) (group:name (getgrgid (getgid))) + (getcwd)) + + (format #t "Running~{ ~a~}~%" invocation)) + +(define* (oci-system* invocation #:key verbose?) + (when verbose? + (format #t "Running~{ ~a~}~%" invocation)) + + (let* ((status (apply system* invocation)) + (exit-code (status:exit-val status))) + (when verbose? + (format #t "Exit code: ~a~%" exit-code)) + status)) + +(define* (oci-object-member name objects + #:key verbose?) + + (define member? (member name objects)) + + (when (and verbose? (> (length objects) 0)) + (format #t "~a is ~apart of:~{ ~a~}~%" + name + (if member? "" "not ") + objects)) + member?) + +(define* (oci-object-list runtime-cli object + #:key verbose? + (format-string "{{.Name}}")) + + (define invocation + (list runtime-cli object "ls" "--format" + (string-append "\"" format-string "\""))) + + (filter + (lambda (name) + (not (string=? (string-trim name) ""))) + (oci-read-lines invocation #:verbose? verbose?))) + +(define* (docker-object-exist? runtime-cli object name + #:key verbose? + (format-string "{{.Name}}")) + + (define objects + (oci-object-list runtime-cli object + #:verbose? verbose? + #:format-string format-string)) + + (oci-object-member name objects #:verbose? verbose?)) + +(define* (podman-object-exist? runtime-cli object name #:key verbose?) + (let ((invocation (list runtime-cli object "exists" name))) + (define exit-code + (status:exit-val (oci-system* invocation #:verbose? verbose?))) + (equal? EXIT_SUCCESS exit-code))) + +(define* (oci-object-exists? runtime runtime-cli object name + #:key verbose? + (format-string "{{.Name}}")) + (if (eq? runtime 'podman) + (podman-object-exist? runtime-cli object name + #:verbose? verbose?) + (docker-object-exist? runtime-cli object name + #:verbose? verbose? + #:format-string format-string))) + +(define* (oci-object-service-available? runtime-cli object names + #:key verbose? + (format-string "{{.Name}}")) + "Whether NAMES are provisioned in the current OBJECT environment." + (define environment + (oci-object-list runtime-cli object + #:verbose? verbose? + #:format-string format-string)) + (when verbose? + (format #t "~a environment:~{ ~a~}~%" object environment)) + + (define available? + (every + (lambda (name) + (oci-object-member name environment #:verbose? verbose?)) + names)) + + (when verbose? + (format #t "~a service is~a available~%" object (if available? "" " not"))) + + available?) + +(define* (oci-image-load runtime runtime-cli tarball name tag + #:key verbose? + (format-string "{{.Repository}}:{{.Tag}}")) + (define load-invocation + (list runtime-cli "load" "-i" tarball)) + + (if (oci-object-exists? runtime runtime-cli "image" tag + #:verbose? verbose? + #:format-string format-string) + (format #t "~a image already exists, skipping.~%" tag) + (begin + (format #t "Loading image for ~a from ~a...~%" name tarball) + + (let ((line (first + (oci-read-lines load-invocation #:verbose? verbose?)))) + (unless (or (eof-object? line) + (string-null? line)) + + (format #t "~a~%" line) + + (let* ((repository&tag + (string-drop line + (string-length + "Loaded image: "))) + (tag-invocation + (list runtime-cli "tag" repository&tag tag)) + (drop-old-tag-invocation + (list runtime-cli "image" "rm" "-f" repository&tag))) + + (unless (string=? repository&tag tag) + (let ((exit-code + (status:exit-val + (oci-system* tag-invocation #:verbose? verbose?)))) + (format #t "Tagged ~a with ~a...~%" tarball tag) + + (when (equal? EXIT_SUCCESS exit-code) + (oci-system* drop-old-tag-invocation #:verbose? verbose?)))))))))) + +(define* (oci-container-execlp invocation #:key verbose? pre-script) + (when pre-script + (pre-script)) + (when verbose? + (oci-log-verbose invocation)) + (apply execlp (first invocation) invocation)) + +(define* (oci-object-create runtime runtime-cli runtime-name + object + invocations + #:key verbose? + (format-string "{{.Name}}")) + (for-each + (lambda (invocation) + (define name (last invocation)) + (if (oci-object-exists? runtime runtime-cli object name + #:format-string format-string + #:verbose? verbose?) + (format #t "~a ~a ~a already exists, skipping creation.~%" + runtime-name name object) + (oci-system* invocation #:verbose? verbose?))) + invocations)) diff --git a/gnu/home/services/containers.scm b/gnu/home/services/containers.scm new file mode 100644 index 0000000000..1ccdb3b246 --- /dev/null +++ b/gnu/home/services/containers.scm @@ -0,0 +1,49 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2025 Giacomo Leidi <goodoldpaul@autistici.org> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu home services containers) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu services containers) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (srfi srfi-1) + #:export (home-oci-service-type)) + +(define home-oci-service-type + (service-type + (inherit (system->home-service-type oci-service-type)) + (extensions + (list + (service-extension home-profile-service-type + (lambda (config) + (let ((runtime-cli + (oci-configuration-runtime-cli config)) + (runtime + (oci-configuration-runtime config))) + (oci-service-profile runtime runtime-cli)))) + (service-extension home-shepherd-service-type + oci-configuration->shepherd-services))) + (extend + (lambda (config extension) + (for-home + (oci-configuration + (inherit (oci-configuration-extend config extension)))))) + (default-value (for-home (oci-configuration))))) diff --git a/gnu/local.mk b/gnu/local.mk index 0bc9365199..1814c7da68 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -105,6 +105,7 @@ GNU_SYSTEM_MODULES = \ %D%/home/services.scm \ %D%/home/services/admin.scm \ %D%/home/services/backup.scm \ + %D%/home/services/containers.scm \ %D%/home/services/desktop.scm \ %D%/home/services/dict.scm \ %D%/home/services/dotfiles.scm \ @@ -239,7 +240,6 @@ GNU_SYSTEM_MODULES = \ %D%/packages/dezyne.scm \ %D%/packages/decker.scm \ %D%/packages/dhall.scm \ - %D%/packages/dico.scm \ %D%/packages/dictd.scm \ %D%/packages/dotnet.scm \ %D%/packages/dictionaries.scm \ @@ -837,6 +837,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/linux-initrd.scm \ %D%/build/linux-modules.scm \ %D%/build/marionette.scm \ + %D%/build/oci-containers.scm \ %D%/build/secret-service.scm \ \ %D%/tests.scm \ @@ -1619,7 +1620,8 @@ dist_patch_DATA = \ %D%/packages/patches/insight-toolkit-fix-build.patch \ %D%/packages/patches/irrlicht-use-system-libs.patch \ %D%/packages/patches/irrlicht-link-against-needed-libs.patch \ - %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ + %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ + %D%/packages/patches/ispell-for-linphone-cmake.patch \ %D%/packages/patches/jamesdsp-fix-bulid-on-pipewire-1.4.0.patch\ %D%/packages/patches/jami-disable-webengine.patch \ %D%/packages/patches/jami-enable-testing.patch \ @@ -1768,6 +1770,7 @@ dist_patch_DATA = \ %D%/packages/patches/libmpeg2-global-symbol-test.patch \ %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch \ %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch \ + %D%/packages/patches/liblinphone-jsoncpp.patch \ %D%/packages/patches/libphonenumber-reproducible-build.patch \ %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch \ %D%/packages/patches/libquicktime-ffmpeg.patch \ @@ -1803,7 +1806,8 @@ dist_patch_DATA = \ %D%/packages/patches/lierolibre-remove-arch-warning.patch \ %D%/packages/patches/lierolibre-try-building-other-arch.patch \ %D%/packages/patches/libcdio-glibc-compat.patch \ - %D%/packages/patches/linphone-desktop-without-sdk.patch \ + %D%/packages/patches/linphone-desktop-ispell.patch \ + %D%/packages/patches/linphone-desktop-qtkeychain.patch \ %D%/packages/patches/linux-libre-infodocs-target.patch \ %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \ %D%/packages/patches/linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch \ @@ -1858,6 +1862,7 @@ dist_patch_DATA = \ %D%/packages/patches/lvm2-no-systemd.patch \ %D%/packages/patches/maturin-no-cross-compile.patch \ %D%/packages/patches/mecab-variable-param.patch \ + %D%/packages/patches/mediastreamer2-cmake-findgsm.patch \ %D%/packages/patches/mediasdk-gcc-14.patch \ %D%/packages/patches/memtest86+-build-reproducibly.patch \ %D%/packages/patches/mercurial-hg-extension-path.patch \ @@ -1899,6 +1904,8 @@ dist_patch_DATA = \ %D%/packages/patches/mosaicatcher-unbundle-htslib.patch \ %D%/packages/patches/mrrescue-support-love-11.patch \ %D%/packages/patches/mrustc-patches.patch \ + %D%/packages/patches/mswebrtc-b64-refactor.patch \ + %D%/packages/patches/mswebrtc-cmake.patch \ %D%/packages/patches/mtools-mformat-uninitialized.patch \ %D%/packages/patches/mupen64plus-ui-console-notice.patch \ %D%/packages/patches/musescore-fix-build.patch \ @@ -1939,7 +1946,6 @@ dist_patch_DATA = \ %D%/packages/patches/nvi-assume-preserve-path.patch \ %D%/packages/patches/nvi-dbpagesize-binpower.patch \ %D%/packages/patches/nvi-db4.patch \ - %D%/packages/patches/nyacc-binary-literals.patch \ %D%/packages/patches/obs-modules-location.patch \ %D%/packages/patches/ocaml-ctypes-test-oo.patch \ %D%/packages/patches/ocaml-multiple-definitions.patch \ @@ -2072,6 +2078,7 @@ dist_patch_DATA = \ %D%/packages/patches/sdl-pango-matrix_declarations.patch \ %D%/packages/patches/sdl-pango-sans-serif.patch \ %D%/packages/patches/smalltalk-multiplication-overflow.patch \ + %D%/packages/patches/soci-mysql-ddl-types.patch \ %D%/packages/patches/sqlite-hurd.patch \ %D%/packages/patches/strace-readlink-tests.patch \ %D%/packages/patches/sunxi-tools-remove-sys-io.patch \ diff --git a/gnu/packages/aidc.scm b/gnu/packages/aidc.scm index d8aa9ab2f9..5d1ead9bcc 100644 --- a/gnu/packages/aidc.scm +++ b/gnu/packages/aidc.scm @@ -122,29 +122,6 @@ integration of this capability into your own programs.") (home-page "https://github.com/zxing-cpp/zxing-cpp") (license license:asl2.0))) -;;; This older variant is kept for kaidan, liblinphone and yosys-clang. -(define-public zxing-cpp-1.2a - ;; Use the master branch as it includes unreleased build system improvements - ;; allowing to use system libraries (instead of attempting to fetch them - ;; from the Internet). - (let ((revision "0") - (commit "00783db7aa3bcf8620a301854ac71c0ceaaca0c1")) - (package/inherit zxing-cpp - (name "zxing-cpp") - (version (git-version "1.2.0" revision commit)) - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/zxing-cpp/zxing-cpp") - (commit commit))) - (patches (search-patches "zxing-cpp-1.2.0-gcc-14.patch")) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1yl2cpaqiv1g4nq9v0xfj1vd5faz55k4541vz6hsffvcxgn9nmc5")))) - (arguments '(#:configure-flags '())) - (native-inputs (list fmt-8 googletest))))) - ;;; This older variant is kept for gst-plugins-bad (see: ;;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1684). (define-public zxing-cpp-1.2 diff --git a/gnu/packages/aspell.scm b/gnu/packages/aspell.scm index ffb13025f3..8c192b1604 100644 --- a/gnu/packages/aspell.scm +++ b/gnu/packages/aspell.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2021 Sergiu Ivanov <sivanov@colimite.fr> ;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream> ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,9 @@ (define-module (gnu packages aspell) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix licenses) #:use-module (guix utils) @@ -438,3 +442,43 @@ dictionaries, including personal ones.") European languages.") (home-page "https://www.cs.hmc.edu/~geoff/ispell.html") (license bsd-3))) + +;;; This is basically ispell but built with CMake, and which provides a CMake +;;; config file. +(define-public ispell-for-linphone + (let ((commit "05574fe160222c3d0b6283c1433c9b087271fad1") + (revision "0")) + (package + (inherit ispell) + (name "ispell-for-linphone") + ;; The version is captured in the ISPELL_VERSION variable in the + ;; CMakeLists.txt file at the root of the project. + (version (git-version "3.4.05" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.linphone.org/BC/public/external/ispell") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0shwbms6y0i18n2qnvjlbwfmzk5rydlp7wbf4dl1rn74r244p132")) + (patches (search-patches "ispell-for-linphone-cmake.patch")))) + (build-system cmake-build-system) + (arguments + (substitute-keyword-arguments (package-arguments ispell) + ((#:modules _ ''()) + '((guix build cmake-build-system) + (guix build utils) + (srfi srfi-26))) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-before 'configure 'really-configure + (assoc-ref %standard-phases 'configure)) + (add-after 'configure 'install-headers + (lambda _ + (let ((include-dir (string-append #$output "/include/ISpell"))) + (with-directory-excursion "../source" + (for-each (cut install-file <> include-dir) + '("config.h" "defhash.h" "ispell.h" + "libispell.h" "local.h"))))))))))))) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 066621037e..e01d0def8f 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -11,7 +11,7 @@ ;;; Copyright © 2016–2023 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018, 2020, 2024 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2018 okapi <okapi@firemail.cc> -;;; Copyright © 2018, 2020, 2022-2025 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2018, 2020, 2022-2025 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2018 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2018, 2019, 2022 Marius Bakke <marius@gnu.org> @@ -1922,7 +1922,7 @@ synthesis.") (define-public snapcast (package (name "snapcast") - (version "0.29.0") + (version "0.32.3") (source (origin (method git-fetch) (uri (git-reference @@ -1931,21 +1931,21 @@ synthesis.") (file-name (git-file-name name version)) (sha256 (base32 - "1960xp54vsndj9vvc03kx9kg9phdchdgrfghhvcp2b0nfq2qcqqm")))) + "06hllji1621f29g6ymbysi1vkndjsrwj63f5ph30f6kvv3c8sqx4")))) (build-system cmake-build-system) - (arguments - '(#:tests? #f)) ; no included tests + (arguments '(#:tests? #f)) ;no included tests (inputs - (list boost - libvorbis - soxr - alsa-lib + (list alsa-lib avahi - pulseaudio + boost + expat flac - opus)) - (native-inputs - (list pkg-config)) + libvorbis + openssl + opus + pulseaudio + soxr)) + (native-inputs (list pkg-config)) (home-page "https://github.com/badaix/snapcast") (synopsis "Synchronous multiroom audio player") (description @@ -6479,16 +6479,16 @@ workstations as well as consumer software such as music players.") (define-public redkite (package (name "redkite") - (version "1.3.1") ;marked unmaintained as of Oct. 2021 + (version "2.1.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/free-sm/redkite") + (url "https://github.com/quamplex/redkite") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1zb2k2a4m7z2ravqrjn8fq8lic20wbr2m8kja3p3113jsk7j9zvd")))) + (base32 "1xn7vnv7zszy0f1ynxd7qn0131w0gmk3rp3my4xjh143dhck4q4b")))) (build-system cmake-build-system) (arguments `(#:tests? #f)) ;no tests included @@ -6496,13 +6496,13 @@ workstations as well as consumer software such as music players.") (list cairo)) (native-inputs (list pkg-config)) - (synopsis "Small GUI toolkit") + (synopsis "Lightweight graphics widget toolkit for embedded GUI") (description "Redkite is a small GUI toolkit developed in C++17 and inspired from other well known GUI toolkits such as Qt and GTK. It is minimal on purpose and is intended to be statically linked to applications, therefore satisfying any requirements they may have to be self contained, as is the case with audio plugins.") - (home-page "https://gitlab.com/geontime/redkite") + (home-page "https://github.com/quamplex/redkite") (license license:gpl3+))) (define-public carla diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index c20722245f..6f705e760c 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -233,7 +233,7 @@ This can give a much better understanding of the command's performance.") (define-public benchmark (package (name "benchmark") - (version "1.5.6") + (version "1.9.4") (source (origin (method git-fetch) (uri (git-reference @@ -242,7 +242,7 @@ This can give a much better understanding of the command's performance.") (file-name (git-file-name name version)) (sha256 (base32 - "030g4d8vpn2442dsap0qw86lsw7xfl36k0x0x9bn0vvm11qvjn8c")))) + "05b5sf0dmgr5s9dbvasg8rndh754kkc4chni6ynqa1h8m5q0kg1z")))) (build-system cmake-build-system) (native-inputs `(("googletest-source" ,(package-source googletest)) diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 934466f951..5fc5d385d0 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -328,7 +328,7 @@ with the @uref{https://keepassxc.org, KeePassXC} password manager.") (define noscript (package (name "noscript") - (version "13.0.8") + (version "13.0.9") (source (origin (method url-fetch/zipbomb) (uri (string-append @@ -336,7 +336,7 @@ with the @uref{https://keepassxc.org, KeePassXC} password manager.") ".xpi")) (sha256 (base32 - "1p6jrz22jjzcqlbza2v8nix2sx9xjgl43vmm43hwrf9w13z8r5wx")))) + "1xbisx3xqak9aj7nb2lh94an6yfldsl6a2g2qc87vxi1zwdbcnjj")))) (build-system copy-build-system) (properties '((addon-id . "{73a6fe31-595d-460b-a920-fcc0f8843232}"))) (arguments diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index e060795da9..a12dcb9d91 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2041,8 +2041,10 @@ other values of screen objects, by setting their values as the tween starting point and then, after each tween step, plugging back the result.") (license license:expat))) -;;; This older LTS release is kept for tensorflow. (define-public abseil-cpp-20200923.3 + ;; "guix refresh -l" shows no dependents of this package, but by input + ;; rewriting, grpc-1.16.1 depends on it; + ;; in turn this is an input to hyperledger-iroha and tensorflow. (package (name "abseil-cpp") (version "20200923.3") diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm index e85017ee2d..2459f2695f 100644 --- a/gnu/packages/crypto.scm +++ b/gnu/packages/crypto.scm @@ -23,7 +23,7 @@ ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> ;;; Copyright © 2021, 2022 Brendan Tildesley <mail@brendan.scot> ;;; Copyright © 2022 Allan Adair <allan@adair.no> -;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2022, 2024-2025 Maxim Cournoyer <maxim@guixoic.coop> ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net> ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com> @@ -137,55 +137,59 @@ fast, secure, parallelizable, capable of incremental updates.") (license (list license:asl2.0 license:cc0)))) ; dual licensed (define-public libdecaf - (package - (name "libdecaf") - (version "1.0.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "git://git.code.sf.net/p/ed448goldilocks/code") - (commit - (string-append "v" version)))) - (file-name - (git-file-name name version)) - (sha256 - (base32 "1ajgmyvc6a4m1h2hg1g4wz7ibx10x1xys9m6ancnmmf1f2srlfly")))) - (build-system cmake-build-system) - (outputs '("out" "python" "doc")) - (arguments - `(#:configure-flags '("-DENABLE_STATIC=OFF") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-python-binding - (lambda _ - (substitute* "python/setup.py" - (("gmake") - "make") - (("'\\.\\.', 'build', 'lib', 'libdecaf\\.so'") - "'..', '..', 'build', 'src', 'libdecaf.so'")))) - (add-after 'install 'install-python-binding - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion "../source/python" - (invoke "python" "setup.py" "install" - (string-append "--prefix=" (assoc-ref outputs "python")) - "--root=/")))) - (add-after 'install-python-binding 'install-documentation - (lambda* (#:key outputs #:allow-other-keys) - (invoke "make" "doc") - (let* ((doc (assoc-ref outputs "doc")) - (dest (string-append doc "/share/doc"))) - (copy-recursively "doc" dest))))))) - (native-inputs - `(("dot" ,graphviz) - ("doxygen" ,doxygen) - ("python" ,python-wrapper))) - (synopsis "Decaf Elliptic Curve Library") - (description "The libdecaf library is an implementation of elliptic curve + ;; The 1.0.2 release fails due to some compiler warning treated as an error + ;; (see: https://sourceforge.net/p/ed448goldilocks/tickets/16/). Use the + ;; latest commit available. + (let ((commit "e5cc6240690d3ffdfcbdb1e4e851954b789cd5d9") + (revision "0")) + (package + (name "libdecaf") + (version (git-version "1.0.2" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "git://git.code.sf.net/p/ed448goldilocks/code") + (commit commit))) + (file-name + (git-file-name name version)) + (sha256 + (base32 + "1gxf503cnmgsv7s0dm82rrizjhifdhdh42sfvbfsdj55syjnv1p2")))) + (build-system cmake-build-system) + (outputs '("out" "python" "doc")) + (arguments + (list #:imported-modules (append %cmake-build-system-modules + %python-build-system-modules) + #:modules '((guix build cmake-build-system) + ((guix build python-build-system) #:prefix python:) + (guix build utils)) + #:configure-flags #~(list "-DENABLE_STATIC=OFF") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-python-binding + (lambda _ + (substitute* "python/setup.py" + (("gmake") + "make") + (("'\\.\\.', 'build', 'lib', 'libdecaf\\.so'") + "'..', '..', 'build', 'src', 'libdecaf.so'")))) + (add-after 'unpack 'ensure-no-mtimes-pre-1980 + (assoc-ref python:%standard-phases 'ensure-no-mtimes-pre-1980)) + (add-after 'install 'install-python-binding + (lambda* (#:key inputs outputs #:allow-other-keys) + (with-directory-excursion "../source/python" + (invoke "python" "setup.py" "install" + (string-append + "--prefix=" + (python:site-packages inputs outputs))))))))) + (native-inputs (list python-minimal-wrapper)) + (synopsis "Decaf Elliptic Curve Library") + (description "The libdecaf library is an implementation of elliptic curve cryptography using the Montgomery and Edwards curves Curve25519, Ed25519, Ed448-Goldilocks and Curve448, using the Decaf encoding.") - (home-page "https://ed448goldilocks.sourceforge.net/") - (license (list license:expat ;library - license:bsd-2)))) ;python bindings + (home-page "https://ed448goldilocks.sourceforge.net/") + (license (list license:expat ;library + license:bsd-2))))) ;python bindings (define-public libsodium (package diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 1500fbe145..a8196648f6 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -5803,24 +5803,26 @@ The drivers officially supported by @code{libdbi} are: (file-name (git-file-name name version)) (sha256 (base32 - "12aq7pama96l2c1kmfkclb4bvrsxs9a8ppgk5gmzw45w2lg35i0y")))) + "12aq7pama96l2c1kmfkclb4bvrsxs9a8ppgk5gmzw45w2lg35i0y")) + (patches (search-patches "soci-mysql-ddl-types.patch")))) (build-system cmake-build-system) (propagated-inputs ;; Headers of soci has include-references to headers of these inputs. - `(("firebird" ,firebird) - ("postgresql" ,postgresql) - ("sqlite" ,sqlite) - ("odbc" ,unixodbc) - ("boost" ,boost) - ("mariadb:dev" ,mariadb "dev"))) + (list firebird + postgresql + sqlite + unixodbc + boost + `(,mariadb "dev"))) (arguments - `(#:configure-flags - ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it. - (list "-DCMAKE_CXX_STANDARD=17" - "-DSOCI_LIBDIR=lib" - ;; This is for relocation when linking statically - "-DCMAKE_CXX_FLAGS=-fPIE") - #:tests? #f)) ; may require running database management systems + (list #:configure-flags + ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs + ;; it. + #~(list "-DCMAKE_CXX_STANDARD=17" + "-DSOCI_LIBDIR=lib" + ;; This is for relocation when linking statically + "-DCMAKE_CXX_FLAGS=-fPIE") + #:tests? #f)) ; may require running database management systems (synopsis "C++ Database Access Library") (description "SOCI is an abstraction layer for several database backends, including diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index a0345d8278..96f3298026 100644 --- a/gnu/packages/debug.scm +++ b/gnu/packages/debug.scm @@ -59,6 +59,9 @@ #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages golang) + #:use-module (gnu packages golang-build) + #:use-module (gnu packages golang-web) + #:use-module (gnu packages golang-xyz) #:use-module (gnu packages image) #:use-module (gnu packages lesstif) #:use-module (gnu packages libusb) @@ -1043,7 +1046,7 @@ to aid in debugging.") (define-public delve (package (name "delve") - (version "1.23.1") + (version "1.25.1") (source (origin (method git-fetch) @@ -1053,13 +1056,34 @@ to aid in debugging.") (file-name (git-file-name name version)) (sha256 (base32 - "1k0ink3jjplbq1si7cnrm7ch6jasnc3y83yksmrwhhbfa1ybk87s")))) + "0rfpgh9ijb0lcyrfscxb3k1552wwhqj0jxv5zfyrsfm1n6j8dc93")) + (snippet + #~(begin (use-modules (guix build utils)) + (delete-file-recursively "vendor"))))) (build-system go-build-system) (arguments - (list #:import-path "github.com/go-delve/delve/cmd/dlv" + (list #:tests? #f ;XXX: Some tests fail, check why. + #:import-path "github.com/go-delve/delve/cmd/dlv" #:unpack-path "github.com/go-delve/delve" - #:install-source? #f - #:phases #~(modify-phases %standard-phases (delete 'check)))) + #:install-source? #f)) + (native-inputs + (list go-github-com-cilium-ebpf + go-github-com-cosiner-argv + go-github-com-creack-pty + go-github-com-derekparker-trie + go-github-com-go-delve-liner + go-github-com-google-go-dap + go-github-com-hashicorp-golang-lru + go-github-com-mattn-go-colorable + go-github-com-mattn-go-isatty + go-github-com-spf13-cobra + go-github-com-spf13-pflag + go-go-starlark-net + go-golang-org-x-arch + go-golang-org-x-sys + go-golang-org-x-telemetry + go-golang-org-x-tools + go-gopkg-in-yaml-v3)) (home-page "https://github.com/go-delve/delve") (synopsis "Debugger for the Go programming language") (description "Delve is a debugger for the Go programming language.") diff --git a/gnu/packages/dico.scm b/gnu/packages/dico.scm deleted file mode 100644 index 16cd2ebd83..0000000000 --- a/gnu/packages/dico.scm +++ /dev/null @@ -1,95 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015-2016, 2018, 2024-2025 Ludovic Courtès <ludo@gnu.org> -;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il> -;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> -;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> -;;; Copyright © 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. - -(define-module (gnu packages dico) - #:use-module (guix packages) - #:use-module ((guix licenses) #:select (gpl3+)) - #:use-module (guix download) - #:use-module (guix build-system gnu) - #:use-module (gnu packages) - #:use-module (gnu packages bash) - #:use-module (gnu packages crypto) - #:use-module (gnu packages readline) - #:use-module (gnu packages m4) - #:use-module (gnu packages groff) - #:use-module (gnu packages guile) - #:use-module (gnu packages python) - #:use-module (gnu packages pcre) - #:use-module (gnu packages gsasl) - #:use-module (gnu packages autotools) - #:use-module (gnu packages compression) - #:use-module (gnu packages wordnet)) - -(define-public dico - (package - (name "dico") - (version "2.12") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/dico/dico-" - version ".tar.xz")) - (sha256 - (base32 - "1xvahrav8aml90qcj4cj3a33y0n7nm1k0ywgks1zy2q91v2qk2vj")))) - (build-system gnu-build-system) - (arguments - '(#:configure-flags (list (string-append "--with-guile-site-dir=" %output - "/share/guile/site/2.0") - "--disable-static") - #:phases (modify-phases %standard-phases - (add-before 'build 'set-shell-file-name - (lambda* (#:key inputs #:allow-other-keys) - ;; This code invokes "/bin/sh -c 'm4 -s ...'". - (substitute* "grecs/src/grecs-lex.c" - (("\"/bin/sh\"") - (string-append "\"" - (search-input-file inputs "/bin/sh") - "\""))))) - (add-before 'check 'silence-guile - (lambda _ - ;; Guile is too talkative, which disturbs the test - ;; infrastructure. Gag it. - (setenv "GUILE_AUTO_COMPILE" "0") - (setenv "GUILE_WARN_DEPRECATED" "no")))))) - (native-inputs (list groff)) - (inputs - (list m4 ;used at run time - bash-minimal ;likewise - pcre - python-wrapper - guile-2.2 - gsasl - readline - zlib - wordnet - libxcrypt ;for 'crypt' - libltdl)) - (home-page "https://www.gnu.org.ua/software/dico/") - (synopsis "Implementation of DICT server (RFC 2229)") - (description - "GNU Dico implements a flexible dictionary server and client according to -RFC 2229 (DICT Server). It is able to access any database available, -regardless of format, thanks to its modular structure. New modules may be -written in C, Guile or Python. Dico also includes a command-line client, -which may be used to query remote dictionary databases.") - (license gpl3+))) diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm index f51ed24111..5e53675ea7 100644 --- a/gnu/packages/dictionaries.scm +++ b/gnu/packages/dictionaries.scm @@ -1,15 +1,19 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014-2016, 2021, 2024 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014-2016, 2018, 2021, 2024, 2025 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016-2018, 2020-2023, 2025 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2017, 2018, 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr> -;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2018, 2019, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr> ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2020 Lu hux <luhux@outlook.com> +;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com> ;;; Copyright © 2022 Runciter <runciter@whispers-vpn.org> +;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> +;;; Copyright © 2025 Zhu Zihao <all_but_last@163.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,27 +45,87 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages compression) + #:use-module (gnu packages crypto) #:use-module (gnu packages curl) + #:use-module (gnu packages dictd) #:use-module (gnu packages emacs) #:use-module (gnu packages flex) #:use-module (gnu packages fribidi) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) + #:use-module (gnu packages groff) + #:use-module (gnu packages gsasl) + #:use-module (gnu packages guile) #:use-module (gnu packages linux) + #:use-module (gnu packages m4) #:use-module (gnu packages ncurses) #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages readline) - #:use-module (gnu packages texinfo) - #:use-module (gnu packages compression) + #:use-module (gnu packages speech) #:use-module (gnu packages tcl) + #:use-module (gnu packages texinfo) #:use-module (gnu packages web) - #:use-module (gnu packages xml) - #:use-module (gnu packages dictd) - #:use-module (gnu packages speech) - #:use-module (gnu packages perl)) + #:use-module (gnu packages wordnet) + #:use-module (gnu packages xml)) +(define-public dico + (package + (name "dico") + (version "2.12") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/dico/dico-" + version ".tar.xz")) + (sha256 + (base32 + "1xvahrav8aml90qcj4cj3a33y0n7nm1k0ywgks1zy2q91v2qk2vj")))) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags #~(list "--disable-static") + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'set-shell-file-name + (lambda* (#:key inputs #:allow-other-keys) + ;; This code invokes "/bin/sh -c 'm4 -s ...'". + (substitute* "grecs/src/grecs-lex.c" + (("\"/bin/sh\"") + (string-append "\"" + (search-input-file inputs "/bin/sh") + "\""))))) + (add-before 'check 'silence-guile + (lambda _ + ;; Guile is too talkative, which disturbs the test + ;; infrastructure. Gag it. + (setenv "GUILE_AUTO_COMPILE" "0") + (setenv "GUILE_WARN_DEPRECATED" "no")))))) + (native-inputs (list groff)) + (inputs + (list m4 ;used at run time + bash-minimal ;likewise + pcre + python-wrapper + guile-3.0 + gsasl + readline + zlib + wordnet + libxcrypt ;for 'crypt' + libltdl)) + (home-page "https://www.gnu.org.ua/software/dico/") + (synopsis "Implementation of DICT server (RFC 2229)") + (description + "GNU Dico implements a flexible dictionary server and client according to +RFC 2229 (DICT Server). It is able to access any database available, +regardless of format, thanks to its modular structure. New modules may be +written in C, Guile or Python. Dico also includes a command-line client, +which may be used to query remote dictionary databases.") + (license license:gpl3+))) (define-public vera (package diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm index 5648fa8f4a..55be426345 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2022 dan <i@dan.games> ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2024 Charles <charles@charje.net> +;;; Copyright © 2025 VnPower <vnpower@loang.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,6 +29,7 @@ #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) + #:use-module (guix build-system qt) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages anthy) #:use-module (gnu packages boost) @@ -413,6 +415,33 @@ the Anthy input method.") backend.") (license license:gpl3+))) +(define-public fcitx5-unikey + (package + (name "fcitx5-unikey") + (version "5.1.7") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fcitx/fcitx5-unikey") + (commit version))) + (sha256 + (base32 "0j82r63vn1rmjz2m92x6xksn548mmkiwcjkziqh6dp6aysxszvxx")) + (file-name (git-file-name name version)))) + (build-system qt-build-system) + (arguments + (list #:qtbase qtbase)) + (inputs + (list gettext-minimal + fcitx5 + fcitx5-qt)) + (native-inputs + (list extra-cmake-modules + pkg-config)) + (home-page "https://github.com/fcitx/fcitx5-unikey") + (synopsis "Unikey (Vietnamese Input Method) engine support for Fcitx5") + (description "This provides Unikey input method support for Fcitx5.") + (license license:gpl2+))) + (define-public fcitx5-chewing (package (name "fcitx5-chewing") diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index b56c2a62c6..f2135aabbb 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -31,7 +31,7 @@ ;;; Copyright © 2020, 2021 Masaya Tojo <masaya@tojo.tokyo> ;;; Copyright © 2020 Jesse Gibbons <jgibbons2357@gmail.com> ;;; Copyright © 2020 Mike Rosset <mike.rosset@gmail.com> -;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com> +;;; Copyright © 2020, 2025 Liliana Marie Prikler <liliana.prikler@gmail.com> ;;; Copyright © 2020, 2021, 2022 pukkamustard <pukkamustard@posteo.net> ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com> ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> @@ -163,14 +163,14 @@ (define-public artanis (package (name "artanis") - (version "1.2.2") + (version "1.3.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/artanis/artanis-" version ".tar.gz")) (sha256 (base32 - "013rs623075bbf824hf6jxng0kwbmg587l45fis9mmpq5168kspq")) + "16cwjyl0ykz6r7vvczrwaik6y4pc0fwc0hvwskfbgv9z71j2alzi")) (modules '((guix build utils))) (snippet '(begin @@ -1961,17 +1961,21 @@ the Guile compiler tower to generate the DSL from AWS JSON specifications.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1lvxic93cyzhdq7gb22pfz5j5pf7b1pcv0ahblkan8jbhzpqxvm0")))) + (base32 "1lvxic93cyzhdq7gb22pfz5j5pf7b1pcv0ahblkan8jbhzpqxvm0")) + ;; FIXME: report upstream and remove when fixed. + (modules '((guix build utils))) + (snippet '(substitute* "module/Makefile.am" + (("compile-ffi -o mosquitto-nyacc.scm") + "compile-ffi -X -o $(srcdir)/ffi/mosquitto-nyacc.scm"))))) (build-system gnu-build-system) (arguments (list - #:make-flags - #~(list "GUILE_AUTO_COMPILE=0") + #:parallel-build? #f #:phases #~(modify-phases %standard-phases (add-before 'build 'patch-extension-path (lambda* (#:key inputs #:allow-other-keys) - (setenv "HOME" "/tmp") + (setenv "GUILE_AUTO_COMPILE" "0") (with-directory-excursion "module" (invoke "make" "ffi/mosquitto.scm") (substitute* "ffi/mosquitto.scm" @@ -1983,7 +1987,7 @@ the Guile compiler tower to generate the DSL from AWS JSON specifications.") (native-inputs (list autoconf automake guile-3.0 - nyacc-2.01 + nyacc pkg-config texinfo)) (inputs (list mosquitto)) @@ -4924,6 +4928,68 @@ return accumulators. It is implemented by wrapping the sample implementation in a thin Guile compatibility layer.") (license license:gpl3+)))) +(define-public guile-srfi-165 + (let ((commit "1b441c0edc258e39cb943096bd47dd45071e2f70") + (revision "0")) + (package + (name "guile-srfi-165") + (version (git-version "0" revision commit)) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/scheme-requests-for-implementation/srfi-165") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1ac1nmf413sayy0xq4c2l4kmbjkh8ksg3s4fwgk44zcd8phy3kxw")))) + (build-system guile-build-system) + (arguments + (list + #:scheme-file-regexp "(srfi-165|impl)\\.scm$" + #:documentation-file-regexp "srfi-165\\.html$" + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'rename-files + (lambda _ + (mkdir-p "srfi/srfi-165") + (rename-file "srfi/165.scm" "srfi/srfi-165/impl.scm") + (substitute* "srfi/165.sld" + (("\\(include \"165.scm\"\\)") + "(include \"srfi-165/impl.scm\")")) + (rename-file "srfi/165.sld" "srfi/srfi-165.scm"))) + (add-after 'build 'check-installed + (lambda _ + (substitute* "srfi/165/test.sld" + (("srfi 165 test") "srfi #{165}# test")) + (define-values (scm go) (target-guile-scm+go #$output)) + + (invoke "guile" + "-L" scm "-C" go + "-l" "./srfi/165/test.sld" + "-c" + (format #f "~S" + '(begin + (use-modules (srfi #{165}# test)) + (run-tests))))))))) + (native-inputs (list guile-3.0 + guile-srfi-125 + guile-srfi-128 + guile-srfi-146)) + (propagated-inputs + (list guile-srfi-125 guile-srfi-128 guile-srfi-146)) + (home-page "https://srfi.schemers.org/srfi-165/") + (synopsis "Environment/Reader Monad") + (description + "This library provides the sample implementation of SRFI-165. +This SRFI defines an environment monad, which models computations that depend on +values from a shared environment. These computations can read values from the +environment, pass values to subsequent computations, execute sub-computations in +an extended environment, and modify the environment for future computations.") + (license license:expat)))) + (define-public guile-srfi-180 (let ((commit "9188bf9724c6d320ef804579d222e855b007b193") (revision "0")) @@ -6943,9 +7009,12 @@ schedulers.") (("dynamic-link \"libyaml\"") (format #f "dynamic-link \"~a/lib/libyaml\"" (assoc-ref inputs "libyaml"))))))))) - (native-inputs (list gcc guile-3.0 nyacc)) + ;; guile-libyaml does not work with nyacc-2.02.2. See + ;; https://github.com/mwette/guile-libyaml/issues/7 for upstream bug + ;; report. Hence, we use the older nyacc-1.08.1. + (native-inputs (list gcc guile-3.0 nyacc-1.08.1)) (inputs (list libyaml)) - (propagated-inputs (list guile-bytestructures nyacc)) + (propagated-inputs (list guile-bytestructures nyacc-1.08.1)) (home-page "https://github.com/mwette/guile-libyaml") (synopsis "Guile wrapper for libyaml") (description diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 5dafd4e955..f99e8c4ae7 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -69,6 +69,7 @@ #:use-module (gnu packages curl) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) + #:use-module (gnu packages engineering) #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) #:use-module (gnu packages game-development) @@ -942,17 +943,17 @@ recalculates.") (define-public paraview (package (name "paraview") - (version "5.11.1") + (version "6.0.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://gitlab.kitware.com/paraview/paraview.git") + (url "https://gitlab.kitware.com/paraview/paraview") (commit (string-append "v" version)) (recursive? #t))) (file-name (git-file-name name version)) (sha256 - (base32 "0m1lgkl95f0pyhxp97gq2rf8hibv39v4c49imfj1va40z0flvard")) + (base32 "1m1c7vngrpaqdqvnjx4wj0va20hih5rb7rf0a44mp3wqgp4wgy0f")) (modules '((guix build utils))) (snippet ;; TODO: Also remove unused bundled libraries and plugins? @@ -976,7 +977,7 @@ recalculates.") (for-each (lambda (dir) (delete-file-recursively (string-append "VTK/ThirdParty/" dir "/vtk" dir))) - '(;;"cgns" + '("cgns" "cli11" ;;"diy2" "doubleconversion" @@ -984,11 +985,12 @@ recalculates.") ;;"exodusII" "expat" ;;"exprtk" + ;;"fast-float" ;;"fides" "fmt" "freetype" "gl2ps" - "glew" + ;;"glad" ;;"h5part" "hdf5" ;;"ioss" @@ -1011,13 +1013,14 @@ recalculates.") "sqlite" "theora" "tiff" + ;;"token" "utf8" ;;"verdict" + ;;"viskores" ;;"vpic" ;;"vtkm" ;;"xdmf2" ;;"xdmf3" - ;;"zfp" "zlib")))))) (build-system qt-build-system) (arguments @@ -1025,7 +1028,7 @@ recalculates.") #:build-type "Release" ; 542 MiB in release mode #:tests? #f ; Downloads test data #:configure-flags - #~(let ((doc (string-append #$output "/share/doc/" #$name "-" #$version))) + #~(let ((doc (string-append "share/doc/" #$name "-" #$version))) (list (string-append "-DCMAKE_INSTALL_DOCDIR=" doc) ; For paraview.qch @@ -1095,6 +1098,7 @@ recalculates.") ;; External libraries for ParaView and VTK "-DVTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON" + "-DVTK_MODULE_USE_EXTERNAL_VTK_cgns=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_cli11=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON" @@ -1102,7 +1106,6 @@ recalculates.") "-DVTK_MODULE_USE_EXTERNAL_VTK_fmt=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON" - "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON" @@ -1148,17 +1151,17 @@ recalculates.") python-sphinx)) (inputs (list boost + cgns cli11 curl double-conversion eigen expat ffmpeg - fmt + fmt-11 freetype gdal gl2ps - glew gmsh hdf5 nlohmann-json ;For ParFlow; build fails diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm index 9b84a5b3a9..cd4a1ac3ae 100644 --- a/gnu/packages/linphone.scm +++ b/gnu/packages/linphone.scm @@ -1,7 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU -;;; ;;; Copyright © 2020, 2021 Raghav Gururajan <raghavgururajan@disroot.org> -;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2020, 2021, 2024-2025 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2023 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2023 Andreas Enge <andreas@enge.fr> @@ -25,6 +24,7 @@ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages aidc) + #:use-module (gnu packages aspell) #:use-module (gnu packages audio) #:use-module (gnu packages avahi) #:use-module (gnu packages cpp) @@ -46,6 +46,7 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages serialization) #:use-module (gnu packages sqlite) #:use-module (gnu packages telephony) #:use-module (gnu packages tls) @@ -62,75 +63,69 @@ #:use-module (guix build-system qt)) (define-public bcunit - (let ((commit "74021cc7cb20a4e177748dd2948173e1f9c270ae") - (revision "0")) - (package - (name "bcunit") - (version (git-version "3.0.2" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "git://git.linphone.org/bcunit") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b")))) - (build-system cmake-build-system) - (outputs '("out" "doc")) - (arguments - `(#:configure-flags (list "-DENABLE_STATIC=NO" - "-DENABLE_CURSES=ON" - "-DENABLE_DOC=ON" - "-DENABLE_EXAMPLES=ON" - "-DENABLE_TEST=ON" - "-DENABLE_MEMTRACE=ON") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-source - (lambda _ - ;; Include BCunit headers for examples. - (substitute* "Examples/CMakeLists.txt" - (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}") - (string-append "${CMAKE_CURRENT_SOURCE_DIR} " - "${PROJECT_SOURCE_DIR}/BCUnit/Headers " - "${CMAKE_BINARY_DIR}/BCUnit/Headers"))) - ;; Link bcunit and bcunit_tests libraries. - (substitute* "BCUnit/Sources/CMakeLists.txt" - (("target_include_directories\\(bcunit_test PUBLIC Test\\)") - (string-append - "target_include_directories(bcunit_test PUBLIC Test)\n" - "target_link_libraries(bcunit_test bcunit)"))))) - (replace 'check - (lambda _ - (with-directory-excursion "BCUnit/Sources/Test" - (invoke "./test_bcunit")))) - (add-after 'install 'move-doc - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc"))) - (for-each mkdir-p - `(,(string-append doc "/share/doc") - ,(string-append doc "/share/BCUnit"))) - (rename-file - (string-append out "/share/doc/BCUnit") - (string-append doc "/share/doc/BCUnit")) - (rename-file - (string-append out "/share/BCUnit/Examples") - (string-append doc "/share/BCUnit/Examples")))))))) - (inputs - (list ncurses)) - (synopsis "Belledonne Communications Unit Testing Framework") - (description "BCUnit is a fork of the defunct project CUnit, with + (package + (name "bcunit") + (version "5.3.57") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.linphone.org/BC/public/bcunit.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "02aqc8052vidc8ylkwiv2rqddl58fccrjz561j8zfqlwm2irnsg3")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON" + "-DENABLE_BCUNIT_CURSES=ON" + "-DENABLE_BCUNIT_DOC=ON" + "-DENABLE_BCUNIT_EXAMPLES=ON" + "-DENABLE_BCUNIT_TEST=ON" + "-DENABLE_BCUNIT_MEMTRACE=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + ;; Include BCunit headers for examples. + (substitute* "Examples/CMakeLists.txt" + (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}") + (string-append "${CMAKE_CURRENT_SOURCE_DIR} " + "${PROJECT_SOURCE_DIR}/BCUnit/Headers " + "${CMAKE_BINARY_DIR}/BCUnit/Headers"))) + ;; Link bcunit and bcunit_tests libraries. + (substitute* "BCUnit/Sources/CMakeLists.txt" + (("target_include_directories\\(bcunit_test PUBLIC Test\\)") + (string-append + "target_include_directories(bcunit_test PUBLIC Test)\n" + "\ttarget_link_libraries(bcunit_test bcunit)"))))) + (add-after 'install 'patch-BCUnitConfig.cmake + (lambda _ + (substitute* (string-append + #$output "/share/BCUnit/cmake/BCUnitConfig.cmake") + ;; This is only added for convenience when doing static builds. + ;; Since this is not a common case, avoid the find_dependency on + ;; ncurses, which would require propagating it. + (("find_dependency\\(Curses)") + "")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "BCUnit/Sources/Test" + (invoke "./test_bcunit")))))))) + (inputs (list ncurses)) + (synopsis "Belledonne Communications Unit Testing Framework") + (description "BCUnit is a fork of the defunct project CUnit, with several fixes and patches applied. It is a unit testing framework for writing, administering, and running unit tests in C.") - (home-page "https://gitlab.linphone.org/BC/public/bcunit") - (license license:lgpl2.0+)))) + (home-page "https://gitlab.linphone.org/BC/public/bcunit") + (license license:lgpl2.0+))) (define-public bctoolbox (package (name "bctoolbox") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -139,52 +134,51 @@ writing, administering, and running unit tests in C.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0b51308jy5z32gp594r78jvbyrha16sanxdnbcmxgrwnb4myqx5j")))) + (base32 "178axy7gmmi6fzjbz7aaawcx0qg50i4hnn7ab6w642b02vxfr386")))) (build-system cmake-build-system) (outputs '("out" "debug")) (arguments - `(#:configure-flags (list "-DENABLE_STATIC=OFF" - ;; Do not use -Werror, because due to skipping - ;; a test there are unused procedures. - "-DENABLE_STRICT=OFF") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-cmake - (lambda* (#:key inputs #:allow-other-keys) - ;; Fix decaf dependency (see: - ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3). - (let* ((decaf (assoc-ref inputs "libdecaf"))) - (substitute* (find-files "." "CMakeLists.txt") - (("find_package\\(Decaf CONFIG\\)") - "set(DECAF_FOUND 1)") - (("\\$\\{DECAF_INCLUDE_DIRS\\}") - (string-append decaf "/include/decaf")) - (("\\$\\{DECAF_TARGETNAME\\}") - "decaf"))))) - (add-after 'unpack 'skip-problematic-tests - (lambda _ - ;; The following test relies on networking; disable it. - (substitute* "tester/port.c" - (("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\),") - "")))) - (add-after 'unpack 'fix-installed-resource-directory-detection - (lambda _ - ;; There's some broken logic in tester.c that checks if CWD, or - ;; if its parent exist, and if so, sets the prefix where the test - ;; resources are looked up to; disable it (see: - ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4). - (substitute* "src/tester.c" - (("if \\(file_exists\\(\".\"\\)\\)") - "if (NULL)") - (("if \\(file_exists\\(\"..\"\\)\\)") - "if (NULL)")))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (with-directory-excursion "tester" - (invoke "./bctoolbox_tester")))))))) - (inputs - (list bcunit libdecaf mbedtls-lts)) + (list + #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON" + ;; Do not use -Werror, because due to skipping + ;; a test there are unused procedures. + "-DENABLE_STRICT=OFF") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-cmake + (lambda* (#:key inputs #:allow-other-keys) + ;; Fix decaf dependency (see: + ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3). + (substitute* (find-files "." "CMakeLists.txt") + (("find_package\\(Decaf CONFIG\\)") + "set(DECAF_FOUND 1)") + (("\\$\\{DECAF_INCLUDE_DIRS\\}") + (search-input-directory inputs "include/decaf")) + (("\\$\\{DECAF_TARGETNAME\\}") + "decaf")))) + (add-after 'unpack 'skip-problematic-tests + (lambda _ + ;; The following test relies on networking; disable it. + (substitute* "tester/port.c" + (("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\),") + "")))) + (add-after 'unpack 'fix-installed-resource-directory-detection + (lambda _ + ;; There's some broken logic in tester.c that checks if CWD, or + ;; if its parent exist, and if so, sets the prefix where the test + ;; resources are looked up to; disable it (see: + ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4). + (substitute* "src/tester.c" + (("if \\(file_exists\\(\".\"\\)\\)") + "if (NULL)") + (("if \\(file_exists\\(\"..\"\\)\\)") + "if (NULL)")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "tester" + (invoke "./bctoolbox-tester")))))))) + (inputs (list bcunit libdecaf mbedtls-lts)) (synopsis "Belledonne Communications Tool Box") (description "BcToolBox is an utilities library used by Belledonne Communications software like belle-sip, mediastreamer2 and linphone.") @@ -194,7 +188,7 @@ Communications software like belle-sip, mediastreamer2 and linphone.") (define-public belr (package (name "belr") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -203,33 +197,33 @@ Communications software like belle-sip, mediastreamer2 and linphone.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1bj8qd4ahbff476z0ccwsxy7qznqi6n5l1pdd7zbvk0h53zyj74c")))) + (base32 "1jqv2rfclzwsglwgvx7ypy0yhwbjxrsbik6xipf48770qmdz3bj9")))) (build-system cmake-build-system) (outputs '("out" "debug" "tester")) (arguments (list - #:configure-flags '(list "-DENABLE_STATIC=OFF") + #:configure-flags '(list "-DBUILD_SHARED_LIBS=ON") #:phases #~(modify-phases %standard-phases (delete 'check) ;moved after the install phase (add-after 'install 'check (lambda* (#:key tests? outputs #:allow-other-keys) (when tests? - (invoke (string-append #$output:tester "/bin/belr_tester"))))) + (invoke (string-append #$output:tester "/bin/belr-tester"))))) (add-after 'install 'move-tester (lambda _ (for-each mkdir-p (list (string-append #$output:tester "/bin") (string-append #$output:tester "/share"))) (rename-file - (string-append #$output "/bin/belr_tester") - (string-append #$output:tester "/bin/belr_tester")) + (string-append #$output "/bin/belr-tester") + (string-append #$output:tester "/bin/belr-tester")) (rename-file (string-append #$output "/share/belr-tester/res") ;; The detect_res_prefix procedure in bctoolbox's tester.c ;; resolves the resource path based on the executable path and ;; name, so have it match. - (string-append #$output:tester "/share/belr_tester"))))))) + (string-append #$output:tester "/share/belr-tester"))))))) (inputs (list bctoolbox)) (synopsis "Belledonne Communications Language Recognition Library") @@ -243,7 +237,7 @@ IETF.") (define-public belcard (package (name "belcard") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -252,12 +246,12 @@ IETF.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1rl1x7rnlnncb45sjp8r2xbcwr9l8qv5bhfybhr0mmvsv3a4k4a3")))) + (base32 "1d69s7v3yd276nasfxnsjp3q820pcchdpdpw4y7ak7sf6gr6mrrh")))) (build-system cmake-build-system) (outputs '("out" "debug" "tester")) (arguments (list - #:configure-flags '(list "-DENABLE_STATIC=OFF") + #:configure-flags '(list "-DBUILD_SHARED_LIBS=ON") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-vcard-grammar-location @@ -270,7 +264,7 @@ IETF.") (format #f "define VCARD_GRAMMAR ~s" vcard-grammar)))))) (add-after 'install 'install-tester (lambda _ - (let ((test-name (string-append #$name "_tester"))) + (let ((test-name (string-append #$name "-tester"))) (for-each mkdir-p (list (string-append #$output:tester "/bin") (string-append #$output:tester "/share"))) @@ -283,9 +277,10 @@ IETF.") (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke (string-append #$output:tester - "/bin/belcard_tester")))))))) - (inputs - (list bctoolbox belr)) + "/bin/belcard-tester")))))))) + (inputs (list bctoolbox)) + ;; Belr is required by BelCardConfig.cmake, so must be propagated. + (propagated-inputs (list belr)) (synopsis "Belledonne Communications VCard Library") (description "Belcard is a C++ library to manipulate VCard standard format.") @@ -295,7 +290,7 @@ format.") (define-public bcmatroska2 (package (name "bcmatroska2") - (version "5.2.1") + (version "5.3.57") (source (origin (method git-fetch) @@ -304,21 +299,12 @@ format.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "14c79znw37q3yc7llbv2wmxmm4a3ws6iq3cvgkbmcnf7hmhm7zdi")))) + (base32 "1fdlvsca34armxasj2g4vxjzm9iiqfl7832qqlggh04yw21cfa5c")))) (build-system cmake-build-system) (arguments (list #:tests? #f ;No test target - #:phases - '(modify-phases %standard-phases - ;; See - ;; https://gitlab.linphone.org/BC/public/bcmatroska2/-/merge_requests/18 - (add-after 'unpack 'fix-build-system - (lambda _ - (substitute* "corec/corec/CMakeLists.txt" - (("helpers/file/file_libc.c") ""))))) - #:configure-flags - '(list "-DENABLE_STATIC=NO"))) ;Not required + #:configure-flags '(list "-DBUILD_SHARED_LIBS=ON"))) (inputs (list bctoolbox)) (synopsis "Belledonne Communications Media Container") (description "BcMatroska is a free and open standard multi-media container @@ -331,80 +317,85 @@ Matroska multimedia container format.") license:lgpl2.1+)))) ;for LibMatroska2 (define-public bcg729 - (package - (name "bcg729") - (version "1.1.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "git://git.linphone.org/bcg729") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739")))) - (build-system cmake-build-system) - (arguments - `(#:configure-flags (list "-DENABLE_STATIC=NO" - "-DENABLE_TESTS=YES") - #:phases - (modify-phases %standard-phases - (add-before 'check 'copy-inputs - (lambda* (#:key inputs #:allow-other-keys) - (let ((test-patterns (assoc-ref inputs "test-patterns")) - (dest (string-append "test/bcg729-patterns.zip"))) - (copy-recursively test-patterns dest)))) - (replace 'check - (lambda _ - (with-directory-excursion "test" - (invoke "unzip" "bcg729-patterns.zip") - (for-each - (lambda (test-name) - (invoke "./testCampaign" "-s" test-name)) - (list "fixedCodebookSearch" - "postProcessing" - "adaptativeCodebookSearch" - "computeLP" - "computeAdaptativeCodebookGain" - "postFilter" - "decoder" - "LPSynthesisFilter" - "decodeLSP" - ;; "encoder" - ;; "LSPQuantization" - "preProcessing" - "decodeFixedCodeVector" - "CNGdecoder" - ;; "LP2LSPConversion" - "gainQuantization" - "findOpenLoopPitchDelay" - "decodeGains" - "computeWeightedSpeech" - "interpolateqLSPAndConvert2LP" - "decodeAdaptativeCodeVector")))))))) - (native-inputs - `(("perl" ,perl) - ("test-patterns" - ,(origin - (method url-fetch) - (uri (string-append "http://www.belledonne-communications.com/" - "bc-downloads/bcg729-patterns.zip")) - (sha256 - (base32 "1kivarhh3izrl9sg0szs6x6pbq2ap0y6xsraw0gbgspi4gnfihrh")))) - ("unzip" ,unzip))) - (synopsis "Belledonne Communications G729 Codec") - (description "BcG729 is an implementation of both encoder and decoder of + ;; mediastreamer2 needs a more recent commit than the latest release to + ;; detect the BCG729 package. + (let ((commit "8bec1e5fc072f3669e435edd137eb3da6da2eef7") + (revision "1")) + (package + (name "bcg729") + (version (git-version "1.1.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.linphone.org/BC/public/bcg729.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1s0bnxqv7xrh65ypdyvahjslx8rj0q1zm0bpvwcakf5hs7h45g7x")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags (list "-DBUILD_SHARED_LIBS=YES" + "-DENABLE_UNIT_TESTS=YES") + #:phases + (modify-phases %standard-phases + (add-before 'check 'copy-inputs + (lambda* (#:key inputs #:allow-other-keys) + (let ((test-patterns (assoc-ref inputs "test-patterns")) + (dest (string-append "test/bcg729-patterns.zip"))) + (copy-recursively test-patterns dest)))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "test" + (invoke "unzip" "bcg729-patterns.zip") + (for-each + (lambda (test-name) + (invoke "./testCampaign" "-s" test-name)) + (list "fixedCodebookSearch" + "postProcessing" + "adaptativeCodebookSearch" + "computeLP" + "computeAdaptativeCodebookGain" + "postFilter" + "decoder" + "LPSynthesisFilter" + "decodeLSP" + ;; "encoder" + ;; "LSPQuantization" + "preProcessing" + "decodeFixedCodeVector" + "CNGdecoder" + ;; "LP2LSPConversion" + "gainQuantization" + "findOpenLoopPitchDelay" + "decodeGains" + "computeWeightedSpeech" + "interpolateqLSPAndConvert2LP" + "decodeAdaptativeCodeVector"))))))))) + (native-inputs + `(("perl" ,perl) + ("test-patterns" + ,(origin + (method url-fetch) + (uri (string-append "http://www.belledonne-communications.com/" + "bc-downloads/bcg729-patterns.zip")) + (sha256 + (base32 "1kivarhh3izrl9sg0szs6x6pbq2ap0y6xsraw0gbgspi4gnfihrh")))) + ("unzip" ,unzip))) + (synopsis "Belledonne Communications G729 Codec") + (description "BcG729 is an implementation of both encoder and decoder of the ITU G729 speech codec. The library written in C 99 is fully portable and can be executed on many platforms including both ARM and x86 processors. It supports concurrent channels encoding and decoding for multi call application such as conferencing.") - (home-page "https://linphone.org/technical-corner/bcg729") - (license license:gpl3+))) + (home-page "https://linphone.org/technical-corner/bcg729") + (license license:gpl3+)))) (define-public ortp (package (name "ortp") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -413,14 +404,14 @@ such as conferencing.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1hzbrj1ny3lr9sql0lrxggc48sqv5j2yvbpnrdnph88pwzrdnbn5")))) + (base32 "1bl3ig1xbxprcdid9i8bnl433x4crxqnj30x5lxiy9ka79b8s8r6")))) (build-system cmake-build-system) (outputs '("out" "tester" "doc")) ;1.5 MiB of HTML doc (arguments (list #:tests? #f ;requires networking - #:configure-flags '(list "-DENABLE_STATIC=NO" + #:configure-flags '(list "-DBUILD_SHARED_LIBS=ON" "-DENABLE_DOC=NO" ;XXX: missing link for b64 "-DENABLE_TESTS=YES" ;; fix build error with GCC 14. @@ -459,7 +450,7 @@ implements the RFC 3550 standard.") (define-public bzrtp (package (name "bzrtp") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -468,15 +459,17 @@ implements the RFC 3550 standard.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0dvn1w0g9c07llz9n82l6qdzz8lzz74jcdm1yyfks0jy7i63cr8w")))) + (base32 "1q8w5blf2cjmzyv4bdd7zg4lv3pfjq6w6cfm6d75az4xqzg023kp")))) (build-system cmake-build-system) (arguments - `(#:configure-flags - (list - "-DENABLE_STATIC=NO" - "-DENABLE_TESTS=YES"))) - (inputs - (list bctoolbox libxml2 sqlite)) + (list + #:configure-flags #~(list "-DBUILD_SHARED_LIBS=YES" + "-DENABLE_DOC=YES") + #:tests? #f)) ;tests require external resources + (inputs (list bctoolbox libxml2)) + ;; sqlite is listed in the interface link libraries of bzrtp, and must be + ;; available at build time when using the bzrtp library. + (propagated-inputs (list sqlite)) (synopsis "Belledonne Communications ZRTP Library") (description "BZRTP is an implementation of ZRTP keys exchange protocol, written in C. It is fully portable and can be executed on many platforms @@ -487,7 +480,7 @@ including both ARM and x86.") (define-public belle-sip (package (name "belle-sip") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -496,12 +489,12 @@ including both ARM and x86.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0yx1qvzp11ysh24hxrvz7dm69j8zswa0xcx9m42vcv95z72166cq")))) + (base32 "1jmvf1s54ppc0qfi2wl6whk7s3lghpzzp6597nblncjsr2i6ha6c")))) (build-system cmake-build-system) (outputs '("out" "tester")) (arguments (list - #:configure-flags '(list "-DENABLE_STATIC=NO" + #:configure-flags '(list "-DBUILD_SHARED_LIBS=ON" "-DENABLE_MDNS=ON" ;; We skip a test and thus have an unused ;; procedure, so we need to disable -Werror. @@ -536,7 +529,7 @@ including both ARM and x86.") (delete 'check) ;move after install (add-after 'install 'separate-outputs (lambda _ - (let ((tester-name "belle_sip_tester")) + (let ((tester-name "belle-sip-tester")) (for-each mkdir-p (list (string-append #$output:tester "/bin") (string-append #$output:tester "/share"))) (rename-file (string-append #$output "/bin") @@ -547,7 +540,7 @@ including both ARM and x86.") (lambda* (#:key tests? #:allow-other-keys) (when tests? (let ((tester (string-append #$output:tester - "/bin/belle_sip_tester"))) + "/bin/belle-sip-tester"))) (for-each (lambda (suite-name) (invoke tester "--suite" suite-name)) (list "Object inheritance" @@ -566,8 +559,7 @@ including both ARM and x86.") "Refresher" ;;"HTTP stack" "Object"))))))))) - (inputs - (list avahi bctoolbox belr zlib)) + (inputs (list avahi bctoolbox belr zlib)) (synopsis "Belledonne Communications SIP Library") (description "Belle-sip is a modern library implementing SIP transport, transaction and dialog layers. It is written in C, with an object-oriented @@ -578,7 +570,7 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") (define-public mediastreamer2 (package (name "mediastreamer2") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -587,12 +579,12 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0mj0q2xaac22p2wf5gvgaiga03fbydilxfxzwyc6nwp5fyjnzawd")))) + (base32 "1zv13icfdpaq7fa325mnqf340vbvif9791hb9h22qpc0f2wcwvjb")))) (outputs '("out" "doc" "tester")) (build-system cmake-build-system) (arguments (list - #:configure-flags '(list "-DENABLE_STATIC=NO" + #:configure-flags '(list "-DBUILD_SHARED_LIBS=ON" "-DENABLE_PCAP=YES" ;; Do not fail on compile warnings. "-DENABLE_STRICT=NO" @@ -619,7 +611,7 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") (delete 'check) ;move after install (add-after 'install 'separate-outputs (lambda _ - (let ((tester-name (string-append #$name "_tester")) + (let ((tester-name (string-append #$name "-tester")) (doc-name (string-append #$name "-" #$version))) (for-each mkdir-p (list (string-append #$output:tester "/bin") @@ -637,7 +629,7 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") (add-after 'separate-outputs 'check (lambda _ (let ((tester (string-append #$output:tester - "/bin/mediastreamer2_tester"))) + "/bin/mediastreamer2-tester"))) (for-each (lambda (suite-name) (invoke tester "--suite" suite-name)) ;; Some tests fail, due to requiring access to the @@ -658,28 +650,29 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") bcg729 bcmatroska2 bctoolbox + bzrtp + dav1d ffmpeg-4 glew glu - mesa-utils gsm + libjpeg-turbo + libpcap + libsrtp + libtheora + libvpx + libx11 + libxv mesa + mesa-utils opus ortp - libpcap portaudio pulseaudio spandsp speex speexdsp - libsrtp - libtheora - libjpeg-turbo - v4l-utils - libvpx - libx11 - libxv - bzrtp)) + v4l-utils)) (synopsis "Belledonne Communications Streaming Engine") (description "Mediastreamer2 is a powerful and lightweight streaming engine for telephony applications. This media processing and streaming toolkit is @@ -691,7 +684,7 @@ including media capture, encoding and decoding, and rendering.") (define-public lime (package (name "lime") - (version "5.2.49") + (version "5.3.57") (source (origin (method git-fetch) @@ -700,39 +693,36 @@ including media capture, encoding and decoding, and rendering.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1mglnypxl3glwvwf2h5q4ikbm6wbcd9pb7kdws8zajjhk9q803jr")))) + (base32 "1jd549f4cky5rcvq3d2zn8d383jahdi71nhkzblnr6mqqbn6b7sa")))) (build-system cmake-build-system) (outputs '("out" "doc")) (arguments - `(#:configure-flags (list "-DENABLE_STATIC=NO" - "-DENABLE_C_INTERFACE=YES" - "-DENABLE_DOC=YES") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-source - (lambda _ - ;; Disable tests that require networking. - (substitute* "tester/CMakeLists.txt" - (("add_test\\(?.*\"Hello World\"\\)") "") - (("add_test\\(?.*\"lime\"\\)") "") - (("add_test\\(?.*\"FFI\"\\)") "") - (("add_test\\(?.*\"Multidomains\"\\)") "") - (("add_test\\(?.*\"Lime server\"\\)") "")))) - (add-after 'build 'build-doc - (lambda _ - (invoke "make" "doc"))) - (add-after 'install 'install-doc - (lambda* (#:key outputs #:allow-other-keys) - (let* ((doc (assoc-ref outputs "doc")) - (dir (string-append doc "/share/doc")) - (dest (string-append dir "/" ,name "-" ,version))) - (mkdir-p dest) - (copy-recursively "doc" dest))))))) - (native-inputs - `(("dot" ,graphviz) - ("doxygen" ,doxygen))) - (inputs - (list bctoolbox belle-sip soci)) + (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON" + "-DENABLE_C_INTERFACE=YES" + "-DENABLE_DOC=YES") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + ;; Disable tests that require networking. + (substitute* "tester/CMakeLists.txt" + (("add_test\\(?.*\"Hello World\"\\)") "") + (("add_test\\(?.*\"lime\"\\)") "") + (("add_test\\(?.*\"FFI\"\\)") "") + (("add_test\\(?.*\"Multidomains\"\\)") "") + (("add_test\\(?.*\"Lime server\"\\)") "")))) + (add-after 'build 'build-doc + (lambda _ + (invoke "make" "doc"))) + (add-after 'install 'install-doc + (lambda _ + (let* ((doc #$output:doc) + (dir (string-append doc "/share/doc")) + (dest (string-append dir "/" #$name "-" #$version))) + (mkdir-p dest) + (copy-recursively "doc" dest))))))) + (native-inputs (list graphviz doxygen)) + (inputs (list bctoolbox belle-sip belr soci)) (synopsis "Belledonne Communications Encryption Library") (description "LIME is an encryption library for one-to-one and group instant messaging, allowing users to exchange messages privately and @@ -744,7 +734,7 @@ device.") (define-public liblinphone (package (name "liblinphone") - (version "5.2.50") + (version "5.3.57") (source (origin (method git-fetch) @@ -753,37 +743,41 @@ device.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1lvbva234rmck57cxgswgqqvnq8r58i0ls4qgpymrxdfj74rinxj")))) + (base32 "1f3hcbdkd8nqvjm5avylz226a8in360yiafcsxpa69wvh1a03i4h")) + (patches (search-patches "liblinphone-jsoncpp.patch")))) (outputs '("out" "tester")) (build-system cmake-build-system) (arguments (list #:tests? #f ; Tests require networking #:configure-flags - '(list "-DENABLE_FLEXIAPI=NO" ;requires jsoncpp, but it cannot be found - "-DENABLE_STATIC=NO" - "-DENABLE_DOC=NO" ;requires unpackaged javasphinx - "-DENABLE_LDAP=YES" - "-DENABLE_STRICT=NO") + #~(list "-DBUILD_SHARED_LIBS=ON" + "-DENABLE_DOC=NO" ;requires unpackaged javasphinx + "-DENABLE_LDAP=YES" + "-DENABLE_STRICT=NO") #:phases #~(modify-phases %standard-phases (add-after 'install 'separate-outputs (lambda* (#:key outputs #:allow-other-keys) - (let ((tester-name (string-append #$name "_tester"))) + (let ((tester-name (string-append #$name "-tester"))) (for-each mkdir-p (list (string-append #$output:tester "/bin") (string-append #$output:tester "/share"))) - (rename-file (string-append #$output "/bin/" tester-name) - (string-append #$output:tester "/bin/" tester-name)) - (rename-file (string-append #$output "/bin/groupchat_benchmark") - (string-append #$output:tester "/bin/groupchat_benchmark")) - (rename-file (string-append #$output "/share/" tester-name) - (string-append #$output:tester "/share/" tester-name)))))))) + (rename-file + (string-append #$output "/bin/" tester-name) + (string-append #$output:tester "/bin/" tester-name)) + (rename-file + (string-append #$output "/bin/liblinphone-groupchat-benchmark") + (string-append #$output:tester "/bin/liblinphone-groupchat-benchmark")) + (rename-file + (string-append #$output "/share/" tester-name) + (string-append #$output:tester "/share/" tester-name)))))))) (native-inputs (list graphviz doxygen gettext-minimal perl + pkg-config python-wrapper python-pystache python-six @@ -791,20 +785,24 @@ device.") (inputs (list bctoolbox belcard - belle-sip belr bzrtp - lime libnotify - libxml2 - mediastreamer2 openldap-for-linphone - ortp soci - sqlite xsd zlib - zxing-cpp-1.2a)) + zxing-cpp)) + (propagated-inputs + ;; The following libraries are "required" by the LibLinphoneConfig.cmake + ;; CMake module. + (list belle-sip + jsoncpp + mediastreamer2 + libxml2 + lime + ortp + sqlite)) (synopsis "Belledonne Communications Softphone Library") (description "Liblinphone is a high-level SIP library integrating all calling and instant messaging features into an unified @@ -817,7 +815,7 @@ and video calls or instant messaging capabilities to an application.") (define-public linphone-desktop (package (name "linphone-desktop") - (version "5.0.14") + (version "5.2.6") (source (origin (method git-fetch) @@ -826,29 +824,30 @@ and video calls or instant messaging capabilities to an application.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0glrfsp087ni5hn6x6p4f6y63r4nyp061yyy0rfgddbxkzdqi2j1")) - (patches (search-patches "linphone-desktop-without-sdk.patch")))) + (base32 "06qfmgnsyaw1mdhd04pibsyfchy1bj15zvy36wz82g5dx3c5yj17")) + (patches + (search-patches "linphone-desktop-cmake-belcard.patch" + "linphone-desktop-cmake-find-modules.patch" + "linphone-desktop-ispell.patch" + "linphone-desktop-qtkeychain.patch")))) (build-system qt-build-system) (outputs '("out" "debug")) (arguments (list #:tests? #f ; No test target #:configure-flags - #~(list (string-append "-DFULL_VERSION=" #$version) - (string-append "-DCMAKE_INSTALL_PREFIX=" #$output) + #~(list (string-append "-DLINPHONEAPP_VERSION=" #$version) (string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin") (string-append "-DCMAKE_INSTALL_DATAROOTDIR=" #$output "/share") + (string-append "-DCMAKE_INSTALL_INCLUDEDIR=" #$output "/include") (string-append "-DCMAKE_INSTALL_LIBDIR=" #$output "/lib") "-DENABLE_UPDATE_CHECK=NO" "-DENABLE_DAEMON=YES" - "-DENABLE_CONSOLE_UI=YES") + "-DENABLE_CONSOLE_UI=YES" + "-DLinphoneCxx_TARGET=liblinphone++" + "-DLINPHONE_QT_ONLY=YES") ;avoid building linphone SDK #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'pre-configure - (lambda _ - (make-file-writable "linphone-app/linphoneqt_version.cmake") - (substitute* "linphone-app/linphoneqt_version.cmake" - (("\\$\\{GUIX-SET-VERSION\\}") #$version)))) (add-before 'install 'pre-install (lambda _ (mkdir-p (string-append #$output "/share/linphone")) @@ -875,18 +874,19 @@ and video calls or instant messaging capabilities to an application.") (mkdir-p (dirname grammar-dest)) (symlink (string-append liblinphone "/share/belr/grammars") grammar-dest))))))) - (native-inputs - (list pkg-config qttools-5)) + (native-inputs (list pkg-config qttools-5)) (inputs (list bctoolbox belcard - belr + ispell-for-linphone liblinphone mediastreamer2 ortp qtbase-5 qtdeclarative-5 qtgraphicaleffects + qtkeychain + qtmultimedia-5 qtquickcontrols-5 qtquickcontrols2-5 qtsvg-5 @@ -913,11 +913,12 @@ and video calls or instant messaging capabilities to an application.") (license license:gpl3+))) (define-public msopenh264 - (let ((commit "88697cc95140017760d6da408cb0efdc5e86e40a") + ;; Unreleased commits are needed for the build to succeed. + (let ((commit "041b07a81f88f1dde2ebb7a1ea0b0e2ec281ab20") (revision "0")) (package (name "msopenh264") - (version (git-version "1.2.1" revision commit)) + (version (git-version "5.2.0" revision commit)) (source (origin (method git-fetch) @@ -926,14 +927,20 @@ and video calls or instant messaging capabilities to an application.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "10y3b6s934f2wbsf60b3p0g6hffizjqrj5in8l4sida2fjdxlwwy")))) + (base32 "0hwf8x5dc3iksdv61k4raswngyk3cyx8700v2rzrm296aw74f5r1")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list "-DENABLE_STATIC=NO"))) ; Not required - (inputs - (list bctoolbox mediastreamer2 openh264 ortp)) + (list + #:tests? #f ; No test target + #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-Mediastreamer2_PLUGINS_DIR + (lambda _ + (substitute* "src/CMakeLists.txt" + (("\\$\\{Mediastreamer2_PLUGINS_DIR}") + (string-append #$output "/lib/mediastreamer/plugins")))))))) + (inputs (list bctoolbox mediastreamer2 openh264 ortp)) (synopsis "Media Streamer H.264 Codec") (description "MsOpenH264 is an H.264 encoder/decoder plugin for mediastreamer2 based on the openh264 library.") @@ -941,11 +948,12 @@ and video calls or instant messaging capabilities to an application.") (license license:gpl2+)))) (define-public mssilk - (let ((commit "dd0f31ee795faa7ea89e601b072dae4cd1df7e3f") + ;; The latest release doesn't build; use the latest commit. + (let ((commit "0c6893fb74ecca34cb2707f7fffd0d7487b24925") (revision "0")) (package (name "mssilk") - (version (git-version "1.1.1" revision commit)) + (version (git-version "1.2.0" revision commit)) (source (origin (method git-fetch) @@ -954,14 +962,20 @@ and video calls or instant messaging capabilities to an application.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "1dann5fnzqp6wjlwc6bl2k9b6rvn6bznqb3qsi1kgv9dnq44cbr0")))) + (base32 "1hpsh0iyby44hdanmkjnad7p9flhq2wcim8nl5bkyv1gw50sanli")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list "-DENABLE_STATIC=NO"))) ; Not required - (inputs - (list bctoolbox mediastreamer2 ortp)) + (list + #:tests? #f ; No test target + #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-Mediastreamer2_PLUGINS_DIR + (lambda _ + (substitute* "CMakeLists.txt" + (("\\$\\{Mediastreamer2_PLUGINS_DIR}") + (string-append #$output "/lib/mediastreamer/plugins")))))))) + (inputs (list bctoolbox mediastreamer2 ortp)) (synopsis "Media Streamer SILK Codec") (description "MSSILK is a plugin of MediaStreamer, adding support for AMR codec. It is based on the Skype's SILK implementation.") @@ -969,62 +983,68 @@ codec. It is based on the Skype's SILK implementation.") (license license:gpl2+)))) (define-public mswebrtc - (let ((commit "946ca706733f36a6b4923f04e569531125462d1d") - (revision "0")) - (package - (name "mswebrtc") - (version (git-version "1.1.1" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://gitlab.linphone.org/BC/public/mswebrtc") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "1pfg9m6bpbv0f53nx72rdxhlyriax9pg4yj0gpwq8ha6lqnpwg1x")))) - (build-system cmake-build-system) - (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list - "-DENABLE_STATIC=NO") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'copy-inputs - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((webrtc-from (assoc-ref inputs "webrtc")) - (webrtc-to (string-append (getcwd) "/webrtc"))) - (copy-recursively webrtc-from webrtc-to)) - #t))))) - (native-inputs - `(("webrtc" - ,(origin - (method git-fetch) - (uri - (git-reference - (url "https://gitlab.linphone.org/BC/public/external/webrtc") - (commit "583acd27665cfadef8ab03eb85a768d308bd29dd"))) - (file-name - (git-file-name "webrtc-for-mswebrtc" version)) - (sha256 - (base32 - "1maqychrgwy0z4zypa03qp726l2finw64z6cymdzhd58ql3p1lvm")))) - ("python" ,python-wrapper))) - (inputs - (list bctoolbox mediastreamer2 ortp)) - (synopsis "Media Streamer WebRTC Codec") - (description "MSWebRTC is a plugin of MediaStreamer, adding support for + ;; A newer, unreleased commit is needed to detect a recent oRTP; use the + ;; latest one available. + (package + (name "mswebrtc") + (version "1.1.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.linphone.org/BC/public/mswebrtc") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "10j124vd9zm03s1vzb74n3zjrf6x1nfvji7vryih4dq2xlgrqxx6")) + (patches (search-patches "mswebrtc-b64-refactor.patch" + "mswebrtc-cmake.patch")))) + (build-system cmake-build-system) + (arguments + (list + #:tests? #f ; No test target + #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-Mediastreamer2_PLUGINS_DIR + (lambda _ + (substitute* "CMakeLists.txt" + (("\\$\\{Mediastreamer2_PLUGINS_DIR}") + (string-append #$output "/lib/mediastreamer/plugins"))))) + (add-after 'unpack 'copy-inputs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((webrtc-from (assoc-ref inputs "webrtc")) + (webrtc-to (string-append (getcwd) "/webrtc"))) + (copy-recursively webrtc-from webrtc-to))))))) + (native-inputs + `(("webrtc" + ,(origin + (method git-fetch) + (uri + (git-reference + (url "https://gitlab.linphone.org/BC/public/external/webrtc") + (commit "583acd27665cfadef8ab03eb85a768d308bd29dd"))) + (file-name + (git-file-name "webrtc-for-mswebrtc" version)) + (sha256 + (base32 + "1maqychrgwy0z4zypa03qp726l2finw64z6cymdzhd58ql3p1lvm")))) + ("python" ,python-wrapper))) + (inputs (list bctoolbox mediastreamer2 ortp)) + (synopsis "Media Streamer WebRTC Codec") + (description "MSWebRTC is a plugin of MediaStreamer, adding support for WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.") - (home-page "https://gitlab.linphone.org/BC/public/mswebrtc") - (license license:gpl2+)))) + (home-page "https://gitlab.linphone.org/BC/public/mswebrtc") + (license license:gpl2+))) (define-public msamr - (let ((commit "5ab5c098299107048dfcbfc741f7392faef167bd") - (revision "0")) + ;; The latest 1.1.4 release is 2 years old, doesn't build with a recent + ;; bctoolbox; use the latest commit available. + (let ((commit "129fc98c04a5cd412d5393427d43b0b445263ead") + (revision "1")) (package (name "msamr") - (version (git-version "1.1.3" revision commit)) + (version (git-version "1.1.4" revision commit)) (source (origin (method git-fetch) @@ -1033,19 +1053,30 @@ WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "1g79lw1qi1mlw3v1b0cixmqiwjql81gz9naakb15n8pvaag9aaqm")))) + (base32 "0zp5vmhgp18812j2pbys7g3v0slkc70q9qp7k26bk7iddg1yy9x2")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list "-DENABLE_STATIC=NO" ; Not required - "-DENABLE_WIDEBAND=YES"))) + (list + #:tests? #f ; No test target + #:configure-flags + #~(list "-DBUILD_SHARED_LIBS=YES" + "-DENABLE_WIDEBAND=YES") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-Mediastreamer2_PLUGINS_DIR + (lambda _ + ;; msamr tries to install its plugins to + ;; Mediastreamer2_PLUGINS_DIR, which is provided by + ;; mediastreamer2 and points to its installation prefix. + (substitute* "src/CMakeLists.txt" + (("\\$\\{Mediastreamer2_PLUGINS_DIR}") + (string-append #$output "/lib/mediastreamer/plugins")))))))) (inputs - `(("bctoolbox" ,bctoolbox) - ("mediastreamer2" ,mediastreamer2) - ("opencoreamr" ,opencore-amr) - ("ortp" ,ortp) - ("voamrwbenc" ,vo-amrwbenc))) + (list bctoolbox + mediastreamer2 + opencore-amr + ortp + vo-amrwbenc)) (synopsis "Media Streamer AMR Codec") (description "MSAMR is a plugin of MediaStreamer, adding support for AMR codec. It is based on the opencore-amr implementation.") diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 7f24a449fe..f57160e21f 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -3976,6 +3976,21 @@ advanced research.") (with-directory-excursion "/tmp/fft2d" (invoke "tar" "--strip-components=1" "-xf" (assoc-ref inputs "fft2d-src"))))) + (add-after 'copy-sources 'opencl-fix + (lambda _ (substitute* "delegates/gpu/cl/opencl_wrapper.h" + (("cl_ndrange_kernel_command_properties_khr") + "cl_command_properties_khr")))) + (add-after 'opencl-fix 'absl-fix + (lambda _ (substitute* '( + "delegates/gpu/cl/cl_operation.h" + "delegates/gpu/common/task/qcom_thin_filter_desc.cc" + "delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc") + (("#include <vector>") + "#include <vector>\n\n#include \"absl/strings/str_cat.h\"\n")))) + (add-after 'opencl-fix 'stdint-fix + (lambda _ (substitute* "kernels/internal/spectrogram.cc" + (("#include <math.h>") + "#include <math.h>\n#include <cstdint>\n")))) (add-after 'build 'build-shared-library (lambda* (#:key configure-flags #:allow-other-keys) (mkdir-p "c") @@ -4000,7 +4015,7 @@ advanced research.") (when tests? (invoke "ctest" "-L" "plain"))))))) (inputs - `(("abseil-cpp" ,abseil-cpp-20200923.3) + `(("abseil-cpp" ,abseil-cpp) ("cpuinfo" ,cpuinfo) ("eigen" ,eigen) ("fp16" ,fp16) diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm index b11e6ec19c..43897862ef 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2025 Felix Lechner <felix.lechner@lease-up.com> +;;; Copyright © 2025 Andreas Enge <andreas@enge.fr> ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,61 +41,9 @@ #:use-module (guix packages) #:use-module (guix utils)) -(define-public nyacc-0.86 - ;; Nyacc used for bootstrap. - (package - (name "nyacc") - (version "0.86.0") - (source (origin - (method url-fetch) - (uri (string-append "mirror://savannah/nyacc/" - name "-" version ".tar.gz")) - (patches (search-patches "nyacc-binary-literals.patch")) - (sha256 - (base32 - "0lkd9lyspvhxlfs0496gsllwinh62jk9wij6gpadvx9gwz6yavd9")))) - (build-system gnu-build-system) - (native-inputs (list guile-2.2)) - (synopsis "LALR(1) Parser Generator in Guile") - (description - "NYACC is an LALR(1) parser generator implemented in Guile. -The syntax and nomenclature should be considered not stable. It comes with -extensive examples, including parsers for the Javascript and C99 languages.") - (home-page "https://savannah.nongnu.org/projects/nyacc") - (license (list gpl3+ lgpl3+)))) - -(define-public nyacc-0.99 - (package - (inherit nyacc-0.86) - (version "0.99.0") - (source (origin - (method url-fetch) - (uri (string-append "mirror://savannah/nyacc/nyacc-" - version ".tar.gz")) - (sha256 - (base32 - "0hl5qxx19i4x1r0839sxm19ziqq65g4hy97yik81cc2yb9yvgyv3")) - (modules '((guix build utils))) - (snippet - '(begin - (substitute* (find-files "." "^Makefile\\.in$") - (("^SITE_SCM_DIR =.*") - "SITE_SCM_DIR = \ -@prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n") - (("^SITE_SCM_GO_DIR =.*") - "SITE_SCM_GO_DIR = \ -@prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n") - (("^INFODIR =.*") - "INFODIR = @prefix@/share/info\n") - (("^DOCDIR =.*") - "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n")) - #t)))) - (native-inputs (list pkg-config)) - (inputs (list guile-2.2)))) - (define-public nyacc-1.08.1 (package - (inherit nyacc-0.99) + (name "nyacc") (version "1.08.1") (source (origin (method url-fetch) @@ -109,17 +58,24 @@ extensive examples, including parsers for the Javascript and C99 languages.") (("GUILE_GLOBAL_SITE=\\$prefix.*") "GUILE_GLOBAL_SITE=\ $prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION\n"))))) + (build-system gnu-build-system) + (native-inputs (list pkg-config)) (inputs (list guile-3.0)) (propagated-inputs (list guile-bytestructures)) + (home-page "https://savannah.nongnu.org/projects/nyacc") + (synopsis "LALR(1) Parser Generator in Guile") (description "@acronym{NYACC, Not Yet Another Compiler Compiler} is set of Guile modules for generating parsers and lexical analyzers. It provides sample parsers, pretty-printers using SXML trees as an intermediate representation, a decent C parser and an `FFI Helper' tool to help create Guile Scheme bindings for C-based libraries. It also provides (partially implemented) compilers based on these -parsers to allow execution with Guile as extension languages."))) +parsers to allow execution with Guile as extension languages.") + (license (list gpl3+ lgpl3+)))) (define-public nyacc-1.00.2 + ;; The source of this package is used for bootstrapping in + ;; commencement.scm. Otherwise it could be removed. (package (inherit nyacc-1.08.1) (version "1.00.2") diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 7190dfcd57..9b770d6442 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -7005,16 +7005,16 @@ ZaMultiComp, ZaMultiCompX2 and ZamSynth.") (define-public geonkick (package (name "geonkick") - (version "2.7.0") + (version "3.6.2") (source (origin (method git-fetch) (uri (git-reference - (url "https://gitlab.com/iurie-sw/geonkick") + (url "https://codeberg.org/Geonkick-Synthesizer/geonkick") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0w1mvqm46qdwldcl81svaykwii4wvx7mcr57kwvnj0iv2qrc891i")))) + (base32 "0817hsfvgri315aw0y06rzjcw96lhgxjc37rbxqagk3ciw0naj6n")))) (build-system cmake-build-system) (arguments `(#:tests? #f ;no tests included @@ -7036,7 +7036,7 @@ ZaMultiComp, ZaMultiCompX2 and ZamSynth.") (description "Geonkick is a synthesizer that can synthesize elements of percussion such as kicks, snares, hit-hats, shakers, claps and sticks. It can also play and mix samples.") - (home-page "https://gitlab.com/iurie-sw/geonkick") + (home-page "https://geonkick.org") (license license:gpl3+))) (define-public mamba diff --git a/gnu/packages/patches/ispell-for-linphone-cmake.patch b/gnu/packages/patches/ispell-for-linphone-cmake.patch new file mode 100644 index 0000000000..6785ca4b7e --- /dev/null +++ b/gnu/packages/patches/ispell-for-linphone-cmake.patch @@ -0,0 +1,43 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/bc-ispell.git;a=blob_plain;f=ispell-cmake.patch;hb=HEAD + +--- ispell-05574fe160222c3d0b6283c1433c9b087271fad1/CMakeLists.txt.orig 2023-11-07 11:53:37.000000000 +0100 ++++ ispell-05574fe160222c3d0b6283c1433c9b087271fad1/CMakeLists.txt 2024-03-28 20:53:45.068632010 +0100 +@@ -49,6 +49,26 @@ set(ISPELL_SOURCES + + add_library(${ISPELL_TARGET_NAME} SHARED ${ISPELL_SOURCES}) + ++set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${ISPELL_TARGET_NAME}") ++configure_package_config_file("${ISPELL_TARGET_NAME}Config.cmake.in" "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake" ++ INSTALL_DESTINATION "${CMAKE_MODULES_INSTALL_DIR}" ++ NO_SET_AND_CHECK_MACRO ++) ++write_basic_package_version_file("${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}ConfigVersion.cmake" ++ VERSION ${PROJECT_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++install(FILES ++ "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake" ++ "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}ConfigVersion.cmake" ++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR} ++) ++ ++install(EXPORT ${ISPELL_TARGET_NAME}LibraryDepends ++ FILE "${ISPELL_TARGET_NAME}LibraryDepends.cmake" ++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR} ++) ++ + install(TARGETS ${ISPELL_TARGET_NAME} + EXPORT ${ISPELL_TARGET_NAME}LibraryDepends + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +--- ispell-05574fe160222c3d0b6283c1433c9b087271fad1/ISpellConfig.cmake.in.orig 2023-11-07 11:53:37.000000000 +0100 ++++ ispell-05574fe160222c3d0b6283c1433c9b087271fad1/ISpellConfig.cmake.in 2024-03-28 21:54:40.692161132 +0100 +@@ -12,7 +12,7 @@ set(ISPELL_LIBRARIES "@ISPELL_TARGET_NAM + get_target_property(ISPELL_INCLUDE_DIRS "@ISPELL_TARGET_NAME@" INTERFACE_INCLUDE_DIRECTORIES) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18.0) +- add_library(@ISpell_TARGET_NAME@::@ISpell_TARGET_NAME@ ALIAS @ISpell_TARGET_NAME@) ++ add_library(@ISPELL_TARGET_NAME@::@ISPELL_TARGET_NAME@ ALIAS @ISPELL_TARGET_NAME@) + endif() + +-check_required_components(@ISpell_TARGET_NAME@) ++check_required_components(@ISPELL_TARGET_NAME@) diff --git a/gnu/packages/patches/liblinphone-jsoncpp.patch b/gnu/packages/patches/liblinphone-jsoncpp.patch new file mode 100644 index 0000000000..d012b07870 --- /dev/null +++ b/gnu/packages/patches/liblinphone-jsoncpp.patch @@ -0,0 +1,82 @@ +diff --git a/cmake/FindJsonCPP.cmake b/cmake/FindJsonCPP.cmake +index 59e971a58..18260fde8 100644 +--- a/cmake/FindJsonCPP.cmake ++++ b/cmake/FindJsonCPP.cmake +@@ -39,10 +39,11 @@ + # JsonCPP_FOUND - The jsoncpp library has been found + # JsonCPP_TARGET - The name of the CMake target for the jsoncpp library + ++if(TARGET jsoncpp_lib OR TARGET jsoncpp_static OR TARGET PkgConfig::jsoncpp) + +-if(TARGET jsoncpp_lib OR TARGET jsoncpp_static) +- +- if(TARGET jsoncpp_lib) ++ if(TARGET PkgConfig::jsoncpp) ++ set(JsonCPP_TARGET PkgConfig::jsoncpp) ++ elseif(TARGET jsoncpp_lib) + set(JsonCPP_TARGET jsoncpp_lib) + else() + set(JsonCPP_TARGET jsoncpp_static) +@@ -57,24 +58,50 @@ if(TARGET jsoncpp_lib OR TARGET jsoncpp_static) + mark_as_advanced(JsonCPP_TARGET) + + else() +- +- set(_OPTIONS "CONFIG") ++ find_package(PkgConfig QUIET) ++ ++ set(_OPTIONS1 "CONFIG") ++ set(_OPTIONS2 "IMPORTED_TARGET") # for pkg_check_modules fallback ++ + if(JsonCPP_FIND_REQUIRED) +- list(APPEND _OPTIONS "REQUIRED") +- endif() +- if(JsonCPP_FIND_QUIETLY) +- list(APPEND _OPTIONS "QUIET") ++ if(PKG_CONFIG_FOUND) ++ list(APPEND _OPTIONS2 "REQUIRED") ++ else() ++ list(APPEND _OPTIONS1 "REQUIRED") ++ endif() + endif() +- if(JsonCPP_FIND_VERSION) +- list(PREPEND _OPTIONS "${jsoncpp_FIND_VERSION}") ++ if(JsonCPP_FIND_QUIETLY) ++ list(APPEND _OPTIONS1 "QUIET") ++ list(APPEND _OPTIONS2 "QUIET") + endif() +- if(JsonCPP_FIND_EXACT) +- list(APPEND _OPTIONS "EXACT") ++ if(PKG_CONFIG_FOUND) ++ if(JsonCPP_FIND_VERSION) ++ if(JsonCPP_FIND_EXACT) ++ list(APPEND _OPTIONS2 "jsoncpp=${JsonCPP_FIND_VERSION}") ++ else() ++ list(APPEND _OPTIONS2 "jsoncpp>=${JsonCPP_FIND_VERSION}") ++ endif() ++ else() ++ list(APPEND _OPTIONS2 "jsoncpp") ++ endif() ++ else() ++ if(JsonCPP_FIND_VERSION) ++ list(PREPEND _OPTIONS1 "${jsoncpp_FIND_VERSION}") ++ endif() ++ if(JsonCPP_FIND_EXACT) ++ list(APPEND _OPTIONS1 "EXACT") ++ endif() + endif() + +- find_package(jsoncpp ${_OPTIONS}) ++ find_package(jsoncpp ${_OPTIONS1}) ++ ++ if(NOT JsonCPP_FOUND) ++ pkg_check_modules(jsoncpp ${_OPTIONS2}) ++ endif() + +- if(TARGET jsoncpp_lib) ++ if(TARGET PkgConfig::jsoncpp) ++ set(JsonCPP_TARGET jsoncpp) ++ elseif(TARGET jsoncpp_lib) + set(JsonCPP_TARGET jsoncpp_lib) + else() + set(JsonCPP_TARGET jsoncpp_static) diff --git a/gnu/packages/patches/linphone-desktop-cmake-belcard.patch b/gnu/packages/patches/linphone-desktop-cmake-belcard.patch new file mode 100644 index 0000000000..3cc573b938 --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-cmake-belcard.patch @@ -0,0 +1,39 @@ +From 0216b81c46f2612b8acf33b1a7c5886db25f45ff Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <maxim.cournoyer@gmail.com> +Date: Thu, 13 Jun 2024 16:04:29 -0400 +Subject: [PATCH] cmake: Fix BelCard cmake module name. + +* linphone-app/CMakeLists.txt: cmake: Fix BelCard cmake module name. + +Fixes: <https://gitlab.linphone.org/BC/public/linphone-desktop/-/issues/32> +--- + linphone-app/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt +index d40842fa..f1c225a5 100644 +--- a/linphone-app/CMakeLists.txt ++++ b/linphone-app/CMakeLists.txt +@@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.22) + + + #Linphone targets +-set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 Belcard LibLinphone) ++set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 BelCard LibLinphone) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +@@ -115,7 +115,7 @@ set(PLUGIN_TARGETS ${LinphoneCxx_TARGET}) + set(APP_TARGETS ${LinphoneCxx_TARGET} + ${BCToolbox_TARGET}#Logger/App + ${Mediastreamer2_TARGET}#MediastreamerUtils +- ${Belcard_TARGET}#VCard Model ++ ${BelCard_TARGET}#VCard Model + ${LibLinphone_TARGET})#MediastreamerUtils + + #################################### + +base-commit: e34beffe06802efcc5904d5059006ac0d2f7ef32 +-- +2.45.1 + diff --git a/gnu/packages/patches/linphone-desktop-cmake-find-modules.patch b/gnu/packages/patches/linphone-desktop-cmake-find-modules.patch new file mode 100644 index 0000000000..96353eef28 --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-cmake-find-modules.patch @@ -0,0 +1,422 @@ +From 25bdfe9ad3a33e1db6e5db8290b3a5112f4d621e Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <maxim.cournoyer@gmail.com> +Date: Fri, 14 Jun 2024 22:33:58 -0400 +Subject: [PATCH] cmake: Delete most CMake find modules. + +They do not appear to bring any value compared to the config files +installed by each project, and cause issues like the following, at +least when using system libraries: + + -- Trying to find LibLinphone + CMake Error at linphone-app/cmake/FindLibLinphone.cmake:31 (include): + include could not find requested file: + + LibLinphoneTargets + Call Stack (most recent call first): + linphone-app/CMakeLists.txt:108 (find_package) + +Fixes: <https://gitlab.linphone.org/BC/public/linphone-desktop/-/issues/30> +--- + linphone-app/cmake/FindBCToolbox.cmake | 60 --------------------- + linphone-app/cmake/FindBelcard.cmake | 44 --------------- + linphone-app/cmake/FindISpell.cmake | 47 ---------------- + linphone-app/cmake/FindLibLinphone.cmake | 46 ---------------- + linphone-app/cmake/FindLinphoneCxx.cmake | 45 ---------------- + linphone-app/cmake/FindMediastreamer2.cmake | 49 ----------------- + linphone-app/cmake/FindQtKeychain.cmake | 48 ----------------- + 7 files changed, 339 deletions(-) + delete mode 100644 linphone-app/cmake/FindBCToolbox.cmake + delete mode 100644 linphone-app/cmake/FindBelcard.cmake + delete mode 100644 linphone-app/cmake/FindISpell.cmake + delete mode 100644 linphone-app/cmake/FindLibLinphone.cmake + delete mode 100644 linphone-app/cmake/FindLinphoneCxx.cmake + delete mode 100644 linphone-app/cmake/FindMediastreamer2.cmake + delete mode 100644 linphone-app/cmake/FindQtKeychain.cmake + +diff --git a/linphone-app/cmake/FindBCToolbox.cmake b/linphone-app/cmake/FindBCToolbox.cmake +deleted file mode 100644 +index 707cc147..00000000 +--- a/linphone-app/cmake/FindBCToolbox.cmake ++++ /dev/null +@@ -1,60 +0,0 @@ +-############################################################################ +-# FindBctoolbox.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +- +-# This module will set the following variables in your project: +-# +-# BCToolbox_FOUND - The bctoolbox library has been found +-# BCToolbox_TARGET - The name of the CMake target for the bctoolbox library +-# BCToolbox_CMAKE_DIR - The bctoolbox CMake directory +-# BCToolbox_CMAKE_UTILS - The path to the bctoolbox CMake utils script +-# BCToolbox_tester_FOUND - The bctoolbox-tester library has been found +-# BCToolbox_tester_TARGET - The name of the CMake target for the bctoolbox-tester library +- +- +-if(NOT TARGET bctoolbox) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- set(BCToolbox_CMAKE_DIR ${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/bctoolbox/cmake) +- include(${BCToolbox_CMAKE_DIR}/bctoolboxTargets.cmake) +-endif() +- +-set(_BCToolbox_REQUIRED_VARS BCToolbox_TARGET BCToolbox_CMAKE_DIR BCToolbox_CMAKE_UTILS) +-set(_BCToolbox_CACHE_VARS ${_BCToolbox_REQUIRED_VARS}) +- +-if(TARGET bctoolbox) +- set(BCToolbox_TARGET bctoolbox) +- get_target_property(_BCToolbox_SOURCE_DIR ${BCToolbox_TARGET} SOURCE_DIR) +- set(BCToolbox_CMAKE_DIR "${_BCToolbox_SOURCE_DIR}/../cmake") +- set(BCToolbox_CMAKE_UTILS "${BCToolbox_CMAKE_DIR}/BCToolboxCMakeUtils.cmake") +- if(TARGET bctoolbox-tester) +- set(BCToolbox_tester_FOUND TRUE) +- set(BCToolbox_tester_TARGET bctoolbox-tester) +- list(APPEND _BCToolbox_CACHE_VARS BCToolbox_tester_TARGET) +- endif() +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(BCToolbox +- REQUIRED_VARS ${_BCToolbox_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_BCToolbox_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindBelcard.cmake b/linphone-app/cmake/FindBelcard.cmake +deleted file mode 100644 +index ce89497c..00000000 +--- a/linphone-app/cmake/FindBelcard.cmake ++++ /dev/null +@@ -1,44 +0,0 @@ +-############################################################################ +-# FindBelcard.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# Belcard_FOUND - The liblinphone library has been found +-# Belcard_TARGET - The name of the CMake target +- +-if(NOT TARGET belcard) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/Belcard/cmake/BelcardTargets.cmake) +-endif() +- +-set(_Belcard_REQUIRED_VARS Belcard_TARGET) +-set(_Belcard_CACHE_VARS ${_Belcard_REQUIRED_VARS}) +- +-if(TARGET belcard) +- set(Belcard_TARGET belcard) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(Belcard +- REQUIRED_VARS ${_Belcard_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_Belcard_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindISpell.cmake b/linphone-app/cmake/FindISpell.cmake +deleted file mode 100644 +index 7a9269fa..00000000 +--- a/linphone-app/cmake/FindISpell.cmake ++++ /dev/null +@@ -1,47 +0,0 @@ +-############################################################################ +-# FindISpell.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the ispell include files and library +-# +-# ISpell_FOUND - system has lib ispell +-# ISpell_SOURCE_DIR - the ispell include directory +-# ISpell_BINARY_DIR - the ispell library directory +- +-if(NOT TARGET ${ISPELL_TARGET_NAME}) +- set(EXPORT_PATH ${ISPELL_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake/${ISPELL_TARGET_NAME}/${ISPELL_TARGET_NAME}Config.cmake) +-endif() +- +-set(_ISpell_REQUIRED_VARS ISpell_TARGET) +-set(_ISpell_CACHE_VARS ${_ISpell_REQUIRED_VARS}) +- +-if(TARGET ${ISPELL_TARGET_NAME}) +- set(ISpell_TARGET ${ISPELL_TARGET_NAME}) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(ISpell +- REQUIRED_VARS ${_ISpell_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_ISpell_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindLibLinphone.cmake b/linphone-app/cmake/FindLibLinphone.cmake +deleted file mode 100644 +index 826bb0d8..00000000 +--- a/linphone-app/cmake/FindLibLinphone.cmake ++++ /dev/null +@@ -1,46 +0,0 @@ +-############################################################################ +-# FindLinphone.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# LibLinphone_FOUND - The liblinphone library has been found +-# LibLinphone_TARGET - The name of the CMake target for the liblinphone library +-# LibLinphone_PLUGINS_DIR - The directory where to install liblinphone plugins +- +-if(NOT TARGET liblinphone) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/linphone/cmake/linphoneTargets.cmake) +-endif() +- +-set(_LibLinphone_REQUIRED_VARS LibLinphone_TARGET LibLinphone_PLUGINS_DIR) +-set(_LibLinphone_CACHE_VARS ${_LibLinphone_REQUIRED_VARS}) +- +-if(TARGET liblinphone) +- set(LibLinphone_TARGET liblinphone) +- get_target_property(LibLinphone_PLUGINS_DIR ${LibLinphone_TARGET} LIBLINPHONE_PLUGINS_DIR) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(LibLinphone +- REQUIRED_VARS ${_LibLinphone_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_LibLinphone_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindLinphoneCxx.cmake b/linphone-app/cmake/FindLinphoneCxx.cmake +deleted file mode 100644 +index 0f81fe20..00000000 +--- a/linphone-app/cmake/FindLinphoneCxx.cmake ++++ /dev/null +@@ -1,45 +0,0 @@ +-############################################################################ +-# FindLinphoneCxx.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# LinphoneCxx_FOUND - The liblinphone library has been found +-# LinphoneCxx_TARGET - The name of the CMake target for the liblinphone library +- +-if(NOT TARGET liblinphone++) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/LinphoneCxx/cmake/LinphoneCxxTargets.cmake) +-endif() +- +-set(_LinphoneCxx_REQUIRED_VARS LinphoneCxx_TARGET) +-set(_LinphoneCxx_CACHE_VARS ${_LinphoneCxx_REQUIRED_VARS}) +- +-if(TARGET liblinphone++) +- set(LinphoneCxx_TARGET liblinphone++) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(LinphoneCxx +- REQUIRED_VARS ${_LinphoneCxx_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_LinphoneCxx_CACHE_VARS}) +- +diff --git a/linphone-app/cmake/FindMediastreamer2.cmake b/linphone-app/cmake/FindMediastreamer2.cmake +deleted file mode 100644 +index dc41f187..00000000 +--- a/linphone-app/cmake/FindMediastreamer2.cmake ++++ /dev/null +@@ -1,49 +0,0 @@ +-############################################################################ +-# FindMediastreamer2.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# This module will set the following variables in your project: +-# +-# Mediastreamer2_FOUND - The mediastreamer2 library has been found +-# Mediastreamer2_TARGET - The name of the CMake target for the mediastreamer2 library +-# Mediastreamer2_PLUGINS_DIR - The directory where to install mediastreamer2 plugins +- +-if(NOT TARGET mediastreamer2) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/Mediastreamer2/cmake/Mediastreamer2Targets.cmake) +-endif() +- +-set(_Mediastreamer2_REQUIRED_VARS Mediastreamer2_TARGET Mediastreamer2_PLUGINS_DIR) +-set(_Mediastreamer2_CACHE_VARS ${_Mediastreamer2_REQUIRED_VARS}) +- +-if(TARGET mediastreamer2) +- set(Mediastreamer2_TARGET mediastreamer2) +- get_target_property(Mediastreamer2_PLUGINS_DIR ${Mediastreamer2_TARGET} MS2_PLUGINS_DIR) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(Mediastreamer2 +- REQUIRED_VARS ${_Mediastreamer2_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_Mediastreamer2_CACHE_VARS}) +- +diff --git a/linphone-app/cmake/FindQtKeychain.cmake b/linphone-app/cmake/FindQtKeychain.cmake +deleted file mode 100644 +index 9b7911aa..00000000 +--- a/linphone-app/cmake/FindQtKeychain.cmake ++++ /dev/null +@@ -1,48 +0,0 @@ +-############################################################################ +-# FindQtKeychain.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the linphonecxx include files and library +-# +-# QtKeychain_FOUND - system has lib linphonecxx +-# QtKeychain_INCLUDE_DIRS - the linphonecxx include directory +-# QtKeychain_LIBRARIES - The library needed to use linphonecxx +-if(NOT TARGET ${QTKEYCHAIN_TARGET_NAME}) +- set(EXPORT_PATH ${QTKEYCHAIN_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake/${QTKEYCHAIN_TARGET_NAME}/${QTKEYCHAIN_TARGET_NAME}Config.cmake) +-endif() +- +-set(_QtKeychain_REQUIRED_VARS QtKeychain_TARGET) +-set(_QtKeychain_CACHE_VARS ${_QtKeychain_REQUIRED_VARS}) +- +-if(TARGET ${QTKEYCHAIN_TARGET_NAME}) +- set(QtKeychain_TARGET ${QTKEYCHAIN_TARGET_NAME}) +- set(QtKeychain_USE_BUILD_INTERFACE TRUE) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(QtKeychain +- REQUIRED_VARS ${_QtKeychain_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_QtKeychain_CACHE_VARS}) +- + +base-commit: d69e033508265f756fb47b39b76b7d589be159c0 +prerequisite-patch-id: 1df5d6e9367036cd8ce918e1f3e3d7b3661f73c2 +-- +2.45.1 + diff --git a/gnu/packages/patches/linphone-desktop-ispell.patch b/gnu/packages/patches/linphone-desktop-ispell.patch new file mode 100644 index 0000000000..679703ec02 --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-ispell.patch @@ -0,0 +1,24 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/linphone.git;a=blob_plain;f=linphone-ispell.patch;h=67bbae61835c7fa813edcc006b5b67901ca42abe;hb=HEAD + +--- linphone-desktop-5.2.2/linphone-app/src/components/other/spell-checker/SpellCheckerLinux.cpp.orig 2024-03-11 18:30:37.000000000 +0100 ++++ linphone-desktop-5.2.2/linphone-app/src/components/other/spell-checker/SpellCheckerLinux.cpp 2024-03-31 18:17:09.041543370 +0200 +@@ -20,7 +20,7 @@ + + + #include "SpellChecker.hpp" +-#include <libispell.h> ++#include <ISpell/libispell.h> + #include "app/paths/Paths.hpp" + #include <unistd.h> + #include <cstdio> +--- linphone-desktop-5.2.2/linphone-app/cmake_builder/linphone_package/CMakeLists.txt.orig 2024-04-01 08:06:42.275231951 +0200 ++++ linphone-desktop-5.2.2/linphone-app/cmake_builder/linphone_package/CMakeLists.txt 2024-04-01 17:44:16.670826307 +0200 +@@ -338,8 +338,6 @@ else()# Not Windows and Apple + if(ENABLE_APP_WEBVIEW) + install(FILES "${QT_PATH}/plugins/webview/libqtwebview_webengine.so" DESTINATION "plugins/webview") #Workaround : linuxdeploy doesn't deploy it + endif() +-# ISPELL +- install(DIRECTORY "${ISpell_SOURCE_DIR}/ispell_dictionaries" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}" USE_SOURCE_PERMISSIONS) + endif () + + diff --git a/gnu/packages/patches/linphone-desktop-qtkeychain.patch b/gnu/packages/patches/linphone-desktop-qtkeychain.patch new file mode 100644 index 0000000000..b19761672a --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-qtkeychain.patch @@ -0,0 +1,36 @@ +Retrieved from https://git.pld-linux.org/?p=packages/linphone.git;a=blob_plain;f=linphone-qtkeychain.patch;hb=HEAD + +--- linphone-desktop-5.2.2/CMakeLists.txt.orig 2024-03-11 18:30:37.000000000 +0100 ++++ linphone-desktop-5.2.2/CMakeLists.txt 2024-03-31 17:21:32.069621299 +0200 +@@ -168,7 +168,7 @@ add_option(OPTION_LIST LIBSECRET_SUPPORT + if(WIN32) + add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name for a workaround with windeployqt" "EQt5Keychain") + else() +- add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name" "Qt5Keychain") ++ add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name" "qt5keychain") + endif() + if(WIN32) + add_option(OPTION_LIST ENABLE_OPENSSL_EXPORT "Enable OpenSSL deployment" YES) +--- linphone-desktop-5.2.2/linphone-app/CMakeLists.txt.orig 2024-03-31 16:15:24.501115462 +0200 ++++ linphone-desktop-5.2.2/linphone-app/CMakeLists.txt 2024-03-31 16:27:54.837050544 +0200 +@@ -118,10 +118,7 @@ set(APP_TARGETS ${LinphoneCxx_TARGET} + #################################### + + if(ENABLE_QT_KEYCHAIN) +- find_package(QtKeychain) +- if(NOT QtKeychain_FOUND) +- find_package(${QTKEYCHAIN_TARGET_NAME} CONFIG REQUIRED) +- endif() ++ find_package(Qt5Keychain) + + add_compile_definitions("ENABLE_QT_KEYCHAIN") + if(QtKeychain_USE_BUILD_INTERFACE) +@@ -197,7 +194,7 @@ if(ENABLE_VIDEO) + endif() + if( ENABLE_QT_KEYCHAIN) + if(NOT QTKEYCHAIN_TARGET_NAME) +- set(QTKEYCHAIN_TARGET_NAME "Qt5Keychain") ++ set(QTKEYCHAIN_TARGET_NAME "qt5keychain") + endif() + list(APPEND APP_TARGETS ${QTKEYCHAIN_TARGET_NAME}) + endif() diff --git a/gnu/packages/patches/linphone-desktop-without-sdk.patch b/gnu/packages/patches/linphone-desktop-without-sdk.patch deleted file mode 100644 index ef61b86707..0000000000 --- a/gnu/packages/patches/linphone-desktop-without-sdk.patch +++ /dev/null @@ -1,214 +0,0 @@ -From cfdf6d1c2051d6a20d0cbb94d81fe398f70dea4d Mon Sep 17 00:00:00 2001 -From: Raghav Gururajan <rg@raghavgururajan.name> -Date: Sun, 21 Mar 2021 21:13:53 -0400 -Subject: [PATCH] [PATCH]: Fix building from git. - ---- - CMakeLists.txt | 73 +------------------ - linphone-app/CMakeLists.txt | 12 +-- - .../cmake_builder/additional_steps.cmake | 2 +- - .../linphone_package/CMakeLists.txt | 38 ---------- - linphone-app/linphoneqt_version.cmake | 1 + - linphone-app/src/config.h.cmake | 1 + - 6 files changed, 6 insertions(+), 121 deletions(-) - create mode 100644 linphone-app/linphoneqt_version.cmake - -diff -ru a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 -+++ b/CMakeLists.txt 2023-04-08 16:00:45.487927870 +0200 -@@ -51,23 +51,6 @@ - - set(CMAKE_CXX_STANDARD 11) - --# Prepare gobal CMAKE configuration specific to the current project --set(SDK_BUILD_DIR "${CMAKE_BINARY_DIR}/WORK") # SDK build in WORK. Keep all in it. --set(LINPHONE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/linphone-sdk/desktop") -- --set(APPLICATION_OUTPUT_DIR "${CMAKE_BINARY_DIR}/OUTPUT") -- --set(CMAKE_PREFIX_PATH "${LINPHONE_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR}/include${PREFIX_PATH}") --if(WIN32) -- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}") --elseif(APPLE) -- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_NAME}.app/Contents/Frameworks") --else() -- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") --endif() --string(REPLACE ";" "|" PREFIX_PATH "${CMAKE_PREFIX_PATH}") --#set(PREFIX_PATH "${LINPHONE_OUTPUT_DIR}|${APPLICATION_OUTPUT_DIR}${PREFIX_PATH}") -- - # Avoid cmake warning if CMP0071 is not set. - if (POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) -@@ -177,10 +160,8 @@ - endif() - list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}") - --list(APPEND APP_OPTIONS "-DLINPHONE_OUTPUT_DIR=${LINPHONE_OUTPUT_DIR}") - list(APPEND APP_OPTIONS "-DENABLE_QT_GL=${ENABLE_VIDEO}")#Activate on video - --include(ExternalProject) - set(PROJECT_BUILD_COMMAND "") - if(CMAKE_BUILD_PARALLEL_LEVEL) - list(APPEND APP_OPTIONS "-DCMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}") -@@ -195,7 +176,6 @@ - endif() - endif() - if(UNIX AND NOT APPLE) -- set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib:${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") - list(APPEND APP_OPTIONS "-DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}") - elseif(APPLE) - list(APPEND APP_OPTIONS "-DENABLE_FAT_BINARY=ON") #Disable XCFrameworks as it is not supported. -@@ -222,28 +202,9 @@ - - - if(NOT LINPHONE_QT_ONLY) --ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk" -- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk" -- INSTALL_DIR "${LINPHONE_OUTPUT_DIR}" -- STAMP_DIR "${SDK_BUILD_DIR}/stamp" -- BINARY_DIR "${SDK_BUILD_DIR}" -- STEP_TARGETS build -- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} -- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." -- LIST_SEPARATOR | # Use the alternate list separator -- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -- BUILD_ALWAYS NO #${DO_BUILD} --) --ExternalProject_Add_Step(sdk force_build -- COMMENT "Forcing build for 'desktop'" -- DEPENDEES configure -- DEPENDERS build -- ALWAYS 1 --) - endif() - include(FindPkgConfig) - --set(APP_DEPENDS sdk) - find_package(Qt5 5.10 COMPONENTS Core REQUIRED) - - if ( NOT Qt5_FOUND ) -@@ -257,62 +218,5 @@ - find_package(Mediastreamer2 CONFIG QUIET) - find_package(ortp CONFIG QUIET) - --if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR FORCE_APP_EXTERNAL_PROJECTS) -- message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install") -- ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app" -- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" -- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" -- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" -- DEPENDS ${APP_DEPENDS} -- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} -- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." -- LIST_SEPARATOR | # Use the alternate list separator -- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -- # ${APP_OPTIONS} -- BUILD_ALWAYS ON -- ) -- if( ENABLE_BUILD_APP_PLUGINS) -- ExternalProject_Add(app-plugins PREFIX "${CMAKE_BINARY_DIR}/plugins-app" -- SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins" -- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" -- BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app" -- DEPENDS linphone-qt -- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} -- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." -- LIST_SEPARATOR | # Use the alternate list separator -- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -- ) -- endif() -- install(CODE "message(STATUS Running install)") -- set(AUTO_REGENERATION auto_regeneration) -- if( ENABLE_BUILD_APP_PLUGINS) -- add_custom_target(${AUTO_REGENERATION} ALL -- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -- DEPENDS app-plugins) -- else() -- add_custom_target(${AUTO_REGENERATION} ALL -- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -- DEPENDS linphone-qt) -- endif() --else() -- message("Adding Linphone Desktop in an IDE-friendly state") -- set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") -- add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) -- if(NOT LINPHONE_QT_ONLY) -- add_dependencies(app-library ${APP_DEPENDS}) -- endif() -- if( ENABLE_BUILD_APP_PLUGINS) -- add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app") -- endif() --endif() --ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app" -- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" -- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" -- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" -- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} --# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." -- LIST_SEPARATOR | # Use the alternate list separator -- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -- EXCLUDE_FROM_ALL ON -- #BUILD_ALWAYS ON --) -+message("Adding Linphone Desktop in an IDE-friendly state") -+add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) -diff -ru a/linphone-app/cmake_builder/additional_steps.cmake ./linphone-app/cmake_builder/additional_steps.cmake ---- a/linphone-app/cmake_builder/additional_steps.cmake 1970-01-01 01:00:01.000000000 +0100 -+++ ./linphone-app/cmake_builder/additional_steps.cmake 2023-04-08 16:02:33.005843116 +0200 -@@ -61,7 +61,7 @@ - SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package" - DOWNLOAD_COMMAND "" - CMAKE_GENERATOR ${CMAKE_GENERATOR} -- CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY} -+ CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY} - ) - endif () - endif () -diff -ru a/linphone-app/CMakeLists.txt ./linphone-app/CMakeLists.txt ---- a/linphone-app/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 -+++ ./linphone-app/CMakeLists.txt 2023-04-08 16:01:32.699012115 +0200 -@@ -21,17 +21,8 @@ - ################################################################################ - cmake_minimum_required(VERSION 3.1) - -+include(linphoneqt_version.cmake) - find_package(bctoolbox CONFIG) --set(FULL_VERSION ) --bc_compute_full_version(FULL_VERSION) --set(version_major ) --set(version_minor ) --set(version_patch ) --set(identifiers ) --set(metadata ) --bc_parse_full_version("${FULL_VERSION}" version_major version_minor version_patch identifiers metadata) -- --project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}") - - - if(ENABLE_BUILD_VERBOSE) -@@ -51,7 +42,6 @@ - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - endif() - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") --list(APPEND CMAKE_MODULE_PATH "${LINPHONE_OUTPUT_DIR}/cmake") - - set(APP_LIBRARY app-library) - set(APP_PLUGIN app-plugin) -diff --git a/linphone-app/linphoneqt_version.cmake b/linphone-app/linphoneqt_version.cmake -new file mode 100644 -index 00000000..a85d3455 ---- /dev/null -+++ b/linphone-app/linphoneqt_version.cmake -@@ -0,0 +1,1 @@ -+project(linphoneqt VERSION ${GUIX-SET-VERSION}) -\ No newline at end of file -diff -ru a/linphone-app/src/config.h.cmake b/linphone-app/src/config.h.cmake ---- a/linphone-app/src/config.h.cmake 1970-01-01 01:00:01.000000000 +0100 -+++ b/linphone-app/src/config.h.cmake 2023-04-08 16:05:33.458349986 +0200 -@@ -32,3 +32,4 @@ - #cmakedefine EXECUTABLE_NAME "${EXECUTABLE_NAME}" - #cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}" - #cmakedefine ENABLE_APP_WEBVIEW "${ENABLE_APP_WEBVIEW}" -+#define LINPHONE_QT_GIT_VERSION "${PROJECT_VERSION}" -\ No newline at end of file diff --git a/gnu/packages/patches/mediastreamer2-cmake-findgsm.patch b/gnu/packages/patches/mediastreamer2-cmake-findgsm.patch new file mode 100644 index 0000000000..7b48e310b5 --- /dev/null +++ b/gnu/packages/patches/mediastreamer2-cmake-findgsm.patch @@ -0,0 +1,63 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/mediastreamer.git;a=blob_plain;f=mediastreamer-cmake-find.patch;h=4f1e3577f43bf791ed5cdb180ca455f919b80c8d;hb=HEAD + +--- mediastreamer2-5.3.29/cmake/FindGSM.cmake.orig 2024-02-21 12:02:03.000000000 +0100 ++++ mediastreamer2-5.3.29/cmake/FindGSM.cmake 2024-03-09 20:16:25.064077414 +0100 +@@ -58,7 +58,7 @@ else() + set(_GSM_ROOT_PATHS ${CMAKE_INSTALL_PREFIX}) + + find_path(_GSM_INCLUDE_DIRS +- NAMES gsm/gsm.h ++ NAMES gsm.h gsm/gsm.h + HINTS ${_GSM_ROOT_PATHS} + PATH_SUFFIXES include + ) +--- mediastreamer2-5.3.29/cmake/FindDav1d.cmake.orig 2024-02-21 12:02:03.000000000 +0100 ++++ mediastreamer2-5.3.29/cmake/FindDav1d.cmake 2024-03-09 20:44:17.671682787 +0100 +@@ -65,17 +65,17 @@ else() + PATH_SUFFIXES bin lib lib/Win32 + ) + +- if(_Dav1d_INCLUDE_DIRS AND _Dav1d_LIBRARY) ++ if(Dav1d_INCLUDE_DIRS AND Dav1d_LIBRARY) + add_library(libdav1d UNKNOWN IMPORTED) + if(WIN32) + set_target_properties(libdav1d PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Dav1d_INCLUDE_DIRS}" +- IMPORTED_IMPLIB "${_Dav1d_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Dav1d_INCLUDE_DIRS}" ++ IMPORTED_IMPLIB "${Dav1d_LIBRARY}" + ) + else() + set_target_properties(libdav1d PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Dav1d_INCLUDE_DIRS}" +- IMPORTED_LOCATION "${_Dav1d_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Dav1d_INCLUDE_DIRS}" ++ IMPORTED_LOCATION "${Dav1d_LIBRARY}" + ) + endif() + +--- mediastreamer2-5.3.29/cmake/FindAom.cmake.orig 2024-02-21 12:02:03.000000000 +0100 ++++ mediastreamer2-5.3.29/cmake/FindAom.cmake 2024-03-09 20:45:16.931361750 +0100 +@@ -65,17 +65,17 @@ else() + PATH_SUFFIXES bin lib lib/Win32 + ) + +- if(_Aom_INCLUDE_DIRS AND _Aom_LIBRARY) ++ if(Aom_INCLUDE_DIRS AND Aom_LIBRARY) + add_library(aom UNKNOWN IMPORTED) + if(WIN32) + set_target_properties(aom PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Aom_INCLUDE_DIRS}" +- IMPORTED_IMPLIB "${_Aom_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Aom_INCLUDE_DIRS}" ++ IMPORTED_IMPLIB "${Aom_LIBRARY}" + ) + else() + set_target_properties(aom PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Aom_INCLUDE_DIRS}" +- IMPORTED_LOCATION "${_Aom_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Aom_INCLUDE_DIRS}" ++ IMPORTED_LOCATION "${Aom_LIBRARY}" + ) + endif() + diff --git a/gnu/packages/patches/mswebrtc-b64-refactor.patch b/gnu/packages/patches/mswebrtc-b64-refactor.patch new file mode 100644 index 0000000000..af4a1e1682 --- /dev/null +++ b/gnu/packages/patches/mswebrtc-b64-refactor.patch @@ -0,0 +1,949 @@ +From 17e72f00831a36da387ceafe7f3076ffa8f66aba Mon Sep 17 00:00:00 2001 +From: Clemence Him <clemence.him@belledonne-communications.com> +Date: Fri, 22 Sep 2023 14:28:02 +0200 +Subject: [PATCH] Base64 functions refactoring + +--- + aec.c | 781 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 394 insertions(+), 387 deletions(-) + +diff --git a/aec.c b/aec.c +index 271f370..995f655 100644 +--- a/aec.c ++++ b/aec.c +@@ -24,19 +24,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + #include "mediastreamer2/msfilter.h" + #include "mediastreamer2/msticker.h" + #ifdef BUILD_AEC +-#include "echo_cancellation.h" + #include "aec_splitting_filter.h" ++#include "echo_cancellation.h" + #endif + #ifdef BUILD_AECM + #include "echo_control_mobile.h" + #endif +-#include "ortp/b64.h" + + #ifdef _WIN32 + #include <malloc.h> /* for alloca */ + #endif + +-//#define EC_DUMP 1 ++// #define EC_DUMP 1 + #ifdef ANDROID + #define EC_DUMP_PREFIX "/sdcard" + #else +@@ -48,466 +47,485 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + static const float smooth_factor = 0.05f; + static const int framesize = 80; + +- + typedef enum _WebRTCAECType { +- WebRTCAECTypeNormal, +- WebRTCAECTypeMobile ++ WebRTCAECTypeNormal, ++ WebRTCAECTypeMobile + } WebRTCAECType; + + typedef struct WebRTCAECState { +- void *aecInst; +- MSBufferizer delayed_ref; +- MSFlowControlledBufferizer ref; +- MSBufferizer echo; +- int framesize; +- int samplerate; +- int delay_ms; +- int nominal_ref_samples; +- char *state_str; ++ void *aecInst; ++ MSBufferizer delayed_ref; ++ MSFlowControlledBufferizer ref; ++ MSBufferizer echo; ++ int framesize; ++ int samplerate; ++ int delay_ms; ++ int nominal_ref_samples; ++ char *state_str; + #ifdef EC_DUMP +- FILE *echofile; +- FILE *reffile; +- FILE *cleanfile; ++ FILE *echofile; ++ FILE *reffile; ++ FILE *cleanfile; + #endif +- bool_t echostarted; +- bool_t bypass_mode; +- bool_t using_zeroes; +- WebRTCAECType aec_type; ++ bool_t echostarted; ++ bool_t bypass_mode; ++ bool_t using_zeroes; ++ WebRTCAECType aec_type; + #ifdef BUILD_AEC +- MSWebRtcAecSplittingFilter *splitting_filter; ++ MSWebRtcAecSplittingFilter *splitting_filter; + #endif + } WebRTCAECState; + + static void webrtc_aecgeneric_init(MSFilter *f, WebRTCAECType aec_type) { +- WebRTCAECState *s = (WebRTCAECState *) ms_new0(WebRTCAECState, 1); +- +- s->samplerate = 8000; +- ms_bufferizer_init(&s->delayed_ref); +- ms_bufferizer_init(&s->echo); +- ms_flow_controlled_bufferizer_init(&s->ref, f, s->samplerate, 1); +- s->delay_ms = 0; +- s->aecInst = NULL; +- s->framesize = framesize; +- s->state_str = NULL; +- s->using_zeroes = FALSE; +- s->echostarted = FALSE; +- s->bypass_mode = FALSE; +- s->aec_type = aec_type; ++ WebRTCAECState *s = (WebRTCAECState *)ms_new0(WebRTCAECState, 1); ++ ++ s->samplerate = 8000; ++ ms_bufferizer_init(&s->delayed_ref); ++ ms_bufferizer_init(&s->echo); ++ ms_flow_controlled_bufferizer_init(&s->ref, f, s->samplerate, 1); ++ s->delay_ms = 0; ++ s->aecInst = NULL; ++ s->framesize = framesize; ++ s->state_str = NULL; ++ s->using_zeroes = FALSE; ++ s->echostarted = FALSE; ++ s->bypass_mode = FALSE; ++ s->aec_type = aec_type; + + #ifdef EC_DUMP +- { +- char *fname = ms_strdup_printf("%s/mswebrtcaec-%p-echo.raw", EC_DUMP_PREFIX, f); +- s->echofile = fopen(fname, "w"); +- ms_free(fname); +- fname = ms_strdup_printf("%s/mswebrtcaec-%p-ref.raw", EC_DUMP_PREFIX, f); +- s->reffile = fopen(fname, "w"); +- ms_free(fname); +- fname = ms_strdup_printf("%s/mswebrtcaec-%p-clean.raw", EC_DUMP_PREFIX, f); +- s->cleanfile = fopen(fname, "w"); +- ms_free(fname); +- } ++ { ++ char *fname = ++ ms_strdup_printf("%s/mswebrtcaec-%p-echo.raw", EC_DUMP_PREFIX, f); ++ s->echofile = fopen(fname, "w"); ++ ms_free(fname); ++ fname = ms_strdup_printf("%s/mswebrtcaec-%p-ref.raw", EC_DUMP_PREFIX, f); ++ s->reffile = fopen(fname, "w"); ++ ms_free(fname); ++ fname = ms_strdup_printf("%s/mswebrtcaec-%p-clean.raw", EC_DUMP_PREFIX, f); ++ s->cleanfile = fopen(fname, "w"); ++ ms_free(fname); ++ } + #endif + +- f->data = s; ++ f->data = s; + } + + #ifdef BUILD_AEC + static void webrtc_aec_init(MSFilter *f) { +- webrtc_aecgeneric_init(f, WebRTCAECTypeNormal); ++ webrtc_aecgeneric_init(f, WebRTCAECTypeNormal); + } + #endif + + #ifdef BUILD_AECM + static void webrtc_aecm_init(MSFilter *f) { +- webrtc_aecgeneric_init(f, WebRTCAECTypeMobile); ++ webrtc_aecgeneric_init(f, WebRTCAECTypeMobile); + } + #endif + + static void webrtc_aec_uninit(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- if (s->state_str) ms_free(s->state_str); +- ms_bufferizer_uninit(&s->delayed_ref); ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ if (s->state_str) ++ ms_free(s->state_str); ++ ms_bufferizer_uninit(&s->delayed_ref); + #ifdef EC_DUMP +- if (s->echofile) +- fclose(s->echofile); +- if (s->reffile) +- fclose(s->reffile); ++ if (s->echofile) ++ fclose(s->echofile); ++ if (s->reffile) ++ fclose(s->reffile); + #endif +- ms_free(s); ++ ms_free(s); + } + + static void configure_flow_controlled_bufferizer(WebRTCAECState *s) { +- ms_flow_controlled_bufferizer_set_samplerate(&s->ref, s->samplerate); +- ms_flow_controlled_bufferizer_set_max_size_ms(&s->ref, s->delay_ms); +- ms_flow_controlled_bufferizer_set_granularity_ms(&s->ref, (s->framesize * 1000) / s->samplerate); ++ ms_flow_controlled_bufferizer_set_samplerate(&s->ref, s->samplerate); ++ ms_flow_controlled_bufferizer_set_max_size_ms(&s->ref, s->delay_ms); ++ ms_flow_controlled_bufferizer_set_granularity_ms( ++ &s->ref, (s->framesize * 1000) / s->samplerate); + } + + static void webrtc_aec_preprocess(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; + #ifdef BUILD_AEC +- AecConfig aec_config; ++ AecConfig aec_config; + #endif + #ifdef BUILD_AECM +- AecmConfig aecm_config; +- int error_code; ++ AecmConfig aecm_config; ++ int error_code; + #endif +- int delay_samples = 0; +- mblk_t *m; ++ int delay_samples = 0; ++ mblk_t *m; + +- s->echostarted = FALSE; +- delay_samples = s->delay_ms * s->samplerate / 1000; +- s->framesize=(framesize*s->samplerate)/8000; +- ms_message("Initializing WebRTC echo canceler with framesize=%i, delay_ms=%i, delay_samples=%i", s->framesize, s->delay_ms, delay_samples); +- configure_flow_controlled_bufferizer(s); ++ s->echostarted = FALSE; ++ delay_samples = s->delay_ms * s->samplerate / 1000; ++ s->framesize = (framesize * s->samplerate) / 8000; ++ ms_message("Initializing WebRTC echo canceler with framesize=%i, " ++ "delay_ms=%i, delay_samples=%i", ++ s->framesize, s->delay_ms, delay_samples); ++ configure_flow_controlled_bufferizer(s); + + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- if ((s->aecInst = WebRtcAec_Create()) == NULL) { +- s->bypass_mode = TRUE; +- ms_error("WebRtcAec_Create(): error, entering bypass mode"); +- return; +- } +- if ((WebRtcAec_Init(s->aecInst, MIN(48000, s->samplerate), s->samplerate)) < 0) { +- ms_error("WebRtcAec_Init(): WebRTC echo canceller does not support %d samplerate", s->samplerate); +- s->bypass_mode = TRUE; +- ms_error("Entering bypass mode"); +- return; +- } +- aec_config.nlpMode = kAecNlpAggressive; +- aec_config.skewMode = kAecFalse; +- aec_config.metricsMode = kAecFalse; +- aec_config.delay_logging = kAecFalse; +- if (WebRtcAec_set_config(s->aecInst, aec_config) != 0) { +- ms_error("WebRtcAec_set_config(): failed."); +- } +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ if ((s->aecInst = WebRtcAec_Create()) == NULL) { ++ s->bypass_mode = TRUE; ++ ms_error("WebRtcAec_Create(): error, entering bypass mode"); ++ return; ++ } ++ if ((WebRtcAec_Init(s->aecInst, MIN(48000, s->samplerate), s->samplerate)) < ++ 0) { ++ ms_error("WebRtcAec_Init(): WebRTC echo canceller does not support %d " ++ "samplerate", ++ s->samplerate); ++ s->bypass_mode = TRUE; ++ ms_error("Entering bypass mode"); ++ return; ++ } ++ aec_config.nlpMode = kAecNlpAggressive; ++ aec_config.skewMode = kAecFalse; ++ aec_config.metricsMode = kAecFalse; ++ aec_config.delay_logging = kAecFalse; ++ if (WebRtcAec_set_config(s->aecInst, aec_config) != 0) { ++ ms_error("WebRtcAec_set_config(): failed."); ++ } ++ } + #endif + #ifdef BUILD_AECM +- if (s->aec_type == WebRTCAECTypeMobile) { +- if ((s->aecInst = WebRtcAecm_Create()) == NULL) { +- s->bypass_mode = TRUE; +- ms_error("WebRtcAecm_Create(): error, entering bypass mode"); +- return; +- } +- if ((error_code = WebRtcAecm_Init(s->aecInst, s->samplerate)) < 0) { +- if (error_code == AECM_BAD_PARAMETER_ERROR) { +- ms_error("WebRtcAecm_Init(): WebRTC echo canceller does not support %d samplerate", s->samplerate); +- } +- s->bypass_mode = TRUE; +- ms_error("Entering bypass mode"); +- return; +- } +- aecm_config.cngMode = TRUE; +- aecm_config.echoMode = 3; +- if (WebRtcAecm_set_config(s->aecInst, aecm_config)!=0){ +- ms_error("WebRtcAecm_set_config(): failed."); +- } +- } ++ if (s->aec_type == WebRTCAECTypeMobile) { ++ if ((s->aecInst = WebRtcAecm_Create()) == NULL) { ++ s->bypass_mode = TRUE; ++ ms_error("WebRtcAecm_Create(): error, entering bypass mode"); ++ return; ++ } ++ if ((error_code = WebRtcAecm_Init(s->aecInst, s->samplerate)) < 0) { ++ if (error_code == AECM_BAD_PARAMETER_ERROR) { ++ ms_error("WebRtcAecm_Init(): WebRTC echo canceller does not support %d " ++ "samplerate", ++ s->samplerate); ++ } ++ s->bypass_mode = TRUE; ++ ms_error("Entering bypass mode"); ++ return; ++ } ++ aecm_config.cngMode = TRUE; ++ aecm_config.echoMode = 3; ++ if (WebRtcAecm_set_config(s->aecInst, aecm_config) != 0) { ++ ms_error("WebRtcAecm_set_config(): failed."); ++ } ++ } + #endif + +- /* fill with zeroes for the time of the delay*/ +- m = allocb(delay_samples * 2, 0); +- m->b_wptr += delay_samples * 2; +- ms_bufferizer_put(&s->delayed_ref, m); +- s->nominal_ref_samples = delay_samples; ++ /* fill with zeroes for the time of the delay*/ ++ m = allocb(delay_samples * 2, 0); ++ m->b_wptr += delay_samples * 2; ++ ms_bufferizer_put(&s->delayed_ref, m); ++ s->nominal_ref_samples = delay_samples; + } + + /* inputs[0]= reference signal from far end (sent to soundcard) + * inputs[1]= near speech & echo signal (read from soundcard) + * outputs[0]= is a copy of inputs[0] to be sent to soundcard + * outputs[1]= near end speech, echo removed - towards far end +-*/ ++ */ + static void webrtc_aec_process(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- int nbytes = s->framesize * sizeof(int16_t); +- mblk_t *refm; +- int16_t *ref, *echo; +- int nbands = 1; +- int bandsize = s->framesize; +- +- if (s->bypass_mode) { +- while ((refm = ms_queue_get(f->inputs[0])) != NULL) { +- ms_queue_put(f->outputs[0], refm); +- } +- while ((refm = ms_queue_get(f->inputs[1])) != NULL) { +- ms_queue_put(f->outputs[1], refm); +- } +- return; +- } +- +- if (f->inputs[0] != NULL) { +- if (s->echostarted) { +- while ((refm = ms_queue_get(f->inputs[0])) != NULL) { +- mblk_t *cp=dupmsg(refm); +- ms_bufferizer_put(&s->delayed_ref,cp); +- ms_flow_controlled_bufferizer_put(&s->ref,refm); +- } +- } else { +- ms_warning("Getting reference signal but no echo to synchronize on."); +- ms_queue_flush(f->inputs[0]); +- } +- } +- +- ms_bufferizer_put_from_queue(&s->echo, f->inputs[1]); +- +- ref = (int16_t *) alloca(nbytes); +- echo = (int16_t *) alloca(nbytes); ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ int nbytes = s->framesize * sizeof(int16_t); ++ mblk_t *refm; ++ int16_t *ref, *echo; ++ int nbands = 1; ++ int bandsize = s->framesize; ++ ++ if (s->bypass_mode) { ++ while ((refm = ms_queue_get(f->inputs[0])) != NULL) { ++ ms_queue_put(f->outputs[0], refm); ++ } ++ while ((refm = ms_queue_get(f->inputs[1])) != NULL) { ++ ms_queue_put(f->outputs[1], refm); ++ } ++ return; ++ } ++ ++ if (f->inputs[0] != NULL) { ++ if (s->echostarted) { ++ while ((refm = ms_queue_get(f->inputs[0])) != NULL) { ++ mblk_t *cp = dupmsg(refm); ++ ms_bufferizer_put(&s->delayed_ref, cp); ++ ms_flow_controlled_bufferizer_put(&s->ref, refm); ++ } ++ } else { ++ ms_warning("Getting reference signal but no echo to synchronize on."); ++ ms_queue_flush(f->inputs[0]); ++ } ++ } ++ ++ ms_bufferizer_put_from_queue(&s->echo, f->inputs[1]); ++ ++ ref = (int16_t *)alloca(nbytes); ++ echo = (int16_t *)alloca(nbytes); + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- if (s->samplerate > 16000) { +- nbands = s->samplerate / 16000; +- bandsize = 160; +- } +- if (!s->splitting_filter) { +- s->splitting_filter = mswebrtc_aec_splitting_filter_create(nbands, bandsize); +- } +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ if (s->samplerate > 16000) { ++ nbands = s->samplerate / 16000; ++ bandsize = 160; ++ } ++ if (!s->splitting_filter) { ++ s->splitting_filter = ++ mswebrtc_aec_splitting_filter_create(nbands, bandsize); ++ } ++ } + #endif +- while (ms_bufferizer_read(&s->echo, (uint8_t *)echo, (size_t)nbytes) >= (size_t)nbytes) { +- mblk_t *oecho = allocb(nbytes, 0); +- int avail; +- int avail_samples; +- +- if (!s->echostarted) s->echostarted = TRUE; +- if ((avail = ms_bufferizer_get_avail(&s->delayed_ref)) < ((s->nominal_ref_samples * 2) + nbytes)) { +- /*we don't have enough to read in a reference signal buffer, inject silence instead*/ +- refm = allocb(nbytes, 0); +- memset(refm->b_wptr, 0, nbytes); +- refm->b_wptr += nbytes; +- ms_bufferizer_put(&s->delayed_ref, refm); +- /* +- * However, we don't inject this silence buffer to the sound card, in order to break the following bad loop: +- * - the sound playback filter detects it has too many pending samples, then triggers an event to request samples to be dropped upstream. +- * - the upstream MSFlowControl filter is requested to drop samples, which it starts to do. +- * - necessarily shortly after the AEC goes into a situation where it has not enough reference samples while processing an audio buffer from mic. +- * - if the AEC injects a silence buffer as output, then it will RECREATE a situation where the sound playback filter has too many pending samples. +- * That's why we should not do this. +- * By not doing this, we will create a discrepancy between what we really injected to the soundcard, and what we told to the +- * echo canceller about the samples we injected. This shifts the echo. The echo canceller will re-converge quickly to take into +- * account the situation. +- * +- */ +- //ms_queue_put(f->outputs[0], dupmsg(refm)); +- if (!s->using_zeroes) { +- ms_warning("Not enough ref samples, using zeroes"); +- s->using_zeroes = TRUE; +- } +- } else { +- if (s->using_zeroes) { +- ms_message("Samples are back."); +- s->using_zeroes = FALSE; +- } +- /* read from our no-delay buffer and output */ +- refm = allocb(nbytes, 0); +- if (ms_flow_controlled_bufferizer_read(&s->ref, refm->b_wptr, nbytes) == 0) { +- ms_fatal("Should never happen"); +- } +- refm->b_wptr += nbytes; +- ms_queue_put(f->outputs[0], refm); +- } +- +- /*now read a valid buffer of delayed ref samples*/ +- if (ms_bufferizer_read(&s->delayed_ref, (uint8_t *)ref, nbytes) == 0) { +- ms_fatal("Should never happen"); +- } +- avail -= nbytes; +- avail_samples = avail / 2; ++ while (ms_bufferizer_read(&s->echo, (uint8_t *)echo, (size_t)nbytes) >= ++ (size_t)nbytes) { ++ mblk_t *oecho = allocb(nbytes, 0); ++ int avail; ++ int avail_samples; ++ ++ if (!s->echostarted) ++ s->echostarted = TRUE; ++ if ((avail = ms_bufferizer_get_avail(&s->delayed_ref)) < ++ ((s->nominal_ref_samples * 2) + nbytes)) { ++ /*we don't have enough to read in a reference signal buffer, inject ++ * silence instead*/ ++ refm = allocb(nbytes, 0); ++ memset(refm->b_wptr, 0, nbytes); ++ refm->b_wptr += nbytes; ++ ms_bufferizer_put(&s->delayed_ref, refm); ++ /* ++ * However, we don't inject this silence buffer to the sound card, in ++ * order to break the following bad loop: ++ * - the sound playback filter detects it has too many pending samples, ++ * then triggers an event to request samples to be dropped upstream. ++ * - the upstream MSFlowControl filter is requested to drop samples, which ++ * it starts to do. ++ * - necessarily shortly after the AEC goes into a situation where it has ++ * not enough reference samples while processing an audio buffer from mic. ++ * - if the AEC injects a silence buffer as output, then it will RECREATE ++ * a situation where the sound playback filter has too many pending ++ * samples. That's why we should not do this. By not doing this, we will ++ * create a discrepancy between what we really injected to the soundcard, ++ * and what we told to the echo canceller about the samples we injected. ++ * This shifts the echo. The echo canceller will re-converge quickly to ++ * take into account the situation. ++ * ++ */ ++ // ms_queue_put(f->outputs[0], dupmsg(refm)); ++ if (!s->using_zeroes) { ++ ms_warning("Not enough ref samples, using zeroes"); ++ s->using_zeroes = TRUE; ++ } ++ } else { ++ if (s->using_zeroes) { ++ ms_message("Samples are back."); ++ s->using_zeroes = FALSE; ++ } ++ /* read from our no-delay buffer and output */ ++ refm = allocb(nbytes, 0); ++ if (ms_flow_controlled_bufferizer_read(&s->ref, refm->b_wptr, nbytes) == ++ 0) { ++ ms_fatal("Should never happen"); ++ } ++ refm->b_wptr += nbytes; ++ ms_queue_put(f->outputs[0], refm); ++ } ++ ++ /*now read a valid buffer of delayed ref samples*/ ++ if (ms_bufferizer_read(&s->delayed_ref, (uint8_t *)ref, nbytes) == 0) { ++ ms_fatal("Should never happen"); ++ } ++ avail -= nbytes; ++ avail_samples = avail / 2; + + #ifdef EC_DUMP +- if (s->reffile) +- fwrite(ref, nbytes, 1, s->reffile); +- if (s->echofile) +- fwrite(echo, nbytes, 1, s->echofile); ++ if (s->reffile) ++ fwrite(ref, nbytes, 1, s->reffile); ++ if (s->echofile) ++ fwrite(echo, nbytes, 1, s->echofile); + #endif + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- mswebrtc_aec_splitting_filter_analysis(s->splitting_filter, ref, echo); +- if (WebRtcAec_BufferFarend(s->aecInst, +- mswebrtc_aec_splitting_filter_get_ref(s->splitting_filter), +- (size_t)mswebrtc_aec_splitting_filter_get_bandsize(s->splitting_filter)) != 0) +- ms_error("WebRtcAec_BufferFarend() failed."); +- if (WebRtcAec_Process(s->aecInst, +- mswebrtc_aec_splitting_filter_get_echo_bands(s->splitting_filter), +- mswebrtc_aec_splitting_filter_get_number_of_bands(s->splitting_filter), +- mswebrtc_aec_splitting_filter_get_output_bands(s->splitting_filter), +- (size_t)mswebrtc_aec_splitting_filter_get_bandsize(s->splitting_filter), 0, 0) != 0) +- ms_error("WebRtcAec_Process() failed."); +- mswebrtc_aec_splitting_filter_synthesis(s->splitting_filter, (int16_t *)oecho->b_wptr); +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ mswebrtc_aec_splitting_filter_analysis(s->splitting_filter, ref, echo); ++ if (WebRtcAec_BufferFarend( ++ s->aecInst, ++ mswebrtc_aec_splitting_filter_get_ref(s->splitting_filter), ++ (size_t)mswebrtc_aec_splitting_filter_get_bandsize( ++ s->splitting_filter)) != 0) ++ ms_error("WebRtcAec_BufferFarend() failed."); ++ if (WebRtcAec_Process( ++ s->aecInst, ++ mswebrtc_aec_splitting_filter_get_echo_bands(s->splitting_filter), ++ mswebrtc_aec_splitting_filter_get_number_of_bands( ++ s->splitting_filter), ++ mswebrtc_aec_splitting_filter_get_output_bands( ++ s->splitting_filter), ++ (size_t)mswebrtc_aec_splitting_filter_get_bandsize( ++ s->splitting_filter), ++ 0, 0) != 0) ++ ms_error("WebRtcAec_Process() failed."); ++ mswebrtc_aec_splitting_filter_synthesis(s->splitting_filter, ++ (int16_t *)oecho->b_wptr); ++ } + #endif + #ifdef BUILD_AECM +- if (s->aec_type == WebRTCAECTypeMobile) { +- if (WebRtcAecm_BufferFarend(s->aecInst, ref, (size_t)s->framesize) != 0) +- ms_error("WebRtcAecm_BufferFarend() failed."); +- if (WebRtcAecm_Process(s->aecInst, echo, NULL, (int16_t *)oecho->b_wptr, (size_t)s->framesize, 0) != 0) +- ms_error("WebRtcAecm_Process() failed."); +- } ++ if (s->aec_type == WebRTCAECTypeMobile) { ++ if (WebRtcAecm_BufferFarend(s->aecInst, ref, (size_t)s->framesize) != 0) ++ ms_error("WebRtcAecm_BufferFarend() failed."); ++ if (WebRtcAecm_Process(s->aecInst, echo, NULL, (int16_t *)oecho->b_wptr, ++ (size_t)s->framesize, 0) != 0) ++ ms_error("WebRtcAecm_Process() failed."); ++ } + #endif + #ifdef EC_DUMP +- if (s->cleanfile) +- fwrite(oecho->b_wptr, nbytes, 1, s->cleanfile); ++ if (s->cleanfile) ++ fwrite(oecho->b_wptr, nbytes, 1, s->cleanfile); + #endif +- oecho->b_wptr += nbytes; +- ms_queue_put(f->outputs[1], oecho); +- } ++ oecho->b_wptr += nbytes; ++ ms_queue_put(f->outputs[1], oecho); ++ } + } + + static void webrtc_aec_postprocess(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; + +- ms_bufferizer_flush(&s->delayed_ref); +- ms_bufferizer_flush(&s->echo); +- ms_flow_controlled_bufferizer_flush(&s->ref); ++ ms_bufferizer_flush(&s->delayed_ref); ++ ms_bufferizer_flush(&s->echo); ++ ms_flow_controlled_bufferizer_flush(&s->ref); + #ifdef BUILD_AEC +- if (s->splitting_filter) { +- mswebrtc_aec_splitting_filter_destroy(s->splitting_filter); +- s->splitting_filter = NULL; +- } ++ if (s->splitting_filter) { ++ mswebrtc_aec_splitting_filter_destroy(s->splitting_filter); ++ s->splitting_filter = NULL; ++ } + #endif +- if (s->aecInst != NULL) { ++ if (s->aecInst != NULL) { + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- WebRtcAec_Free(s->aecInst); +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ WebRtcAec_Free(s->aecInst); ++ } + #endif + #ifdef BUILD_AECM +- if (s->aec_type == WebRTCAECTypeMobile) { +- WebRtcAecm_Free(s->aecInst); +- } ++ if (s->aec_type == WebRTCAECTypeMobile) { ++ WebRtcAecm_Free(s->aecInst); ++ } + #endif +- s->aecInst = NULL; +- } ++ s->aecInst = NULL; ++ } + } + + static int webrtc_aec_set_sr(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- int requested_sr = *(int *) arg; +- int sr = requested_sr; +- +- if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 48000)) { +- sr = 48000; +- } else if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 32000)) { +- sr = 32000; +- } else if (requested_sr >= 16000) { +- sr = 16000; +- } else { +- sr = 8000; +- } +- if (sr != requested_sr) +- ms_message("Webrtc %s does not support sampling rate %i, using %i instead", ((s->aec_type == WebRTCAECTypeNormal)?"aec":"aecm"),requested_sr, sr); +- +- s->samplerate = sr; +- configure_flow_controlled_bufferizer(s); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ int requested_sr = *(int *)arg; ++ int sr = requested_sr; ++ ++ if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 48000)) { ++ sr = 48000; ++ } else if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 32000)) { ++ sr = 32000; ++ } else if (requested_sr >= 16000) { ++ sr = 16000; ++ } else { ++ sr = 8000; ++ } ++ if (sr != requested_sr) ++ ms_message("Webrtc %s does not support sampling rate %i, using %i instead", ++ ((s->aec_type == WebRTCAECTypeNormal) ? "aec" : "aecm"), ++ requested_sr, sr); ++ ++ s->samplerate = sr; ++ configure_flow_controlled_bufferizer(s); ++ return 0; + } + + static int webrtc_aec_get_sr(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- *(int *) arg=s->samplerate; +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ *(int *)arg = s->samplerate; ++ return 0; + } + + static int webrtc_aec_set_framesize(MSFilter *f, void *arg) { +- /* Do nothing because the WebRTC echo canceller only accept specific values: 80 and 160. We use 80 at 8khz, and 160 at 16khz */ +- return 0; ++ /* Do nothing because the WebRTC echo canceller only accept specific values: ++ * 80 and 160. We use 80 at 8khz, and 160 at 16khz */ ++ return 0; + } + + static int webrtc_aec_set_delay(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- s->delay_ms = *(int *) arg; +- configure_flow_controlled_bufferizer(s); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ s->delay_ms = *(int *)arg; ++ configure_flow_controlled_bufferizer(s); ++ return 0; + } + + static int webrtc_aec_set_tail_length(MSFilter *f, void *arg) { +- /* Do nothing because this is not needed by the WebRTC echo canceller. */ +- return 0; ++ /* Do nothing because this is not needed by the WebRTC echo canceller. */ ++ return 0; + } + static int webrtc_aec_set_bypass_mode(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- s->bypass_mode = *(bool_t *) arg; +- ms_message("set EC bypass mode to [%i]", s->bypass_mode); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ s->bypass_mode = *(bool_t *)arg; ++ ms_message("set EC bypass mode to [%i]", s->bypass_mode); ++ return 0; + } + static int webrtc_aec_get_bypass_mode(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- *(bool_t *) arg = s->bypass_mode; +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ *(bool_t *)arg = s->bypass_mode; ++ return 0; + } + + static int webrtc_aec_set_state(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- s->state_str = ms_strdup((const char *) arg); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ s->state_str = ms_strdup((const char *)arg); ++ return 0; + } + + static int webrtc_aec_get_state(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- *(char **) arg = s->state_str; +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ *(char **)arg = s->state_str; ++ return 0; + } + + static MSFilterMethod webrtc_aec_methods[] = { +- { MS_FILTER_SET_SAMPLE_RATE , webrtc_aec_set_sr }, +- { MS_FILTER_GET_SAMPLE_RATE , webrtc_aec_get_sr }, +- { MS_ECHO_CANCELLER_SET_TAIL_LENGTH , webrtc_aec_set_tail_length }, +- { MS_ECHO_CANCELLER_SET_DELAY , webrtc_aec_set_delay }, +- { MS_ECHO_CANCELLER_SET_FRAMESIZE , webrtc_aec_set_framesize }, +- { MS_ECHO_CANCELLER_SET_BYPASS_MODE , webrtc_aec_set_bypass_mode }, +- { MS_ECHO_CANCELLER_GET_BYPASS_MODE , webrtc_aec_get_bypass_mode }, +- { MS_ECHO_CANCELLER_GET_STATE_STRING , webrtc_aec_get_state }, +- { MS_ECHO_CANCELLER_SET_STATE_STRING , webrtc_aec_set_state }, +- { 0, NULL } +-}; +- ++ {MS_FILTER_SET_SAMPLE_RATE, webrtc_aec_set_sr}, ++ {MS_FILTER_GET_SAMPLE_RATE, webrtc_aec_get_sr}, ++ {MS_ECHO_CANCELLER_SET_TAIL_LENGTH, webrtc_aec_set_tail_length}, ++ {MS_ECHO_CANCELLER_SET_DELAY, webrtc_aec_set_delay}, ++ {MS_ECHO_CANCELLER_SET_FRAMESIZE, webrtc_aec_set_framesize}, ++ {MS_ECHO_CANCELLER_SET_BYPASS_MODE, webrtc_aec_set_bypass_mode}, ++ {MS_ECHO_CANCELLER_GET_BYPASS_MODE, webrtc_aec_get_bypass_mode}, ++ {MS_ECHO_CANCELLER_GET_STATE_STRING, webrtc_aec_get_state}, ++ {MS_ECHO_CANCELLER_SET_STATE_STRING, webrtc_aec_set_state}, ++ {0, NULL}}; + + #ifdef BUILD_AEC + +-#define MS_WEBRTC_AEC_NAME "MSWebRTCAEC" ++#define MS_WEBRTC_AEC_NAME "MSWebRTCAEC" + #define MS_WEBRTC_AEC_DESCRIPTION "Echo canceller using WebRTC library." +-#define MS_WEBRTC_AEC_CATEGORY MS_FILTER_OTHER +-#define MS_WEBRTC_AEC_ENC_FMT NULL +-#define MS_WEBRTC_AEC_NINPUTS 2 +-#define MS_WEBRTC_AEC_NOUTPUTS 2 +-#define MS_WEBRTC_AEC_FLAGS 0 ++#define MS_WEBRTC_AEC_CATEGORY MS_FILTER_OTHER ++#define MS_WEBRTC_AEC_ENC_FMT NULL ++#define MS_WEBRTC_AEC_NINPUTS 2 ++#define MS_WEBRTC_AEC_NOUTPUTS 2 ++#define MS_WEBRTC_AEC_FLAGS 0 + + #ifdef _MSC_VER + + MSFilterDesc ms_webrtc_aec_desc = { +- MS_FILTER_PLUGIN_ID, +- MS_WEBRTC_AEC_NAME, +- MS_WEBRTC_AEC_DESCRIPTION, +- MS_WEBRTC_AEC_CATEGORY, +- MS_WEBRTC_AEC_ENC_FMT, +- MS_WEBRTC_AEC_NINPUTS, +- MS_WEBRTC_AEC_NOUTPUTS, +- webrtc_aec_init, +- webrtc_aec_preprocess, +- webrtc_aec_process, +- webrtc_aec_postprocess, +- webrtc_aec_uninit, +- webrtc_aec_methods, +- MS_WEBRTC_AEC_FLAGS +-}; ++ MS_FILTER_PLUGIN_ID, MS_WEBRTC_AEC_NAME, MS_WEBRTC_AEC_DESCRIPTION, ++ MS_WEBRTC_AEC_CATEGORY, MS_WEBRTC_AEC_ENC_FMT, MS_WEBRTC_AEC_NINPUTS, ++ MS_WEBRTC_AEC_NOUTPUTS, webrtc_aec_init, webrtc_aec_preprocess, ++ webrtc_aec_process, webrtc_aec_postprocess, webrtc_aec_uninit, ++ webrtc_aec_methods, MS_WEBRTC_AEC_FLAGS}; + + #else + +-MSFilterDesc ms_webrtc_aec_desc = { +- .id = MS_FILTER_PLUGIN_ID, +- .name = MS_WEBRTC_AEC_NAME, +- .text = MS_WEBRTC_AEC_DESCRIPTION, +- .category = MS_WEBRTC_AEC_CATEGORY, +- .enc_fmt = MS_WEBRTC_AEC_ENC_FMT, +- .ninputs = MS_WEBRTC_AEC_NINPUTS, +- .noutputs = MS_WEBRTC_AEC_NOUTPUTS, +- .init = webrtc_aec_init, +- .preprocess = webrtc_aec_preprocess, +- .process = webrtc_aec_process, +- .postprocess = webrtc_aec_postprocess, +- .uninit = webrtc_aec_uninit, +- .methods = webrtc_aec_methods, +- .flags = MS_WEBRTC_AEC_FLAGS +-}; ++MSFilterDesc ms_webrtc_aec_desc = {.id = MS_FILTER_PLUGIN_ID, ++ .name = MS_WEBRTC_AEC_NAME, ++ .text = MS_WEBRTC_AEC_DESCRIPTION, ++ .category = MS_WEBRTC_AEC_CATEGORY, ++ .enc_fmt = MS_WEBRTC_AEC_ENC_FMT, ++ .ninputs = MS_WEBRTC_AEC_NINPUTS, ++ .noutputs = MS_WEBRTC_AEC_NOUTPUTS, ++ .init = webrtc_aec_init, ++ .preprocess = webrtc_aec_preprocess, ++ .process = webrtc_aec_process, ++ .postprocess = webrtc_aec_postprocess, ++ .uninit = webrtc_aec_uninit, ++ .methods = webrtc_aec_methods, ++ .flags = MS_WEBRTC_AEC_FLAGS}; + + #endif + +@@ -517,51 +535,40 @@ MS_FILTER_DESC_EXPORT(ms_webrtc_aec_desc) + + #ifdef BUILD_AECM + +-#define MS_WEBRTC_AECM_NAME "MSWebRTCAECM" +-#define MS_WEBRTC_AECM_DESCRIPTION "Echo canceller for mobile using WebRTC library." +-#define MS_WEBRTC_AECM_CATEGORY MS_FILTER_OTHER +-#define MS_WEBRTC_AECM_ENC_FMT NULL +-#define MS_WEBRTC_AECM_NINPUTS 2 +-#define MS_WEBRTC_AECM_NOUTPUTS 2 +-#define MS_WEBRTC_AECM_FLAGS 0 ++#define MS_WEBRTC_AECM_NAME "MSWebRTCAECM" ++#define MS_WEBRTC_AECM_DESCRIPTION \ ++ "Echo canceller for mobile using WebRTC library." ++#define MS_WEBRTC_AECM_CATEGORY MS_FILTER_OTHER ++#define MS_WEBRTC_AECM_ENC_FMT NULL ++#define MS_WEBRTC_AECM_NINPUTS 2 ++#define MS_WEBRTC_AECM_NOUTPUTS 2 ++#define MS_WEBRTC_AECM_FLAGS 0 + + #ifdef _MSC_VER + + MSFilterDesc ms_webrtc_aecm_desc = { +- MS_FILTER_PLUGIN_ID, +- MS_WEBRTC_AECM_NAME, +- MS_WEBRTC_AECM_DESCRIPTION, +- MS_WEBRTC_AECM_CATEGORY, +- MS_WEBRTC_AECM_ENC_FMT, +- MS_WEBRTC_AECM_NINPUTS, +- MS_WEBRTC_AECM_NOUTPUTS, +- webrtc_aecm_init, +- webrtc_aec_preprocess, +- webrtc_aec_process, +- webrtc_aec_postprocess, +- webrtc_aec_uninit, +- webrtc_aec_methods, +- MS_WEBRTC_AECM_FLAGS +-}; ++ MS_FILTER_PLUGIN_ID, MS_WEBRTC_AECM_NAME, MS_WEBRTC_AECM_DESCRIPTION, ++ MS_WEBRTC_AECM_CATEGORY, MS_WEBRTC_AECM_ENC_FMT, MS_WEBRTC_AECM_NINPUTS, ++ MS_WEBRTC_AECM_NOUTPUTS, webrtc_aecm_init, webrtc_aec_preprocess, ++ webrtc_aec_process, webrtc_aec_postprocess, webrtc_aec_uninit, ++ webrtc_aec_methods, MS_WEBRTC_AECM_FLAGS}; + + #else + +-MSFilterDesc ms_webrtc_aecm_desc = { +- .id = MS_FILTER_PLUGIN_ID, +- .name = MS_WEBRTC_AECM_NAME, +- .text = MS_WEBRTC_AECM_DESCRIPTION, +- .category = MS_WEBRTC_AECM_CATEGORY, +- .enc_fmt = MS_WEBRTC_AECM_ENC_FMT, +- .ninputs = MS_WEBRTC_AECM_NINPUTS, +- .noutputs = MS_WEBRTC_AECM_NOUTPUTS, +- .init = webrtc_aecm_init, +- .preprocess = webrtc_aec_preprocess, +- .process = webrtc_aec_process, +- .postprocess = webrtc_aec_postprocess, +- .uninit = webrtc_aec_uninit, +- .methods = webrtc_aec_methods, +- .flags = MS_WEBRTC_AECM_FLAGS +-}; ++MSFilterDesc ms_webrtc_aecm_desc = {.id = MS_FILTER_PLUGIN_ID, ++ .name = MS_WEBRTC_AECM_NAME, ++ .text = MS_WEBRTC_AECM_DESCRIPTION, ++ .category = MS_WEBRTC_AECM_CATEGORY, ++ .enc_fmt = MS_WEBRTC_AECM_ENC_FMT, ++ .ninputs = MS_WEBRTC_AECM_NINPUTS, ++ .noutputs = MS_WEBRTC_AECM_NOUTPUTS, ++ .init = webrtc_aecm_init, ++ .preprocess = webrtc_aec_preprocess, ++ .process = webrtc_aec_process, ++ .postprocess = webrtc_aec_postprocess, ++ .uninit = webrtc_aec_uninit, ++ .methods = webrtc_aec_methods, ++ .flags = MS_WEBRTC_AECM_FLAGS}; + + #endif + +-- +GitLab + diff --git a/gnu/packages/patches/mswebrtc-cmake.patch b/gnu/packages/patches/mswebrtc-cmake.patch new file mode 100644 index 0000000000..19d0c31b10 --- /dev/null +++ b/gnu/packages/patches/mswebrtc-cmake.patch @@ -0,0 +1,626 @@ +From e52911c291e5ebe16da764e53cb740b7deb77e75 Mon Sep 17 00:00:00 2001 +From: Ghislain MARY <ghislain.mary@belledonne-communications.com> +Date: Mon, 13 Mar 2023 19:05:30 +0100 +Subject: [PATCH] Update CMakeLists.txt so that the project can be added as a + subdirectory of linphone-sdk. + +Rename CMake targets for uniform naming. +--- + CMakeLists.txt | 68 ++++++++++++++++++---------------- + cmake/FindBcToolbox.cmake | 67 +++++++++++++++++++++++++++++++++ + cmake/FindMediastreamer2.cmake | 46 +++++++++++++++++++++++ + cmake/FindOrtp.cmake | 43 +++++++++++++++++++++ + 4 files changed, 193 insertions(+), 31 deletions(-) + create mode 100644 cmake/FindBcToolbox.cmake + create mode 100644 cmake/FindMediastreamer2.cmake + create mode 100644 cmake/FindOrtp.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0f26f4f..fd5b52e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ + ############################################################################ + # CMakeLists.txt +-# Copyright (C) 2014 Belledonne Communications, Grenoble France ++# Copyright (C) 2014-2023 Belledonne Communications, Grenoble France + # + ############################################################################ + # +@@ -20,7 +20,8 @@ + # + ############################################################################ + +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.22) ++ + project(mswebrtc VERSION 1.1.1 LANGUAGES C CXX) + + +@@ -34,8 +35,6 @@ set(PACKAGE_URL "") + set(VERSION "${PACKAGE_VERSION}") + + +-option(ENABLE_SHARED "Build shared library." YES) +-option(ENABLE_STATIC "Build static library." YES) + option(ENABLE_AEC "Enable the WebRTC echo canceller support." YES) + option(ENABLE_AECM "Enable the WebRTC echo canceller for mobile support." YES) + option(ENABLE_ISAC "Enable the ISAC audio codec support." YES) +@@ -60,9 +59,20 @@ if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) + message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}") + endif() + +-find_package(Mediastreamer2 REQUIRED CONFIG) +-find_package(ortp REQUIRED CONFIG) +-find_package(bctoolbox REQUIRED CONFIG) ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++ ++find_package(BcToolbox) ++if(NOT BCTOOLBOX_FOUND) ++ find_package(bctoolbox REQUIRED CONFIG) ++endif() ++find_package(Ortp) ++if(NOT ORTP_FOUND) ++ find_package(ortp REQUIRED CONFIG) ++endif() ++find_package(Mediastreamer2) ++if(NOT MEDIASTREAMER2_FOUND) ++ find_package(Mediastreamer2 REQUIRED CONFIG) ++endif() + + find_library(LIBM NAMES m) + +@@ -410,24 +420,18 @@ endif() + + set(MS2_PLUGINS_DIR "${MEDIASTREAMER2_PLUGINS_LOCATION}") + +-if(ENABLE_STATIC) +- add_library(mswebrtc-static STATIC ${SOURCE_FILES}) +- set_target_properties(mswebrtc-static PROPERTIES OUTPUT_NAME mswebrtc) +- set_target_properties(mswebrtc-static PROPERTIES LINKER_LANGUAGE CXX) +- target_link_libraries(mswebrtc-static ${LIBS}) +- install(TARGETS mswebrtc-static +- ARCHIVE DESTINATION "${MS2_PLUGINS_DIR}" +- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- ) +-endif() +-if(ENABLE_SHARED) +- if(NOT IOS) +- add_library(mswebrtc MODULE ${SOURCE_FILES}) +- else() ++if(BUILD_SHARED_LIBS) ++ if(IOS) + add_library(mswebrtc SHARED ${SOURCE_FILES}) ++ else() ++ add_library(mswebrtc MODULE ${SOURCE_FILES}) + endif() +- target_link_libraries(mswebrtc PRIVATE mediastreamer ortp bctoolbox ${LIBS}) +- set_target_properties(mswebrtc PROPERTIES LINKER_LANGUAGE CXX) ++else() ++ add_library(mswebrtc STATIC ${SOURCE_FILES}) ++endif() ++target_link_libraries(mswebrtc PRIVATE mediastreamer2 ortp bctoolbox ${LIBS}) ++set_target_properties(mswebrtc PROPERTIES LINKER_LANGUAGE CXX) ++if(BUILD_SHARED_LIBS) + if(APPLE) + if(IOS) + set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET}) +@@ -441,7 +445,7 @@ if(ENABLE_SHARED) + set(MIN_OS ${CMAKE_OSX_DEPLOYMENT_TARGET}) + endif() + +- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/osx/") ++ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/build/osx/") + endif() + if(MSVC) + if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") +@@ -454,14 +458,16 @@ if(ENABLE_SHARED) + set_target_properties(mswebrtc PROPERTIES PREFIX "lib") + endif() + endif() +- install(TARGETS mswebrtc +- RUNTIME DESTINATION ${MS2_PLUGINS_DIR} +- LIBRARY DESTINATION ${MS2_PLUGINS_DIR} +- ARCHIVE DESTINATION ${MS2_PLUGINS_DIR} +- FRAMEWORK DESTINATION Frameworks +- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- ) + endif() + ++install(TARGETS mswebrtc ++ RUNTIME DESTINATION ${MS2_PLUGINS_DIR} ++ LIBRARY DESTINATION ${MS2_PLUGINS_DIR} ++ ARCHIVE DESTINATION ${MS2_PLUGINS_DIR} ++ FRAMEWORK DESTINATION Frameworks ++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ++) ++ ++ + add_subdirectory(build) + +diff --git a/cmake/FindBcToolbox.cmake b/cmake/FindBcToolbox.cmake +new file mode 100644 +index 0000000..5766478 +--- /dev/null ++++ b/cmake/FindBcToolbox.cmake +@@ -0,0 +1,67 @@ ++############################################################################ ++# FindBctoolbox.cmake ++# Copyright (C) 2023 Belledonne Communications, Grenoble France ++# ++############################################################################ ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# ++############################################################################ ++# ++# - Find the bctoolbox include files and library ++# ++# BCTOOLBOX_FOUND - System has lib bctoolbox ++# BCTOOLBOX_INCLUDE_DIRS - The bctoolbox include directories ++# BCTOOLBOX_LIBRARIES - The libraries needed to use bctoolbox ++# BCTOOLBOX_CMAKE_DIR - The bctoolbox cmake directory ++# BCTOOLBOX_CORE_FOUND - System has core bctoolbox ++# BCTOOLBOX_CORE_INCLUDE_DIRS - The core bctoolbox include directories ++# BCTOOLBOX_CORE_LIBRARIES - The core bctoolbox libraries ++# BCTOOLBOX_TESTER_FOUND - System has bctoolbox tester ++# BCTOOLBOX_TESTER_INCLUDE_DIRS - The bctoolbox tester include directories ++# BCTOOLBOX_TESTER_LIBRARIES - The bctoolbox tester libraries ++ ++if(TARGET bctoolbox) ++ ++ set(BCTOOLBOX_CORE_LIBRARIES bctoolbox) ++ get_target_property(BCTOOLBOX_CORE_INCLUDE_DIRS bctoolbox INTERFACE_INCLUDE_DIRECTORIES) ++ set(BCTOOLBOX_CORE_FOUND TRUE) ++ get_target_property(BCTOOLBOX_SOURCE_DIR bctoolbox SOURCE_DIR) ++ set(BCTOOLBOX_CMAKE_DIR "${BCTOOLBOX_SOURCE_DIR}/../cmake") ++ if(TARGET bctoolbox-tester) ++ set(BCTOOLBOX_TESTER_LIBRARIES bctoolbox-tester) ++ get_target_property(BCTOOLBOX_TESTER_INCLUDE_DIRS bctoolbox-tester INTERFACE_INCLUDE_DIRECTORIES) ++ set(BCTOOLBOX_TESTER_FOUND TRUE) ++ set(BCTOOLBOX_TESTER_COMPONENT_VARIABLES BCTOOLBOX_TESTER_FOUND BCTOOLBOX_TESTER_INCLUDE_DIRS BCTOOLBOX_TESTER_LIBRARIES) ++ endif() ++ set(BCTOOLBOX_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BCTOOLBOX_TESTER_LIBRARIES}) ++ set(BCTOOLBOX_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS} ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) ++ ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(BcToolbox ++ DEFAULT_MSG ++ BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR ++ BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES ++ ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} ++ ) ++ ++ mark_as_advanced( ++ BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR ++ BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES ++ ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} ++ ) ++ ++endif() +diff --git a/cmake/FindMediastreamer2.cmake b/cmake/FindMediastreamer2.cmake +new file mode 100644 +index 0000000..64ac8f2 +--- /dev/null ++++ b/cmake/FindMediastreamer2.cmake +@@ -0,0 +1,46 @@ ++############################################################################ ++# FindMediastreamer2.cmake ++# Copyright (C) 2023 Belledonne Communications, Grenoble France ++# ++############################################################################ ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# ++############################################################################ ++# ++# - Find the mediastreamer2 include files and library ++# ++# MEDIASTREAMER2_FOUND - system has lib mediastreamer2 ++# MEDIASTREAMER2_INCLUDE_DIRS - the mediasteamer2 include directory ++# MEDIASTREAMER2_LIBRARIES - The library needed to use mediasteamer2 ++# MEDIASTREAMER2_PLUGINS_LOCATION - The location of the mediastreamer2 plugins ++ ++if(TARGET mediastreamer2) ++ ++ set(MEDIASTREAMER2_LIBRARIES mediastreamer2) ++ get_target_property(MEDIASTREAMER2_INCLUDE_DIRS mediastreamer2 INTERFACE_INCLUDE_DIRECTORIES) ++ define_property(TARGET PROPERTY "MS2_PLUGINS" BRIEF_DOCS "Stores the location of mediastreamer2 plugins" FULL_DOCS "Stores the location of mediastreamer2 plugins") ++ get_target_property(MEDIASTREAMER2_PLUGINS_LOCATION mediastreamer2 MS2_PLUGINS) ++ ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(Mediastreamer2 ++ DEFAULT_MSG ++ MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES ++ ) ++ ++ mark_as_advanced(MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES) ++ ++endif() +diff --git a/cmake/FindOrtp.cmake b/cmake/FindOrtp.cmake +new file mode 100644 +index 0000000..13121fb +--- /dev/null ++++ b/cmake/FindOrtp.cmake +@@ -0,0 +1,43 @@ ++############################################################################ ++# FindOrtp.cmake ++# Copyright (C) 2023 Belledonne Communications, Grenoble France ++# ++############################################################################ ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# ++############################################################################ ++# ++# - Find the ortp include files and library ++# ++# ORTP_FOUND - system has lib ortp ++# ORTP_INCLUDE_DIRS - the ortp include directory ++# ORTP_LIBRARIES - The library needed to use ortp ++ ++if(TARGET ortp) ++ ++ set(ORTP_LIBRARIES ortp) ++ get_target_property(ORTP_INCLUDE_DIRS ortp INTERFACE_INCLUDE_DIRECTORIES) ++ ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(Ortp ++ DEFAULT_MSG ++ ORTP_INCLUDE_DIRS ORTP_LIBRARIES ++ ) ++ ++ mark_as_advanced(ORTP_INCLUDE_DIRS ORTP_LIBRARIES) ++ ++endif() +-- +GitLab + +From b5aea9bdaeecd99f6fc5601bfb88541d4e55841b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= + <mickael.turnel@belledonne-communications.com> +Date: Fri, 23 Jun 2023 11:05:24 +0200 +Subject: [PATCH] Change the library path in the binary dir so it can be + retrieved easily by testers + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fd5b52e..ab3e651 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,7 @@ cmake_minimum_required(VERSION 3.22) + + project(mswebrtc VERSION 1.1.1 LANGUAGES C CXX) + ++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/mediastreamer2/plugins") + + set(PACKAGE "${PROJECT_NAME}") + set(PACKAGE_NAME "${PROJECT_NAME}") +-- +GitLab + +From 1809337d6191ec40f88191b5ce07cfb01ed07b20 Mon Sep 17 00:00:00 2001 +From: Ghislain MARY <ghislain.mary@belledonne-communications.com> +Date: Tue, 20 Jun 2023 11:47:00 +0200 +Subject: [PATCH] Improve CMake find_package functionality. + +--- + CMakeLists.txt | 30 ++++----------- + build/CMakeLists.txt | 3 +- + cmake/FindBcToolbox.cmake | 67 ---------------------------------- + cmake/FindMediastreamer2.cmake | 46 ----------------------- + cmake/FindOrtp.cmake | 43 ---------------------- + 5 files changed, 10 insertions(+), 179 deletions(-) + delete mode 100644 cmake/FindBcToolbox.cmake + delete mode 100644 cmake/FindMediastreamer2.cmake + delete mode 100644 cmake/FindOrtp.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ab3e651..a869908 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,7 +22,7 @@ + + cmake_minimum_required(VERSION 3.22) + +-project(mswebrtc VERSION 1.1.1 LANGUAGES C CXX) ++project(MSWebRTC VERSION 1.1.1 LANGUAGES C CXX) + + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/mediastreamer2/plugins") + +@@ -60,20 +60,8 @@ if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) + message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}") + endif() + +-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-find_package(BcToolbox) +-if(NOT BCTOOLBOX_FOUND) +- find_package(bctoolbox REQUIRED CONFIG) +-endif() +-find_package(Ortp) +-if(NOT ORTP_FOUND) +- find_package(ortp REQUIRED CONFIG) +-endif() +-find_package(Mediastreamer2) +-if(NOT MEDIASTREAMER2_FOUND) +- find_package(Mediastreamer2 REQUIRED CONFIG) +-endif() ++find_package(BCToolbox 5.3.0 REQUIRED) ++find_package(Mediastreamer2 5.3.0 REQUIRED) + + find_library(LIBM NAMES m) + +@@ -92,7 +80,7 @@ endif() + if(ENABLE_VAD) + set(BUILD_VAD 1) + endif() +-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) ++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h") + + set(WEBRTC_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/webrtc") + set(WEBRTC_SRC_DIR "${WEBRTC_ROOT_DIR}/webrtc") +@@ -419,8 +407,6 @@ if(LIBM) + list(APPEND LIBS ${LIBM}) + endif() + +-set(MS2_PLUGINS_DIR "${MEDIASTREAMER2_PLUGINS_LOCATION}") +- + if(BUILD_SHARED_LIBS) + if(IOS) + add_library(mswebrtc SHARED ${SOURCE_FILES}) +@@ -430,7 +416,7 @@ if(BUILD_SHARED_LIBS) + else() + add_library(mswebrtc STATIC ${SOURCE_FILES}) + endif() +-target_link_libraries(mswebrtc PRIVATE mediastreamer2 ortp bctoolbox ${LIBS}) ++target_link_libraries(mswebrtc PRIVATE ${Mediastreamer2_TARGET} ${LIBS}) + set_target_properties(mswebrtc PROPERTIES LINKER_LANGUAGE CXX) + if(BUILD_SHARED_LIBS) + if(APPLE) +@@ -462,9 +448,9 @@ if(BUILD_SHARED_LIBS) + endif() + + install(TARGETS mswebrtc +- RUNTIME DESTINATION ${MS2_PLUGINS_DIR} +- LIBRARY DESTINATION ${MS2_PLUGINS_DIR} +- ARCHIVE DESTINATION ${MS2_PLUGINS_DIR} ++ RUNTIME DESTINATION ${Mediastreamer2_PLUGINS_DIR} ++ LIBRARY DESTINATION ${Mediastreamer2_PLUGINS_DIR} ++ ARCHIVE DESTINATION ${Mediastreamer2_PLUGINS_DIR} + FRAMEWORK DESTINATION Frameworks + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) +diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt +index 82694c6..8f9108b 100755 +--- a/build/CMakeLists.txt ++++ b/build/CMakeLists.txt +@@ -21,7 +21,8 @@ + ############################################################################ + + if(NOT CPACK_PACKAGE_NAME) +- set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") ++ string(TOLOWER "${PROJECT_NAME}" LOWERCASE_PROJECT_NAME) ++ set(CPACK_PACKAGE_NAME "${LOWERCASE_PROJECT_NAME}") + endif() + + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING") +diff --git a/cmake/FindBcToolbox.cmake b/cmake/FindBcToolbox.cmake +deleted file mode 100644 +index 5766478..0000000 +--- a/cmake/FindBcToolbox.cmake ++++ /dev/null +@@ -1,67 +0,0 @@ +-############################################################################ +-# FindBctoolbox.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the bctoolbox include files and library +-# +-# BCTOOLBOX_FOUND - System has lib bctoolbox +-# BCTOOLBOX_INCLUDE_DIRS - The bctoolbox include directories +-# BCTOOLBOX_LIBRARIES - The libraries needed to use bctoolbox +-# BCTOOLBOX_CMAKE_DIR - The bctoolbox cmake directory +-# BCTOOLBOX_CORE_FOUND - System has core bctoolbox +-# BCTOOLBOX_CORE_INCLUDE_DIRS - The core bctoolbox include directories +-# BCTOOLBOX_CORE_LIBRARIES - The core bctoolbox libraries +-# BCTOOLBOX_TESTER_FOUND - System has bctoolbox tester +-# BCTOOLBOX_TESTER_INCLUDE_DIRS - The bctoolbox tester include directories +-# BCTOOLBOX_TESTER_LIBRARIES - The bctoolbox tester libraries +- +-if(TARGET bctoolbox) +- +- set(BCTOOLBOX_CORE_LIBRARIES bctoolbox) +- get_target_property(BCTOOLBOX_CORE_INCLUDE_DIRS bctoolbox INTERFACE_INCLUDE_DIRECTORIES) +- set(BCTOOLBOX_CORE_FOUND TRUE) +- get_target_property(BCTOOLBOX_SOURCE_DIR bctoolbox SOURCE_DIR) +- set(BCTOOLBOX_CMAKE_DIR "${BCTOOLBOX_SOURCE_DIR}/../cmake") +- if(TARGET bctoolbox-tester) +- set(BCTOOLBOX_TESTER_LIBRARIES bctoolbox-tester) +- get_target_property(BCTOOLBOX_TESTER_INCLUDE_DIRS bctoolbox-tester INTERFACE_INCLUDE_DIRECTORIES) +- set(BCTOOLBOX_TESTER_FOUND TRUE) +- set(BCTOOLBOX_TESTER_COMPONENT_VARIABLES BCTOOLBOX_TESTER_FOUND BCTOOLBOX_TESTER_INCLUDE_DIRS BCTOOLBOX_TESTER_LIBRARIES) +- endif() +- set(BCTOOLBOX_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BCTOOLBOX_TESTER_LIBRARIES}) +- set(BCTOOLBOX_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS} ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) +- +- +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(BcToolbox +- DEFAULT_MSG +- BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR +- BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES +- ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} +- ) +- +- mark_as_advanced( +- BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR +- BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES +- ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} +- ) +- +-endif() +diff --git a/cmake/FindMediastreamer2.cmake b/cmake/FindMediastreamer2.cmake +deleted file mode 100644 +index 64ac8f2..0000000 +--- a/cmake/FindMediastreamer2.cmake ++++ /dev/null +@@ -1,46 +0,0 @@ +-############################################################################ +-# FindMediastreamer2.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the mediastreamer2 include files and library +-# +-# MEDIASTREAMER2_FOUND - system has lib mediastreamer2 +-# MEDIASTREAMER2_INCLUDE_DIRS - the mediasteamer2 include directory +-# MEDIASTREAMER2_LIBRARIES - The library needed to use mediasteamer2 +-# MEDIASTREAMER2_PLUGINS_LOCATION - The location of the mediastreamer2 plugins +- +-if(TARGET mediastreamer2) +- +- set(MEDIASTREAMER2_LIBRARIES mediastreamer2) +- get_target_property(MEDIASTREAMER2_INCLUDE_DIRS mediastreamer2 INTERFACE_INCLUDE_DIRECTORIES) +- define_property(TARGET PROPERTY "MS2_PLUGINS" BRIEF_DOCS "Stores the location of mediastreamer2 plugins" FULL_DOCS "Stores the location of mediastreamer2 plugins") +- get_target_property(MEDIASTREAMER2_PLUGINS_LOCATION mediastreamer2 MS2_PLUGINS) +- +- +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(Mediastreamer2 +- DEFAULT_MSG +- MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES +- ) +- +- mark_as_advanced(MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES) +- +-endif() +diff --git a/cmake/FindOrtp.cmake b/cmake/FindOrtp.cmake +deleted file mode 100644 +index 13121fb..0000000 +--- a/cmake/FindOrtp.cmake ++++ /dev/null +@@ -1,43 +0,0 @@ +-############################################################################ +-# FindOrtp.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the ortp include files and library +-# +-# ORTP_FOUND - system has lib ortp +-# ORTP_INCLUDE_DIRS - the ortp include directory +-# ORTP_LIBRARIES - The library needed to use ortp +- +-if(TARGET ortp) +- +- set(ORTP_LIBRARIES ortp) +- get_target_property(ORTP_INCLUDE_DIRS ortp INTERFACE_INCLUDE_DIRECTORIES) +- +- +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(Ortp +- DEFAULT_MSG +- ORTP_INCLUDE_DIRS ORTP_LIBRARIES +- ) +- +- mark_as_advanced(ORTP_INCLUDE_DIRS ORTP_LIBRARIES) +- +-endif() +-- +GitLab + diff --git a/gnu/packages/patches/nyacc-binary-literals.patch b/gnu/packages/patches/nyacc-binary-literals.patch deleted file mode 100644 index 8159d74032..0000000000 --- a/gnu/packages/patches/nyacc-binary-literals.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6a08014b77bf435f025ecdac08396580b85f159a Mon Sep 17 00:00:00 2001 -From: Jan Nieuwenhuizen <janneke@gnu.org> -Date: Sat, 8 Sep 2018 20:22:45 +0200 -Subject: [PATCH] fix binary literals. - ---- - module/nyacc/lex.scm | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/module/nyacc/lex.scm b/module/nyacc/lex.scm -index 2ec9895..b205212 100644 ---- a/module/nyacc/lex.scm -+++ b/module/nyacc/lex.scm -@@ -345,10 +345,11 @@ - ((char-numeric? ch) (iter chl '$fixed ba 1 ch)) - ((char=? #\. ch) (iter (cons ch chl) #f ba 15 (read-char))) - (else #f))) -- ((10) ;; allow x after 0 -+ ((10) ;; allow x, b after 0 - (cond - ((eof-object? ch) (iter chl ty ba 5 ch)) - ((char=? #\x ch) (iter (cons ch chl) ty 16 1 (read-char))) -+ ((char=? #\b ch) (iter (cons ch chl) ty 2 1 (read-char))) - (else (iter chl ty ba 1 ch)))) - ((15) ;; got `.' only - (cond --- -2.18.0 - diff --git a/gnu/packages/patches/soci-mysql-ddl-types.patch b/gnu/packages/patches/soci-mysql-ddl-types.patch new file mode 100644 index 0000000000..e92fb117d1 --- /dev/null +++ b/gnu/packages/patches/soci-mysql-ddl-types.patch @@ -0,0 +1,15 @@ +Description: Add two unusual column type entries to make liblinphone work +Author: Dennis Filder <d.filder@web.de> +Bug-Debian: https://bugs.debian.org/984534 +Last-Update: 2021-03-10 +--- a/src/backends/sqlite3/statement.cpp ++++ b/src/backends/sqlite3/statement.cpp +@@ -440,6 +440,8 @@ + m["mediumint"] = dt_integer; + m["smallint"] = dt_integer; + m["tinyint"] = dt_integer; ++ m["tinyintunsigned"] = dt_integer; ++ m["intunsigned"] = dt_integer; + + // dt_long_long + m["bigint"] = dt_long_long; diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index 33990bc2eb..98192f34ea 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -36,6 +36,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system perl) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix gexp) #:use-module (guix download) @@ -514,17 +515,41 @@ scene to produce an image that looks much like a tone-mapped image.") (base32 "1lwf3cwldvh9qfmh3w7nqqildfmxx2i5f5bn0vr8y6qc5kh7a1s9")))) (build-system cmake-build-system) (arguments - `(,@(if (any (cute string-prefix? <> (or (%current-system) - (%current-target-system))) - '("x86_64" "i686")) - ;; SSE and SSE2 are supported only on Intel processors. - '() - '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF"))) - #:tests? #f)) ; There are no tests to run. + (list + #:imported-modules `(,@%cmake-build-system-modules + ,@%pyproject-build-system-modules) + #:modules '((guix build cmake-build-system) + ((guix build pyproject-build-system) #:prefix py:) + (guix build utils)) + #:configure-flags + (if (any (cute string-prefix? <> (or (%current-system) + (%current-target-system))) + '("x86_64" "i686")) + ;; SSE and SSE2 are supported only on Intel processors. + #~'() + #~'("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")) + #:tests? #f ; There are no tests to run. + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-egg + (lambda _ + (substitute* "apps/CMakeLists.txt" + ;; Prevent creation of Python egg. + (("\\$\\{SETUP_PY\\} install") + "${SETUP_PY} install --single-version-externally-managed --root=/")))) + (add-after 'install 'python-wrap + (lambda* (#:key inputs outputs #:allow-other-keys) + (for-each (lambda (program) + (wrap-program (search-input-file outputs program) + `("GUIX_PYTHONPATH" ":" prefix + (,(getenv "GUIX_PYTHONPATH") + ,(py:site-packages inputs outputs))))) + (list "bin/lensfun-update-data" + "bin/lensfun-add-adapter"))))))) (native-inputs (list pkg-config)) (inputs - (list glib)) + (list bash-minimal glib python)) (home-page "https://lensfun.github.io/") (synopsis "Library to correct optical lens defects with a lens database") (description "Digital photographs are not ideal. Of course, the better is @@ -678,9 +703,19 @@ and enhance them.") (list #:tests? #f ;Tests are only examples #:configure-flags - #~(list "-DUSE_BUNDLED_LIBRAW=OFF" - "-DBINARY_PACKAGE_BUILD=ON") - #:build-type "Release")) ;Rawspeed fails on default 'RelWithDebInfo' + #~(list "-DUSE_BUNDLED_LIBRAW=OFF" + "-DBINARY_PACKAGE_BUILD=ON") + #:build-type "Release" ;Rawspeed fails on default 'RelWithDebInfo' + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'libOpenCL-path + (lambda* (#:key inputs #:allow-other-keys) + ;; Statically link to libOpenCL. + (substitute* "./src/common/dlopencl.c" + (("\"libOpenCL\"") + (string-append "\"" + (search-input-file inputs "/lib/libOpenCL.so") + "\"")))))))) (native-inputs (list cmocka desktop-file-utils diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm index c567d3283a..ff66647bc1 100644 --- a/gnu/packages/simulation.scm +++ b/gnu/packages/simulation.scm @@ -160,11 +160,10 @@ eigen expat ffmpeg - fmt + fmt-11 freetype gdal gl2ps - glew gmsh hdf5 jsoncpp diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm index acbffe3bf9..f2f667ff5d 100644 --- a/gnu/packages/suckless.scm +++ b/gnu/packages/suckless.scm @@ -62,6 +62,7 @@ #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix scripts) #:use-module (guix utils) #:use-module (guix packages)) @@ -78,14 +79,15 @@ (base32 "1mpfrvn122lnaqid1pi99ckpxd6x679b0w91pl003xmdwsfdbcly")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; no check target - #:make-flags - (list - (string-append "CC=" ,(cc-for-target)) - (string-append "PREFIX=" %output)) - #:phases - (modify-phases %standard-phases - (delete 'configure)))) ; no configure script + (list + #:tests? #f ; no check target + #:make-flags + #~(list + (string-append "CC=" #$(cc-for-target)) + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure)))) ; no configure script (home-page "https://tools.suckless.org/scroll/") (synopsis "Scroll-back buffer program for st") (description "Scroll is a program that provides a scroll back buffer for @@ -95,37 +97,36 @@ terminal like @code{st}.") (define-public tabbed (package (name "tabbed") - (version "0.6") + (version "0.9") (source (origin (method url-fetch) (uri (string-append "https://dl.suckless.org/tools/tabbed-" version ".tar.gz")) (sha256 - (base32 "0hhwckyzvsj9aim2l6m69wmvl2n7gzd6b1ly8qjnlpgcrcxfllbn")))) + (base32 "1a0842lw666cnx5mx2xqqrad4ipvbz4wxad3pxpyc6blgd2qgkqa")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; no check target - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch - (lambda* (#:key inputs outputs #:allow-other-keys) - (substitute* "config.mk" - (("/usr/local") - (assoc-ref outputs "out")) - (("/usr/X11R6") - (assoc-ref inputs "libx11")) - (("/usr/include/freetype2") - (string-append (assoc-ref inputs "freetype") - "/include/freetype2")) - (("CC = cc") - (string-append "CC = " ,(cc-for-target)))))) - (delete 'configure)))) ; no configure script + (list + #:tests? #f ; no check target + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "Makefile" + (("/usr/local") #$output) + (("/usr/X11R6") #$(this-package-input "libx11")) + (("/usr/include/freetype2") + (string-append #$(this-package-input "freetype") + "/include/freetype2")) + (("\\$\\{CC\\}") + (string-append #$(cc-for-target)))))) + (delete 'configure)))) ; no configure script (inputs - `(("fontconfig" ,fontconfig) - ("freetype" ,freetype) - ("libx11" ,libx11) - ("libxft" ,libxft))) + (list fontconfig + freetype + libx11 + libxft)) (home-page "https://tools.suckless.org/tabbed/") (synopsis "Tab interface for application supporting Xembed") (description "Tabbed is a generic tabbed frontend to xembed-aware @@ -212,12 +213,14 @@ It provides the following features: "0nncvzyipvkkd7zlgzwbjygp82frzs2hvbnk71gxf671np607y94")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; no check target - #:make-flags (list (string-append "CC=" ,(cc-for-target)) - (string-append "PREFIX=" %output)) - #:phases - (modify-phases %standard-phases - (delete 'configure)))) ; no configure script + (list + #:tests? #f ; no check target + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure)))) ; no configure script (synopsis "Command line video editing utilities") (home-page "https://tools.suckless.org/blind/") (description @@ -228,53 +231,49 @@ a custom raw video format with a simple container.") (define-public dwm (package (name "dwm") - (version "6.5") + (version "6.6") + (synopsis "Dynamic Window Manager") (source (origin - (method url-fetch) - (uri (string-append "https://dl.suckless.org/dwm/dwm-" - version ".tar.gz")) - (sha256 - (base32 "0acpl05rg6rg6nrg3rv4kp388iqzp1n6dhin30a97yzjm6zrxmr1")))) + (method url-fetch) + (uri (string-append "https://dl.suckless.org/dwm/dwm-" + version ".tar.gz")) + (sha256 + (base32 + "18q0zjvzsvpm76p2x1xlw163d8wbq44z41n9w94prh46jdnjrz3w")))) (build-system gnu-build-system) (arguments - `(#:tests? #f - #:make-flags (list (string-append "FREETYPEINC=" - (assoc-ref %build-inputs "freetype") - "/include/freetype2")) - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda _ - (substitute* "Makefile" (("\\$\\{CC\\}") "gcc")) - #t)) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) + (list + #:tests? #f + #:make-flags + #~(list + (string-append "FREETYPEINC=" + #$(this-package-input "freetype") + "/include/freetype2")) + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda _ + (substitute* "Makefile" (("\\$\\{CC\\}") #$(cc-for-target))))) + (replace 'install + (lambda _ (invoke "make" "install" - (string-append "DESTDIR=" out) "PREFIX=")))) - (add-after 'build 'install-xsession - (lambda* (#:key outputs #:allow-other-keys) - ;; Add a .desktop file to xsessions. - (let* ((output (assoc-ref outputs "out")) - (xsessions (string-append output "/share/xsessions"))) - (mkdir-p xsessions) - (with-output-to-file - (string-append xsessions "/dwm.desktop") - (lambda _ - (format #t - "[Desktop Entry]~@ - Name=dwm~@ - Comment=Dynamic Window Manager~@ - Exec=~a/bin/dwm~@ - TryExec=~@*~a/bin/dwm~@ - Icon=~@ - Type=Application~%" - output))) - #t)))))) + (string-append "DESTDIR=" #$output) "PREFIX="))) + (add-after 'build 'install-xsession + (lambda _ + ;; Add a .desktop file to xsessions. + (let ((apps (string-append #$output "/share/xsessions"))) + (mkdir-p apps) + (make-desktop-entry-file + (string-append apps "/dwm.desktop") + #:name "dwm" + #:generic-name #$synopsis + #:exec (string-append #$output "/bin/dwm %U") + #:comment + `(("en" ,#$synopsis) + (#f ,#$synopsis))))))))) (inputs (list freetype libx11 libxft libxinerama)) (home-page "https://dwm.suckless.org/") - (synopsis "Dynamic window manager") (description "dwm is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. All of the layouts can be applied dynamically, @@ -284,25 +283,27 @@ optimising the environment for the application in use and the task performed.") (define-public dmenu (package (name "dmenu") - (version "5.3") + (version "5.4") (source (origin (method url-fetch) (uri (string-append "https://dl.suckless.org/tools/dmenu-" version ".tar.gz")) (sha256 (base32 - "0pvr6da1v7hmbnacpgxcxv1sakg1nckmw347xhwrhx1dzpk573qs")))) + "0lyldkxshbgh7alz7a50l167pk1d4lcb2rhhhvz81aj710mcxflg")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; no tests - #:make-flags - (list (string-append "CC=" ,(cc-for-target)) - (string-append "PREFIX=" %output) - (string-append "FREETYPEINC=" - (assoc-ref %build-inputs "freetype") - "/include/freetype2")) - #:phases - (modify-phases %standard-phases (delete 'configure)))) + (list + #:tests? #f ; no tests + #:make-flags + #~(list + (string-append "CC=" #$(cc-for-target)) + (string-append "PREFIX=" #$output) + (string-append "FREETYPEINC=" + #$(this-package-input "freetype") + "/include/freetype2")) + #:phases + #~(modify-phases %standard-phases (delete 'configure)))) (inputs (list freetype libxft libx11 libxinerama)) (home-page "https://tools.suckless.org/dmenu/") @@ -368,31 +369,31 @@ numbers of user-defined menu items efficiently.") (define-public st (package (name "st") - (version "0.9.2") + (version "0.9.3") (source (origin (method url-fetch) (uri (string-append "https://dl.suckless.org/st/st-" version ".tar.gz")) (sha256 - (base32 "0js9z5kn8hmpxzfmb2g6zsy28zkpg88j3wih5wixc89b8x7ms8bb")))) + (base32 "16v4dsjrsh5jwah38ygg8808zc536szwxj1qxm6kswgdrnmzxncy")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; no tests - #:make-flags - (list (string-append "CC=" ,(cc-for-target)) - (string-append "TERMINFO=" - (assoc-ref %outputs "out") - "/share/terminfo") - (string-append "PREFIX=" %output)) - #:phases - (modify-phases %standard-phases - (delete 'configure)))) + (list + #:tests? #f ;no tests + #:make-flags + #~(list + (string-append "CC=" #$(cc-for-target)) + (string-append "TERMINFO=" #$output "/share/terminfo") + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure)))) (inputs - `(("libx11" ,libx11) - ("libxft" ,libxft) - ("fontconfig" ,fontconfig) - ("freetype" ,freetype))) + (list libx11 + libxft + fontconfig + freetype)) (native-inputs (list ncurses ;provides tic program pkg-config)) @@ -504,27 +505,27 @@ Vim bindings and Xresource compatibility.") (base32 "0mrj0kp01bwrgrn4v298g81h6zyq64ijsg790di68nm21f985rbj")))) (build-system glib-or-gtk-build-system) (arguments - `(#:tests? #f ; no tests - #:make-flags - (list (string-append "CC=" ,(cc-for-target)) - (string-append "PREFIX=" %output)) - #:phases - (modify-phases %standard-phases - (delete 'configure) - ;; Use the right file name for dmenu and xprop. - (add-before 'build 'set-dmenu-and-xprop-file-name - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "config.def.h" - (("dmenu") (search-input-file inputs "/bin/dmenu")) - (("xprop") (search-input-file inputs "/bin/xprop"))) - #t))))) + (list + #:tests? #f ; no tests + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + ;; Use the right file name for dmenu and xprop. + (add-before 'build 'set-dmenu-and-xprop-file-name + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "config.def.h" + (("dmenu") (search-input-file inputs "/bin/dmenu")) + (("xprop") (search-input-file inputs "/bin/xprop")))))))) (inputs - `(("dmenu" ,dmenu) - ("gcr" ,gcr-3) - ("glib-networking" ,glib-networking) - ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) - ("webkitgtk" ,webkitgtk-with-libsoup2) - ("xprop" ,xprop))) + (list dmenu + gcr-3 + glib-networking + gsettings-desktop-schemas + webkitgtk-with-libsoup2 + xprop)) (native-inputs (list pkg-config)) (home-page "https://surf.suckless.org/") @@ -550,30 +551,31 @@ point surf to another URI by setting its XProperties.") "0cxysz5lp25mgww73jl0mgip68x7iyvialyzdbriyaff269xxwvv")))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases - (delete 'configure) ;no configuration - (add-before 'build 'patch-farbfeld - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "config.def.h" - (("2ff") (search-input-file inputs "/bin/2ff"))))) - (add-after 'install 'install-doc - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (doc (string-append out "/share/doc/" ,name "-" - ,(package-version this-package)))) - (install-file "README.md" doc))))) - #:tests? #f ;no test suite - #:make-flags - (let ((pkg-config (lambda (flag) - (string-append "$(shell pkg-config " flag " " - "xft fontconfig x11 libpng)")))) - (list (string-append "CC=" - ,(cc-for-target)) - (string-append "PREFIX=" %output) - (string-append "INCS=-I. " - (pkg-config "--cflags")) - (string-append "LIBS=" - (pkg-config "--libs") " -lm"))))) + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ;no configuration + (add-before 'build 'patch-farbfeld + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "config.def.h" + (("2ff") (search-input-file inputs "/bin/2ff"))))) + (add-after 'install 'install-doc + (lambda _ + (install-file "README.md" + (string-append + #$output "/share/doc/" + #$name + "-" + #$(package-version this-package)))))) + #:tests? #f ;no test suite + #:make-flags + #~(let ((pkg-config (lambda (flag) + (string-append "$(shell pkg-config " flag " " + "xft fontconfig x11 libpng)")))) + (list (string-append "CC=" #$(cc-for-target)) + (string-append "PREFIX=" #$output) + (string-append "INCS=-I. " (pkg-config "--cflags")) + (string-append "LIBS=" (pkg-config "--libs") " -lm"))))) (native-inputs (list pkg-config)) (inputs (list farbfeld libpng libx11 libxft fontconfig)) (synopsis "Plain-text presentation tool") diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 2fa8013485..be5823af20 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -452,34 +452,34 @@ internet.") (define-public libsrtp (package (name "libsrtp") - (version "2.4.2") + (version "2.6.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/cisco/libsrtp") - (commit (string-append "v" version)))) + (url "https://github.com/cisco/libsrtp") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 - "1gswpjm4jacfxmgglbf8hxi3yzsag4drk4q943p0wkmv21zj8l78")))) + "1vjdkss076ihbshc83v11c6qxq8mfqi4c26rl1a96kqa9dpgjqmx")))) (native-inputs - (list psmisc ;some tests require 'killall' + (list psmisc ;some tests require 'killall' procps)) (build-system gnu-build-system) (arguments - '(#:test-target "runtest" - #:phases (modify-phases %standard-phases - (add-after 'build 'build-shared - (lambda* (#:key (make-flags '()) #:allow-other-keys) - ;; Build the shared library separately because - ;; the test runner requires a static build. - (apply invoke "make" "shared_library" make-flags) - #t)) - (add-after 'install 'remove-static-library - (lambda* (#:key outputs #:allow-other-keys) - (delete-file (string-append (assoc-ref outputs "out") - "/lib/libsrtp2.a")) - #t))))) + (list + #:test-target "runtest" + #:phases + #~(modify-phases %standard-phases + (add-after 'build 'build-shared + (lambda* (#:key make-flags #:allow-other-keys) + ;; Build the shared library separately because + ;; the test runner requires a static build. + (apply invoke "make" "shared_library" make-flags))) + (add-after 'install 'remove-static-library + (lambda _ + (delete-file (string-append #$output + "/lib/libsrtp2.a"))))))) (synopsis "Secure RTP (SRTP) Reference Implementation") (description "This package provides an implementation of the Secure Real-time Transport diff --git a/gnu/packages/tor-browsers.scm b/gnu/packages/tor-browsers.scm index 116d25875a..12763a99ca 100644 --- a/gnu/packages/tor-browsers.scm +++ b/gnu/packages/tor-browsers.scm @@ -72,7 +72,6 @@ #:use-module (gnu packages python) #:use-module (gnu packages rust) #:use-module (gnu packages rust-apps) - #:use-module (gnu packages sqlite) #:use-module (gnu packages tor) #:use-module (gnu packages video) #:use-module (gnu packages xdisorg) @@ -116,16 +115,16 @@ Firefox locales.") ;; We copy the official build id, which is defined at ;; tor-browser-build/rbm.conf (browser_release_date). -(define %torbrowser-build-date "20250722101758") +(define %torbrowser-build-date "20250818110000") ;; To find the last version, look at https://www.torproject.org/download/. -(define %torbrowser-version "14.5.5") +(define %torbrowser-version "14.5.6") ;; To find the last Firefox version, browse ;; https://archive.torproject.org/tor-package-archive/torbrowser/<%torbrowser-version> ;; There should be only one archive that starts with ;; "src-firefox-tor-browser-". -(define %torbrowser-firefox-version "128.13.0esr-14.5-1-build2") +(define %torbrowser-firefox-version "128.14.0esr-14.5-1-build2") ;; See tor-browser-build/rbm.conf for the list. (define %torbrowser-locales (list "ar" "be" "bg" "ca" "cs" "da" "de" "el" "es-ES" "fa" @@ -140,11 +139,11 @@ Firefox locales.") (method git-fetch) (uri (git-reference (url "https://gitlab.torproject.org/tpo/translation.git") - (commit "8600afeb12fdae895c37618e1386c1a1ac2f5308"))) + (commit "9896e5765c90c763b97135fdda00a08cf08dbddd"))) (file-name "translation-base-browser") (sha256 (base32 - "1l190sqpbldnsrwqv8y3fbf7l3bf54b17bajswkaqpsgyci2wicy")))) + "06638lii8yx8smb192629i5zjp3aly80zvyd3hix12iivcvndqg4")))) ;; See tor-browser-build/projects/translation/config. (define torbrowser-translation-specific @@ -152,11 +151,11 @@ Firefox locales.") (method git-fetch) (uri (git-reference (url "https://gitlab.torproject.org/tpo/translation.git") - (commit "9fe8a13ee4c69f91cd545dc3c575ca8f4851d58e"))) + (commit "a58fb6a60d4d1328b7cffcc1e6ded5673f5e4360"))) (file-name "translation-tor-browser") (sha256 (base32 - "0n3wa1snadhr574rf01kqg18vh66hzv1h7lhwkdps7q9qj7mpgim")))) + "0qb0fjxinsd34pfgjzgpf6ry2wssc191yzxncvwrhi1bjlgjw73r")))) (define torbrowser-assets ;; This is a prebuilt Torbrowser from which we take the assets we need. @@ -172,7 +171,7 @@ Firefox locales.") version "/tor-browser-linux-x86_64-" version ".tar.xz")) (sha256 (base32 - "0gdzd3gm0qs7ypzdrcdqz6byp5lc9byvb3m4xj3sgdd44j0s34dc")))) + "1hk4hbs7hc5j6f6fiqgik0087b0yvwl54f6rm4jig2wg41cc44hr")))) (arguments (list #:install-plan @@ -213,7 +212,7 @@ Browser.") ".tar.xz")) (sha256 (base32 - "1pm0fi816hzafgv0z52h3n3x355hwjlxgzz89lpzncz9idf9lsqy")))) + "16hkibrlzgp430m045w13yl5ixxccyxlqk9qmzsgg0c5wkys6si4")))) (build-system mozilla-build-system) (inputs (list lyrebird @@ -226,11 +225,9 @@ Browser.") gdk-pixbuf glib gtk+ - ;; UNBUNDLE-ME! graphite2 cairo pango freetype - ;; UNBUNDLE-ME! harfbuzz libcanberra libgnome libjpeg-turbo @@ -254,9 +251,8 @@ Browser.") hunspell libnotify nspr - nss-rapid ; requires v. 3.101, so nss won't cut it for now. + nss shared-mime-info - sqlite eudev unzip zip @@ -352,12 +348,9 @@ Browser.") "--with-system-icu" "--with-system-nspr" "--with-system-nss" + "--with-system-ffi" - ;; UNBUNDLE-ME! "--with-system-harfbuzz" - ;; UNBUNDLE-ME! "--with-system-graphite2" "--enable-system-pixman" - "--enable-system-ffi" - ;; UNBUNDLE-ME! "--enable-system-sqlite" ) #:imported-modules %cargo-utils-modules ;for `generate-all-checksums' @@ -411,10 +404,7 @@ Browser.") "media/libvpx" ;; UNBUNDLE-ME! "media/libtremor" "media/libwebp" - ;; UNBUNDLE-ME! "gfx/harfbuzz" - ;; UNBUNDLE-ME! "gfx/graphite2" "js/src/ctypes/libffi" - ;; UNBUNDLE-ME! "db/sqlite3" ;; 800Mo of unused tests. "testing/web-platform" )))) @@ -800,17 +790,17 @@ attacks on the privacy of Tor users.") ;; We copy the official build id, which can be found there: ;; https://cdn.mullvad.net/browser/update_responses/update_1/release. -(define %mullvadbrowser-build-date "20250722101758") +(define %mullvadbrowser-build-date "20250818110000") ;; To find the last version, look at ;; https://mullvad.net/en/download/browser/linux. -(define %mullvadbrowser-version "14.5.5") +(define %mullvadbrowser-version "14.5.6") ;; To find the last Firefox version, browse ;; https://archive.torproject.org/tor-package-archive/mullvadbrowser/<%mullvadbrowser-version> ;; There should be only one archive that starts with ;; "src-firefox-mullvad-browser-". -(define %mullvadbrowser-firefox-version "128.13.0esr-14.5-1-build1") +(define %mullvadbrowser-firefox-version "128.14.0esr-14.5-1-build2") ;; See tor-browser-build/projects/translation/config. (define mullvadbrowser-translation-base @@ -818,11 +808,11 @@ attacks on the privacy of Tor users.") (method git-fetch) (uri (git-reference (url "https://gitlab.torproject.org/tpo/translation.git") - (commit "8600afeb12fdae895c37618e1386c1a1ac2f5308"))) + (commit "9896e5765c90c763b97135fdda00a08cf08dbddd"))) (file-name "translation-base-browser") (sha256 (base32 - "1l190sqpbldnsrwqv8y3fbf7l3bf54b17bajswkaqpsgyci2wicy")))) + "06638lii8yx8smb192629i5zjp3aly80zvyd3hix12iivcvndqg4")))) ;; See tor-browser-build/projects/translation/config. (define mullvadbrowser-translation-specific @@ -850,7 +840,7 @@ attacks on the privacy of Tor users.") version "/mullvad-browser-linux-x86_64-" version ".tar.xz")) (sha256 (base32 - "1z5g5l3bikpl2vlps641fpm2lps672ci0vx002blvssn55iv22iz")))) + "08wkx9f5l03la6ny1f0igxcmffrw80pl7i7c8lrh5095wnsxwim1")))) (arguments (list #:install-plan @@ -893,7 +883,7 @@ Mullvad Browser.") %mullvadbrowser-firefox-version ".tar.xz")) (sha256 (base32 - "1d8zs5mziig1vs385rqr8xmxyklf9aqbsk3lmqxc0p2ldgq6ygll")))) + "0djqmq1hw6mf8ww2yb3yga7hyqz9ims083sh5m0xi0yc9l4clmfg")))) (arguments (substitute-keyword-arguments (package-arguments mullvadbrowser-base) ((#:phases phases) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 663048c86f..bc217146eb 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Aljosha Papsch <misc@rpapsch.de> -;;; Copyright © 2014-2024 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014-2025 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015-2024 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2018 Raoul Jean Pierre Bonnal <ilpuccio.febo@gmail.com> @@ -5584,11 +5584,9 @@ Cloud.") (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) - (guile (assoc-ref inputs "guile")) (guile-effective-version (read-line - (open-pipe* OPEN_READ - (string-append guile "/bin/guile") + (open-pipe* OPEN_READ (which "guile") "-c" "(display (effective-version))"))) (scm (string-append out "/share/guile/site/" guile-effective-version)) @@ -5604,13 +5602,11 @@ Cloud.") `("PATH" ":" prefix ,(cons* bin - (map (lambda (input) - (string-append - (assoc-ref inputs input) - "/bin")) - '("ephemeralpg" - "util-linux" - "postgresql")))) + (map (lambda (file) + (search-input-file inputs file)) + '("/bin/pg_tmp" ;ephemeralpg + "/bin/ionice" ;util-linux + "/bin/psql")))) ;postgresql `("GUILE_LOAD_PATH" ":" prefix (,scm ,(getenv "GUILE_LOAD_PATH"))) `("GUILE_LOAD_COMPILED_PATH" ":" prefix @@ -5637,7 +5633,9 @@ Cloud.") guile-squee guile-lzlib)) (native-inputs - (list (lookup-package-native-input guix "guile") + ;; Use the highest Guile version found among dependencies to ensure .go + ;; files can be loaded. + (list (lookup-package-native-input guile-fibers-next "guile") autoconf automake emacs-minimal diff --git a/gnu/services/containers.scm b/gnu/services/containers.scm index 24f31c756b..c9eadea9b4 100644 --- a/gnu/services/containers.scm +++ b/gnu/services/containers.scm @@ -35,12 +35,15 @@ #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix i18n) + #:use-module (guix modules) #:use-module (guix monads) #:use-module (guix packages) #:use-module (guix profiles) #:use-module ((guix scripts pack) #:prefix pack:) + #:use-module (guix records) #:use-module (guix store) #:use-module (srfi srfi-1) + #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (rootless-podman-configuration rootless-podman-configuration? @@ -96,8 +99,82 @@ oci-container-configuration-workdir oci-container-configuration-extra-arguments + list-of-oci-containers? + list-of-oci-networks? + list-of-oci-volumes? + + %oci-supported-runtimes + oci-runtime? + oci-runtime-system-environment + oci-runtime-system-extra-arguments + oci-runtime-system-requirement + oci-runtime-cli + oci-runtime-system-cli + oci-runtime-home-cli + oci-runtime-name + oci-runtime-group + + oci-network-configuration + oci-network-configuration? + oci-network-configuration-fields + oci-network-configuration-name + oci-network-configuration-driver + oci-network-configuration-gateway + oci-network-configuration-internal? + oci-network-configuration-ip-range + oci-network-configuration-ipam-driver + oci-network-configuration-ipv6? + oci-network-configuration-subnet + oci-network-configuration-labels + oci-network-configuration-extra-arguments + + oci-volume-configuration + oci-volume-configuration? + oci-volume-configuration-fields + oci-volume-configuration-name + oci-volume-configuration-labels + oci-volume-configuration-extra-arguments + + oci-configuration + oci-configuration? + oci-configuration-fields + oci-configuration-runtime + oci-configuration-runtime-cli + oci-configuration-runtime-extra-arguments + oci-configuration-user + oci-configuration-group + oci-configuration-containers + oci-configuration-networks + oci-configuration-volumes + oci-configuration-verbose? + oci-configuration-valid? + + oci-extension + oci-extension? + oci-extension-fields + oci-extension-containers + oci-extension-networks + oci-extension-volumes + + oci-container-shepherd-name + oci-networks-shepherd-name + oci-networks-home-shepherd-name + oci-volumes-shepherd-name + oci-volumes-home-shepherd-name + + oci-container-configuration->options + oci-network-configuration->options + oci-volume-configuration->options + oci-container-shepherd-service - %oci-container-accounts)) + oci-objects-merge-lst + oci-extension-merge + oci-service-type + oci-service-accounts + oci-service-profile + oci-service-subids + oci-configuration->shepherd-services + oci-configuration-extend)) (define (gexp-or-string? value) (or (gexp? value) @@ -296,9 +373,42 @@ to be shared. This service sets it so.") ;;; -;;; OCI container. +;;; OCI provisioning service. ;;; +(define %oci-supported-runtimes + '(docker podman)) + +(define (oci-runtime-system-requirement runtime) + "Return a list of Shepherd service names required by a given OCI runtime, +before it is able to run containers." + (if (eq? 'podman runtime) + '(cgroups2-fs-owner cgroups2-limits + rootless-podman-shared-root-fs user-processes) + '(dockerd user-processes))) + +(define (oci-runtime-name runtime) + "Return a human readable name for a given OCI runtime." + (if (eq? 'podman runtime) + "Podman" "Docker")) + +(define (oci-runtime-group runtime maybe-group) + "Implement the logic behind selection of the group that is to be used by +Shepherd to execute OCI commands." + (if (maybe-value-set? maybe-group) + maybe-group + (if (eq? 'podman runtime) + "cgroup" + "docker"))) + +(define (oci-runtime? value) + (unless (member value %oci-supported-runtimes) + (raise + (formatted-message + (G_ "OCI runtime must be a symbol and one of ~a, +but ~a was found") %oci-supported-runtimes value))) + (symbol? value)) + (define (oci-sanitize-pair pair delimiter) (define (valid? member) (or (string? member) @@ -332,21 +442,41 @@ found!") ;; '(("HOME" . "/home/nobody") "JAVA_HOME=/java") (oci-sanitize-mixed-list "host-environment" value "=")) +(define (oci-container-host-environment? value) + (list? (oci-sanitize-host-environment value))) + (define (oci-sanitize-environment value) ;; Expected spec format: ;; '(("HOME" . "/home/nobody") "JAVA_HOME=/java") (oci-sanitize-mixed-list "environment" value "=")) +(define (oci-container-environment? value) + (list? (oci-sanitize-environment value))) + (define (oci-sanitize-ports value) ;; Expected spec format: ;; '(("8088" . "80") "2022:22") (oci-sanitize-mixed-list "ports" value ":")) +(define (oci-container-ports? value) + (list? (oci-sanitize-ports value))) + (define (oci-sanitize-volumes value) ;; Expected spec format: ;; '(("/mnt/dir" . "/dir") "/run/current-system/profile:/java") (oci-sanitize-mixed-list "volumes" value ":")) +(define (oci-container-volumes? value) + (list? (oci-sanitize-volumes value))) + +(define (oci-sanitize-labels value) + ;; Expected spec format: + ;; '(("foo" . "bar") "foo=bar") + (oci-sanitize-mixed-list "labels" value "=")) + +(define (oci-object-labels? value) + (list? (oci-sanitize-labels value))) + (define (oci-sanitize-shepherd-actions value) (map (lambda (el) @@ -358,6 +488,9 @@ found!") but ~a was found") el)))) value)) +(define (oci-container-shepherd-actions? value) + (list? (oci-sanitize-shepherd-actions value))) + (define (oci-sanitize-extra-arguments value) (define (valid? member) (or (string? member) @@ -373,11 +506,19 @@ but ~a was found") el)))) but ~a was found") el)))) value)) +(define (oci-object-extra-arguments? value) + (list? (oci-sanitize-extra-arguments value))) + (define (oci-image-reference image) - (if (string? image) - image - (string-append (oci-image-repository image) - ":" (oci-image-tag image)))) + "Return a string OCI image reference representing IMAGE." + (define reference + (if (string? image) + image + (string-append (oci-image-repository image) + ":" (oci-image-tag image)))) + (if (> (length (string-split reference #\/)) 1) + reference + (string-append "localhost/" reference))) (define (oci-lowerable-image? image) (or (manifest? image) @@ -392,7 +533,19 @@ but ~a was found") el)))) (define list-of-symbols? (list-of symbol?)) +(define (list-of-oci-records? name predicate value) + (map + (lambda (el) + (if (predicate el) + el + (raise + (formatted-message + (G_ "~a contains an illegal value: ~a") name el)))) + value)) + (define-maybe/no-serialization string) +(define-maybe/no-serialization package) +(define-maybe/no-serialization subid-range) (define-configuration/no-serialization oci-image (repository @@ -437,11 +590,15 @@ value will be ignored.") (define-configuration/no-serialization oci-container-configuration (user - (string "oci-container") - "The user under whose authority docker commands will be run.") + (maybe-string) + "The user name under whose authority OCI commands will be run. This field will +override the @code{user} field of @code{oci-configuration}.") (group - (string "docker") - "The group under whose authority docker commands will be run.") + (maybe-string) + "The group name under whose authority OCI commands will be run. When +using the @code{'podman} OCI runtime, this field will be ignored and the +default group of the user configured in the @code{user} field will be used. +This field will override the @code{group} field of @code{oci-configuration}.") (command (list-of-strings '()) "Overwrite the default command (@code{CMD}) of the image.") @@ -449,11 +606,11 @@ value will be ignored.") (maybe-string) "Overwrite the default entrypoint (@code{ENTRYPOINT}) of the image.") (host-environment - (list '()) + (oci-container-host-environment '()) "Set environment variables in the host environment where @command{docker run} -is invoked. This is especially useful to pass secrets from the host to the -container without having them on the @command{docker run}'s command line: by -setting the @code{MYSQL_PASSWORD} on the host and by passing +or @command{podman run} are invoked. This is especially useful to pass secrets +from the host to the container without having them on the OCI runtime command line, +for example: by setting the @code{MYSQL_PASSWORD} on the host and by passing @code{--env MYSQL_PASSWORD} through the @code{extra-arguments} field, it is possible to securely set values in the container environment. This field's value can be a list of pairs or strings, even mixed: @@ -467,7 +624,7 @@ Pair members can be strings, gexps or file-like objects. Strings are passed directly to @code{make-forkexec-constructor}." (sanitizer oci-sanitize-host-environment)) (environment - (list '()) + (oci-container-environment '()) "Set environment variables inside the container. This can be a list of pairs or strings, even mixed: @@ -477,15 +634,16 @@ or strings, even mixed: @end lisp Pair members can be strings, gexps or file-like objects. Strings are passed -directly to the Docker CLI. You can refer to the -@url{https://docs.docker.com/engine/reference/commandline/run/#env,upstream} -documentation for semantics." +directly to the OCI runtime CLI. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run/#env,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#env-e-env,Podman} +upstream documentation for semantics." (sanitizer oci-sanitize-environment)) (image (string-or-oci-image) "The image used to build the container. It can be a string or an -@code{oci-image} record. Strings are resolved by the Docker -Engine, and follow the usual format +@code{oci-image} record. Strings are resolved by the OCI runtime, +and follow the usual format @code{myregistry.local:5000/testing/test-image:tag}.") (provision (maybe-string) @@ -508,15 +666,15 @@ is @code{#f} the service has to be started manually with @command{herd start}.") "Whether to restart the service when it stops, for instance when the underlying process dies.") (shepherd-actions - (list '()) + (oci-container-shepherd-actions '()) "This is a list of @code{shepherd-action} records defining actions supported by the service." (sanitizer oci-sanitize-shepherd-actions)) (network (maybe-string) - "Set a Docker network for the spawned container.") + "Set an OCI network for the spawned container.") (ports - (list '()) + (oci-container-ports '()) "Set the port or port ranges to expose from the spawned container. This can be a list of pairs or strings, even mixed: @@ -526,12 +684,13 @@ be a list of pairs or strings, even mixed: @end lisp Pair members can be strings, gexps or file-like objects. Strings are passed -directly to the Docker CLI. You can refer to the -@url{https://docs.docker.com/engine/reference/commandline/run/#publish,upstream} -documentation for semantics." +directly to the OCI runtime CLI. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run/#publish,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#publish-p-ip-hostport-containerport-protocol,Podman} +upstream documentation for semantics." (sanitizer oci-sanitize-ports)) (volumes - (list '()) + (oci-container-volumes '()) "Set volume mappings for the spawned container. This can be a list of pairs or strings, even mixed: @@ -541,71 +700,342 @@ list of pairs or strings, even mixed: @end lisp Pair members can be strings, gexps or file-like objects. Strings are passed -directly to the Docker CLI. You can refer to the -@url{https://docs.docker.com/engine/reference/commandline/run/#volume,upstream} -documentation for semantics." +directly to the OCI runtime CLI. You can refer to the +@url{https://docs.docker.com/engine/reference/commandline/run/#volume,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#volume-v-source-volume-host-dir-container-dir-options,Podman} +upstream documentation for semantics." (sanitizer oci-sanitize-volumes)) (container-user (maybe-string) "Set the current user inside the spawned container. You can refer to the -@url{https://docs.docker.com/engine/reference/run/#user,upstream} -documentation for semantics.") +@url{https://docs.docker.com/engine/reference/run/#user,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#user-u-user-group,Podman} +upstream documentation for semantics.") (workdir (maybe-string) - "Set the current working for the spawned Shepherd service. + "Set the current working directory for the spawned Shepherd service. You can refer to the -@url{https://docs.docker.com/engine/reference/run/#workdir,upstream} -documentation for semantics.") +@url{https://docs.docker.com/engine/reference/run/#workdir,Docker} +or @url{https://docs.podman.io/en/stable/markdown/podman-run.1.html#workdir-w-dir,Podman} +upstream documentation for semantics.") (extra-arguments - (list '()) + (oci-object-extra-arguments '()) "A list of strings, gexps or file-like objects that will be directly passed -to the @command{docker run} invokation." +to the @command{docker run} or @command{podman run} invocation." (sanitizer oci-sanitize-extra-arguments))) -(define oci-container-configuration->options - (lambda (config) - (let ((entrypoint - (oci-container-configuration-entrypoint config)) - (network - (oci-container-configuration-network config)) - (user - (oci-container-configuration-container-user config)) - (workdir - (oci-container-configuration-workdir config))) - (apply append - (filter (compose not unspecified?) - `(,(if (maybe-value-set? entrypoint) - `("--entrypoint" ,entrypoint) - '()) - ,(append-map - (lambda (spec) - (list "--env" spec)) - (oci-container-configuration-environment config)) - ,(if (maybe-value-set? network) - `("--network" ,network) - '()) - ,(if (maybe-value-set? user) - `("--user" ,user) - '()) - ,(if (maybe-value-set? workdir) - `("--workdir" ,workdir) - '()) - ,(append-map - (lambda (spec) - (list "-p" spec)) - (oci-container-configuration-ports config)) - ,(append-map - (lambda (spec) - (list "-v" spec)) - (oci-container-configuration-volumes config)))))))) +(define (list-of-oci-containers? value) + (list-of-oci-records? "containers" oci-container-configuration? value)) + +(define-configuration/no-serialization oci-volume-configuration + (name + (string) + "The name of the OCI volume to provision.") + (labels + (oci-object-labels '()) + "The list of labels that will be used to tag the current volume." + (sanitizer oci-sanitize-labels)) + (extra-arguments + (oci-object-extra-arguments '()) + "A list of strings, gexps or file-like objects that will be directly passed +to the @command{docker volume create} or @command{podman volume create} +invocation." + (sanitizer oci-sanitize-extra-arguments))) + +(define (list-of-oci-volumes? value) + (list-of-oci-records? "volumes" oci-volume-configuration? value)) + +(define-configuration/no-serialization oci-network-configuration + (name + (string) + "The name of the OCI network to provision.") + (driver + (maybe-string) + "The driver to manage the network.") + (gateway + (maybe-string) + "IPv4 or IPv6 gateway for the subnet.") + (internal? + (boolean #f) + "Restrict external access to the network") + (ip-range + (maybe-string) + "Allocate container ip from a sub-range in CIDR format.") + (ipam-driver + (maybe-string) + "IP Address Management Driver.") + (ipv6? + (boolean #f) + "Enable IPv6 networking.") + (subnet + (maybe-string) + "Subnet in CIDR format that represents a network segment.") + (labels + (oci-object-labels '()) + "The list of labels that will be used to tag the current volume." + (sanitizer oci-sanitize-labels)) + (extra-arguments + (oci-object-extra-arguments '()) + "A list of strings, gexps or file-like objects that will be directly passed +to the @command{docker network create} or @command{podman network create} +invocation." + (sanitizer oci-sanitize-extra-arguments))) + +(define (list-of-oci-networks? value) + (list-of-oci-records? "networks" oci-network-configuration? value)) + +(define (package-or-string? value) + (or (package? value) (string? value))) + +(define-maybe/no-serialization package-or-string) + +(define-configuration/no-serialization oci-configuration + (runtime + (oci-runtime 'docker) + "The OCI runtime to use to run commands. It can be either @code{'docker} or +@code{'podman}.") + (runtime-cli + (maybe-package-or-string) + "The OCI runtime command line to be installed in the system profile and used +to provision OCI resources, it can be either a package or a string representing +an absolute file name to the runtime binary entrypoint. When unset it will default +to @code{docker-cli} package for the @code{'docker} runtime or to @code{podman} +package for the @code{'podman} runtime.") + (runtime-extra-arguments + (list '()) + "A list of strings, gexps or file-like objects that will be placed +after each @command{docker} or @command{podman} invokation.") + (user + (string "oci-container") + "The user name under whose authority OCI runtime commands will be run.") + (group + (maybe-string) + "The group name under whose authority OCI commands will be run. When +using the @code{'podman} OCI runtime, this field will be ignored and the +default group of the user configured in the @code{user} field will be used.") + (subuids-range + (maybe-subid-range) + "An optional @code{subid-range} record allocating subuids for the user from +the @code{user} field. When unset, with the rootless Podman OCI runtime, it +defaults to @code{(subid-range (name \"oci-container\"))}.") + (subgids-range + (maybe-subid-range) + "An optional @code{subid-range} record allocating subgids for the user from +the @code{user} field. When unset, with the rootless Podman OCI runtime, it +defaults to @code{(subid-range (name \"oci-container\"))}.") + (containers + (list-of-oci-containers '()) + "The list of @code{oci-container-configuration} records representing the +containers to provision. The use of the @code{oci-extension} record should +be preferred for most cases.") + (networks + (list-of-oci-networks '()) + "The list of @code{oci-network-configuration} records representing the +networks to provision. The use of the @code{oci-extension} record should +be preferred for most cases.") + (volumes + (list-of-oci-volumes '()) + "The list of @code{oci-volume-configuration} records representing the +volumes to provision. The use of the @code{oci-extension} record should +be preferred for most cases.") + (verbose? + (boolean #f) + "When true, additional output will be printed, allowing to better follow the +flow of execution.") + (home-service? + (boolean for-home?) + "This is an internal field denoting whether this configuration is used in a +Guix Home context, as opposed to the default Guix System context.")) -(define* (get-keyword-value args keyword #:key (default #f)) - (let ((kv (memq keyword args))) - (if (and kv (>= (length kv) 2)) - (cadr kv) - default))) +(define (oci-runtime-system-environment runtime user) + (if (eq? runtime 'podman) + (list + #~(string-append + "HOME=" (passwd:dir (getpwnam #$user)))) + #~())) + +(define (oci-runtime-cli runtime runtime-cli profile-directory) + "Return a gexp that, when lowered, evaluates to the of the OCI +runtime command requested by the user." + (if (string? runtime-cli) + ;; It is a user defined absolute file name. + runtime-cli + #~(string-append + #$(if (maybe-value-set? runtime-cli) + runtime-cli + profile-directory) + #$(if (eq? 'podman runtime) + "/bin/podman" + "/bin/docker")))) + +(define* (oci-runtime-system-cli config #:key (profile-directory "/run/current-system/profile")) + (let ((runtime-cli + (oci-configuration-runtime-cli config)) + (runtime + (oci-configuration-runtime config))) + (oci-runtime-cli runtime runtime-cli profile-directory))) + +(define (oci-runtime-home-cli config) + (let ((runtime-cli + (oci-configuration-runtime-cli config)) + (runtime + (oci-configuration-runtime config))) + (oci-runtime-cli runtime runtime-cli + (string-append (getenv "HOME") + "/.guix-home/profile")))) + +(define-configuration/no-serialization oci-extension + (containers + (list-of-oci-containers '()) + "The list of @code{oci-container-configuration} records representing the +containers to add.") + (networks + (list-of-oci-networks '()) + "The list of @code{oci-network-configuration} records representing the +networks to add.") + (volumes + (list-of-oci-volumes '()) + "The list of @code{oci-volume-configuration} records representing the +volumes to add.")) + +(define (oci-image->container-name image) + "Infer the name of an OCI backed Shepherd service from its OCI image." + (basename + (if (string? image) + (first (string-split image #\:)) + (oci-image-repository image)))) + +(define (oci-command-line-shepherd-action object-name invocation entrypoint) + "Return a Shepherd action printing a given INVOCATION of an OCI command for the +given OBJECT-NAME." + (shepherd-action + (name 'command-line) + (documentation + (format #f "Prints ~a's OCI runtime command line invocation." + object-name)) + (procedure + #~(lambda _ + (format #t "Entrypoint:~%~a~%" #$entrypoint) + (format #t "Invocation:~%~a~%" #$invocation))))) + +(define (oci-container-shepherd-name runtime config) + "Return the name of an OCI backed Shepherd service based on CONFIG. +The name configured in the configuration record is returned when +CONFIG's name field has a value, otherwise a name is inferred from CONFIG's +image field." + (define name (oci-container-configuration-provision config)) + (define image (oci-container-configuration-image config)) + + (if (maybe-value-set? name) + name + (string-append (symbol->string runtime) "-" + (oci-image->container-name image)))) + +(define (oci-networks-shepherd-name runtime) + "Return the name of the OCI networks provisioning Shepherd service based on +RUNTIME." + (string-append (symbol->string runtime) "-networks")) + +(define (oci-volumes-shepherd-name runtime) + "Return the name of the OCI volumes provisioning Shepherd service based on +RUNTIME." + (string-append (symbol->string runtime) "-volumes")) + +(define (oci-networks-home-shepherd-name runtime) + "Return the name of the OCI volumes provisioning Home Shepherd service based on +RUNTIME." + (string-append "home-" (oci-networks-shepherd-name runtime))) + +(define (oci-volumes-home-shepherd-name runtime) + "Return the name of the OCI volumes provisioning Home Shepherd service based on +RUNTIME." + (string-append "home-" (oci-volumes-shepherd-name runtime))) + +(define (oci-container-configuration->options config) + "Map CONFIG, an oci-container-configuration record, to a gexp that, upon +lowering, will be evaluated to a list of strings containing command line options +for the OCI runtime run command." + (let ((entrypoint (oci-container-configuration-entrypoint config)) + (network (oci-container-configuration-network config)) + (user (oci-container-configuration-container-user config)) + (workdir (oci-container-configuration-workdir config))) + (apply append + (filter (compose not unspecified?) + (list (if (maybe-value-set? entrypoint) + `("--entrypoint" ,entrypoint) + '()) + (append-map + (lambda (spec) + (list "--env" spec)) + (oci-container-configuration-environment config)) + (if (maybe-value-set? network) + `("--network" ,network) + '()) + (if (maybe-value-set? user) + `("--user" ,user) + '()) + (if (maybe-value-set? workdir) + `("--workdir" ,workdir) + '()) + (append-map + (lambda (spec) + (list "-p" spec)) + (oci-container-configuration-ports config)) + (append-map + (lambda (spec) + (list "-v" spec)) + (oci-container-configuration-volumes config))))))) + +(define (oci-network-configuration->options config) + "Map CONFIG, an oci-network-configuration record, to a gexp that, upon +lowering, will be evaluated to a list of strings containing command line options +for the OCI runtime network create command." + (let ((driver (oci-network-configuration-driver config)) + (gateway (oci-network-configuration-gateway config)) + (internal? (oci-network-configuration-internal? config)) + (ip-range (oci-network-configuration-ip-range config)) + (ipam-driver (oci-network-configuration-ipam-driver config)) + (ipv6? (oci-network-configuration-ipv6? config)) + (subnet (oci-network-configuration-subnet config))) + (apply append + (filter (compose not unspecified?) + (list (if (maybe-value-set? driver) + `("--driver" ,driver) + '()) + (if (maybe-value-set? gateway) + `("--gateway" ,gateway) + '()) + (if internal? + `("--internal") + '()) + (if (maybe-value-set? ip-range) + `("--ip-range" ,ip-range) + '()) + (if (maybe-value-set? ipam-driver) + `("--ipam-driver" ,ipam-driver) + '()) + (if ipv6? + `("--ipv6") + '()) + (if (maybe-value-set? subnet) + `("--subnet" ,subnet) + '()) + (append-map + (lambda (spec) + (list "--label" spec)) + (oci-network-configuration-labels config))))))) + +(define (oci-volume-configuration->options config) + "Map CONFIG, an oci-volume-configuration record, to a gexp that, upon +lowering, will be evaluated to a list of strings containing command line options +for the OCI runtime volume create command." + (append-map + (lambda (spec) + (list "--label" spec)) + (oci-volume-configuration-labels config))) (define (lower-operating-system os target system) + "Lower OS, an operating-system record, into a tarball containing an OCI image." (mlet* %store-monad ((tarball (lower-object @@ -614,24 +1044,11 @@ to the @command{docker run} invokation." #:target target))) (return tarball))) -(define (lower-manifest name image target system) - (define value (oci-image-value image)) - (define options (oci-image-pack-options image)) - (define image-reference - (oci-image-reference image)) - (define image-tag - (let* ((extra-options - (get-keyword-value options #:extra-options)) - (image-tag-option - (and extra-options - (get-keyword-value extra-options #:image-tag)))) - (if image-tag-option - '() - `(#:extra-options (#:image-tag ,image-reference))))) - +(define (lower-manifest name value options image-reference + target system grafts?) + "Lower VALUE, a manifest record, into a tarball containing an OCI image." (mlet* %store-monad - ((_ (set-grafting - (oci-image-grafts? image))) + ((_ (set-grafting grafts?)) (guile (set-guile-for-build (default-guile))) (profile (profile-derivation value @@ -642,14 +1059,11 @@ to the @command{docker run} invokation." (tarball (apply pack:docker-image `(,name ,profile ,@options - ,@image-tag #:localstatedir? #t)))) (return tarball))) -(define (lower-oci-image name image) - (define value (oci-image-value image)) - (define image-target (oci-image-target image)) - (define image-system (oci-image-system image)) +(define (lower-oci-image-state name value options reference + image-target image-system grafts?) (define target (if (maybe-value-set? image-target) image-target @@ -662,7 +1076,8 @@ to the @command{docker run} invokation." (run-with-store store (match value ((? manifest? value) - (lower-manifest name image target system)) + (lower-manifest name value options reference + target system grafts?)) ((? operating-system? value) (lower-operating-system value target system)) ((or (? gexp? value) @@ -677,113 +1092,661 @@ operating-system, gexp or file-like records but ~a was found") #:target target #:system system))) -(define (%oci-image-loader name image tag) - (let ((docker (file-append docker-cli "/bin/docker")) - (tarball (lower-oci-image name image))) - (with-imported-modules '((guix build utils)) - (program-file (format #f "~a-image-loader" name) - #~(begin - (use-modules (guix build utils) - (ice-9 popen) - (ice-9 rdelim)) +(define (lower-oci-image name image) + "Lower IMAGE, a oci-image record, into a tarball containing an OCI image." + (lower-oci-image-state + name + (oci-image-value image) + (oci-image-pack-options image) + (oci-image-reference image) + (oci-image-target image) + (oci-image-system image) + (oci-image-grafts? image))) + +(define-record-type* <oci-runtime-state> + oci-runtime-state + make-oci-runtime-state + oci-runtime-state? + this-oci-runtime-state - (format #t "Loading image for ~a from ~a...~%" #$name #$tarball) - (define line - (read-line - (open-input-pipe - (string-append #$docker " load -i " #$tarball)))) + (runtime oci-runtime-state-runtime + (default 'docker)) + (runtime-cli oci-runtime-state-runtime-cli) + (user oci-runtime-state-user) + (group oci-runtime-state-group) + (runtime-environment oci-runtime-state-runtime-environment + (default #~())) + (runtime-requirement oci-runtime-state-runtime-requirement + (default '())) + (runtime-extra-arguments oci-runtime-state-runtime-extra-arguments + (default '()))) - (unless (or (eof-object? line) - (string-null? line)) - (format #t "~a~%" line) - (let ((repository&tag - (string-drop line - (string-length - "Loaded image: ")))) +(define-record-type* <oci-state> + oci-state + make-oci-state + oci-state? + this-oci-state - (invoke #$docker "tag" repository&tag #$tag) - (format #t "Tagged ~a with ~a...~%" #$tarball #$tag)))))))) + (networks oci-state-networks) + (volumes oci-state-volumes) + (containers oci-state-containers) + (networks-name oci-state-networks-name + (default #f)) + (volumes-name oci-state-volumes-name + (default #f)) + (networks-requirement oci-state-networks-requirement + (default '())) + (volumes-requirement oci-state-volumes-requirement + (default '())) + (containers-requirement oci-state-containers-requirement + (default '()))) -(define (oci-container-shepherd-service config) - (define (guess-name name image) - (if (maybe-value-set? name) - name - (string-append "docker-" - (basename - (if (string? image) - (first (string-split image #\:)) - (oci-image-repository image)))))) +(define-record-type* <oci-container-invocation> + oci-container-invocation + make-oci-container-invocation + oci-container-invocation? + this-oci-container-invocation + + (runtime oci-container-invocation-runtime + (default 'docker)) + (runtime-cli oci-container-invocation-runtime-cli) + (name oci-container-invocation-name) + (command oci-container-invocation-command + (default '())) + (image-reference oci-container-invocation-image-reference) + (options oci-container-invocation-options + (default '())) + (run-extra-arguments oci-container-invocation-run-extra-arguments + (default '())) + (runtime-extra-arguments oci-container-invocation-runtime-extra-arguments + (default '()))) + +(define (oci-container-configuration->oci-container-invocation runtime-state + config) + (oci-container-invocation + (runtime (oci-runtime-state-runtime runtime-state)) + (runtime-cli (oci-runtime-state-runtime-cli runtime-state)) + (name + (oci-container-shepherd-name runtime config)) + (command + (oci-container-configuration-command config)) + (image-reference + (oci-image-reference (oci-container-configuration-image config))) + (options + (oci-container-configuration->options config)) + (run-extra-arguments + (oci-container-configuration-extra-arguments config)) + (runtime-extra-arguments + (oci-runtime-state-runtime-extra-arguments runtime-state)))) + +(define* (oci-image-loader runtime-state name image tag #:key verbose?) + "Return a file-like object that, once lowered, will evaluate to a program able +to load IMAGE through RUNTIME-CLI and to tag it with TAG afterwards." + (let ((tarball (lower-oci-image name image))) + (with-imported-modules (source-module-closure '((gnu build oci-containers))) + (program-file + (format #f "~a-image-loader" name) + #~(begin + (use-modules (gnu build oci-containers)) + (oci-image-load '#$(oci-runtime-state-runtime runtime-state) + #$(oci-runtime-state-runtime-cli runtime-state) + #$tarball #$name #$tag + #:verbose? #$verbose?)))))) - (let* ((docker (file-append docker-cli "/bin/docker")) - (actions (oci-container-configuration-shepherd-actions config)) - (auto-start? - (oci-container-configuration-auto-start? config)) - (user (oci-container-configuration-user config)) - (group (oci-container-configuration-group config)) - (host-environment - (oci-container-configuration-host-environment config)) - (command (oci-container-configuration-command config)) - (log-file (oci-container-configuration-log-file config)) - (provision (oci-container-configuration-provision config)) - (requirement (oci-container-configuration-requirement config)) - (respawn? - (oci-container-configuration-respawn? config)) - (image (oci-container-configuration-image config)) - (image-reference (oci-image-reference image)) - (options (oci-container-configuration->options config)) - (name (guess-name provision image)) - (extra-arguments - (oci-container-configuration-extra-arguments config))) +(define (oci-container-run-invocation container-invocation) + "Return a list representing the OCI runtime +invocation for running containers." + ;; run [OPTIONS] IMAGE [COMMAND] [ARG...] + `(,(oci-container-invocation-runtime-cli container-invocation) + ,@(oci-container-invocation-runtime-extra-arguments container-invocation) + "run" "--rm" + ,@(if (eq? (oci-container-invocation-runtime container-invocation) + 'podman) + ;; This is because podman takes some time to + ;; release container names. --replace seems + ;; to be required to be able to restart services. + '("--replace") + '()) + "--name" ,(oci-container-invocation-name container-invocation) + ,@(oci-container-invocation-options container-invocation) + ,@(oci-container-invocation-run-extra-arguments container-invocation) + ,(oci-container-invocation-image-reference container-invocation) + ,@(oci-container-invocation-command container-invocation))) - (shepherd-service (provision `(,(string->symbol name))) - (requirement `(dockerd user-processes ,@requirement)) +(define* (oci-container-entrypoint name invocation + #:key verbose? + (pre-script #~())) + "Return a file-like object that, once lowered, will evaluate to the entrypoint +for the Shepherd service that will run INVOCATION." + (program-file + (string-append "oci-entrypoint-" name) + (with-imported-modules (source-module-closure + '((gnu build oci-containers))) + #~(begin + (use-modules (gnu build oci-containers) + (srfi srfi-1)) + (oci-container-execlp + (list #$@invocation) + #:verbose? #$verbose? + #:pre-script + (lambda _ + (when (and #$verbose? + (zero? (length '(#$@pre-script)))) + (format #t "No pre script to run...")) + #$@pre-script)))))) + +(define* (oci-container-shepherd-service state runtime-state config + #:key verbose? + networks? + volumes?) + "Return a Shepherd service object that will run the OCI container represented +by CONFIG through RUNTIME-CLI." + (match-record config <oci-container-configuration> + (shepherd-actions auto-start? user group host-environment + log-file requirement respawn? image) + (define runtime (oci-runtime-state-runtime runtime-state)) + (define runtime-cli (oci-runtime-state-runtime-cli runtime-state)) + (define image-reference (oci-image-reference image)) + (define shepherd-name (oci-container-shepherd-name runtime config)) + (define oci-container-user + (if (maybe-value-set? user) + user + (oci-runtime-state-user runtime-state))) + (define oci-container-group + (if (maybe-value-set? group) + group + (oci-runtime-state-group runtime-state))) + (define networks-service + (if networks? + (list + (string->symbol + (oci-state-networks-name state))) + '())) + (define volumes-service + (if volumes? + (list + (string->symbol + (oci-state-volumes-name state))) + '())) + (define oci-container-requirement + (append requirement + (oci-state-containers-requirement state) + (oci-runtime-state-runtime-requirement runtime-state) + networks-service + volumes-service)) + (define environment-variables + #~(append + (list #$@host-environment) + (list #$@(oci-runtime-state-runtime-environment runtime-state)))) + (define invocation + (oci-container-run-invocation + (oci-container-configuration->oci-container-invocation + runtime-state config))) + (define* (container-action command) + #~(lambda _ + (fork+exec-command + (list #$@command) + #$@(if oci-container-user + (list #:user oci-container-user) + '()) + #$@(if oci-container-group + (list #:group oci-container-group) + '()) + #$@(if (maybe-value-set? log-file) + (list #:log-file log-file) + '()) + #$@(if (and oci-container-user (eq? runtime 'podman)) + (list #:directory + #~(passwd:dir + (getpwnam #$oci-container-user))) + '()) + #:environment-variables + #$environment-variables))) + (define start-entrypoint + (oci-container-entrypoint + shepherd-name invocation + #:verbose? verbose? + #:pre-script + (if (oci-image? image) + #~((system* + #$(oci-image-loader + runtime-state shepherd-name image + image-reference + #:verbose? verbose?))) + #~()))) + + (shepherd-service (provision `(,(string->symbol shepherd-name))) + (requirement oci-container-requirement) (respawn? respawn?) (auto-start? auto-start?) (documentation (string-append - "Docker backed Shepherd service for " - (if (oci-image? image) name image) ".")) + (oci-runtime-name runtime) + " backed Shepherd service for " + (if (oci-image? image) shepherd-name image) ".")) (start - #~(lambda () - #$@(if (oci-image? image) - #~((invoke #$(%oci-image-loader - name image image-reference))) - #~()) - (fork+exec-command - ;; docker run [OPTIONS] IMAGE [COMMAND] [ARG...] - (list #$docker "run" "--rm" "--name" #$name - #$@options #$@extra-arguments - #$image-reference #$@command) - #:user #$user - #:group #$group - #$@(if (maybe-value-set? log-file) - (list #:log-file log-file) - '()) - #:environment-variables - (list #$@host-environment)))) + (container-action + (list start-entrypoint))) (stop - #~(lambda _ - (invoke #$docker "rm" "-f" #$name))) + (container-action + (list + (oci-container-entrypoint + shepherd-name (list runtime-cli "rm" "-f" shepherd-name) + #:verbose? verbose?)))) (actions - (if (oci-image? image) - '() - (append + (append + (list + (oci-command-line-shepherd-action + shepherd-name #~(string-join (list #$@invocation) " ") + start-entrypoint)) + (if (oci-image? image) + '() (list (shepherd-action (name 'pull) (documentation (format #f "Pull ~a's image (~a)." - name image)) + shepherd-name image)) (procedure - #~(lambda _ - (invoke #$docker "pull" #$image))))) - actions)))))) + (container-action + (list + (oci-container-entrypoint + shepherd-name (list runtime-cli "pull" image) + #:verbose? verbose?))))))) + shepherd-actions))))) + +(define (oci-object-create-invocation object runtime-cli name options + runtime-extra-arguments + create-extra-arguments) + "Return a gexp that, upon lowering, will evaluate to the OCI runtime +invocation for creating networks and volumes." + ;; network|volume create [options] [NAME] + #~(list #$runtime-cli #$@runtime-extra-arguments #$object "create" + #$@options #$@create-extra-arguments #$name)) -(define %oci-container-accounts +(define (format-oci-invocations invocations) + "Return a gexp that, upon lowering, will evaluate to a formatted message +containing the INVOCATIONS that the OCI runtime will execute to provision +networks or volumes." + #~(string-join (map (lambda (i) (string-join i " ")) + (list #$@invocations)) + "\n")) + +(define* (oci-object-create-script object runtime runtime-cli invocations + #:key verbose?) + "Return a file-like object that, once lowered, will evaluate to a program able +to create OCI networks and volumes through RUNTIME-CLI." + (define runtime-string (symbol->string runtime)) + (define runtime-name (oci-runtime-name runtime)) + (with-imported-modules (source-module-closure + '((gnu build oci-containers))) + + (program-file + (string-append runtime-string "-" object "s-create.scm") + #~(begin + (use-modules (gnu build oci-containers)) + (oci-object-create '#$runtime #$runtime-cli #$runtime-name + #$object (list #$@invocations) + #:verbose? #$verbose?))))) + +(define* (oci-object-shepherd-service object runtime-state name + oci-state-requirement invocations + #:key verbose?) + "Return a Shepherd service object that will provision the OBJECTs represented +by INVOCATIONS through RUNTIME-STATE." + (match-record runtime-state <oci-runtime-state> + (runtime runtime-cli runtime-requirement user group + runtime-environment) + (define entrypoint + (oci-object-create-script + object runtime runtime-cli invocations #:verbose? verbose?)) + (define requirement + (append runtime-requirement oci-state-requirement)) + + (shepherd-service (provision (list (string->symbol name))) + (requirement requirement) + (one-shot? #t) + (documentation + (string-append + (oci-runtime-name runtime) " " object + " provisioning service")) + (start + #~(lambda _ + (fork+exec-command + (list #$entrypoint) + #$@(if user (list #:user user) '()) + #$@(if group (list #:group group) '()) + #:environment-variables + (list #$@runtime-environment)))) + (actions + (list + (oci-command-line-shepherd-action + name (format-oci-invocations invocations) + entrypoint)))))) + +(define* (oci-networks-shepherd-service state runtime-state + #:key verbose?) + "Return a Shepherd service object that will create the networks represented +in STATE." + (define runtime-cli + (oci-runtime-state-runtime-cli runtime-state)) + (define invocations + (map + (lambda (network) + (oci-object-create-invocation + "network" runtime-cli + (oci-network-configuration-name network) + (oci-network-configuration->options network) + (oci-runtime-state-runtime-extra-arguments runtime-state) + (oci-network-configuration-extra-arguments network))) + (oci-state-networks state))) + + (oci-object-shepherd-service + "network" runtime-state (oci-state-networks-name state) + (oci-state-networks-requirement state) + invocations #:verbose? verbose?)) + +(define* (oci-volumes-shepherd-service state runtime-state + #:key verbose?) + "Return a Shepherd service object that will create the volumes represented +in STATE." + (define runtime-cli + (oci-runtime-state-runtime-cli runtime-state)) + (define invocations + (map + (lambda (volume) + (oci-object-create-invocation + "volume" runtime-cli + (oci-volume-configuration-name volume) + (oci-volume-configuration->options volume) + (oci-runtime-state-runtime-extra-arguments runtime-state) + (oci-volume-configuration-extra-arguments volume))) + (oci-state-volumes state))) + + (oci-object-shepherd-service + "volume" runtime-state (oci-state-volumes-name state) + (oci-state-volumes-requirement state) + invocations #:verbose? verbose?)) + +(define (oci-service-accounts config) + (define user (oci-configuration-user config)) + (define maybe-group (oci-configuration-group config)) + (define runtime (oci-configuration-runtime config)) (list (user-account - (name "oci-container") + (name user) (comment "OCI services account") - (group "docker") - (system? #t) - (home-directory "/var/empty") + (group "users") + (supplementary-groups + (list (oci-runtime-group runtime maybe-group))) + (system? (eq? 'docker runtime)) + (home-directory (if (eq? 'podman runtime) + (string-append "/home/" user) + "/var/empty")) + (create-home-directory? (eq? 'podman runtime)) (shell (file-append shadow "/sbin/nologin"))))) + +(define* (oci-state->shepherd-services state runtime-state #:key verbose?) + "Returns a list of Shepherd services based on the input OCI state." + (define networks? + (> (length (oci-state-networks state)) 0)) + (define volumes? + (> (length (oci-state-volumes state)) 0)) + (append + (map + (lambda (c) + (oci-container-shepherd-service + state runtime-state c + #:verbose? verbose? + #:volumes? volumes? + #:networks? networks?)) + (oci-state-containers state)) + (if networks? + (list + (oci-networks-shepherd-service + state runtime-state + #:verbose? verbose?)) + '()) + (if volumes? + (list + (oci-volumes-shepherd-service + state runtime-state + #:verbose? verbose?)) + '()))) + +(define* (oci-configuration->oci-runtime-state config #:key verbose?) + (define runtime + (oci-configuration-runtime config)) + (define home-service? + (oci-configuration-home-service? config)) + (define runtime-cli + (if home-service? + (oci-runtime-home-cli config) + (oci-runtime-system-cli config))) + (define user + (if home-service? + #f + (oci-configuration-user config))) + (define group + (if home-service? + #f + (if (eq? runtime 'podman) + #~(group:name + (getgrgid + (passwd:gid + (getpwnam #$user)))) + (oci-runtime-group config (oci-configuration-group config))))) + (define runtime-requirement + (if home-service? + '() + (oci-runtime-system-requirement runtime))) + (define runtime-environment + (if home-service? + #~() + (oci-runtime-system-environment runtime user))) + (oci-runtime-state + (runtime runtime) + (runtime-cli runtime-cli) + (user user) + (group group) + (runtime-extra-arguments + (oci-configuration-runtime-extra-arguments config)) + (runtime-environment runtime-environment) + (runtime-requirement runtime-requirement))) + +(define (oci-configuration->oci-state config) + (define runtime + (oci-configuration-runtime config)) + (define home-service? + (oci-configuration-home-service? config)) + (define networks-name + (if home-service? + (oci-networks-home-shepherd-name runtime) + (oci-networks-shepherd-name runtime))) + (define volumes-name + (if home-service? + (oci-volumes-home-shepherd-name runtime) + (oci-volumes-shepherd-name runtime))) + (define networks-requirement + (if home-service? + '() + '(networking))) + (oci-state + (containers (oci-configuration-containers config)) + (networks (oci-configuration-networks config)) + (volumes (oci-configuration-volumes config)) + (networks-name networks-name) + (volumes-name volumes-name) + (networks-requirement networks-requirement))) + +(define (oci-configuration->shepherd-services config) + (let* ((verbose? (oci-configuration-verbose? config)) + (state (oci-configuration->oci-state config)) + (runtime-state + (oci-configuration->oci-runtime-state config #:verbose? verbose?))) + (oci-state->shepherd-services state runtime-state #:verbose? verbose?))) + +(define (oci-service-subids config) + "Return a subids-extension record representing subuids and subgids required by +the rootless Podman backend." + (define (find-duplicates subids) + (let loop ((names '()) + (subids subids)) + (if (null? names) + names + (loop + (let ((name (subid-range-name (car subids)))) + (if (member name names) + (raise + (formatted-message + (G_ "Duplicated subid-range: ~a. subid-ranges names should be +unique, please remove the duplicate.") name)) + (cons name names))) + (cdr subids))))) + + (define runtime + (oci-configuration-runtime config)) + (define user + (oci-configuration-user config)) + + (define subgids (oci-configuration-subgids-range config)) + (find-duplicates subgids) + + (define subuids (oci-configuration-subuids-range config)) + (find-duplicates subgids) + + (define container-users + (filter (lambda (range) + (and (maybe-value-set? + (subid-range-name range)) + (not (string=? (subid-range-name range) user)))) + (map (lambda (container) + (subid-range + (name + (oci-container-configuration-user container)))) + (oci-configuration-containers config)))) + (define subgid-ranges + (cons + (if (maybe-value-set? subgids) + subgids + (subid-range (name user))) + container-users)) + (define subuid-ranges + (cons + (if (maybe-value-set? subuids) + subuids + (subid-range (name user))) + container-users)) + + (if (eq? 'podman runtime) + (subids-extension + (subgids + subgid-ranges) + (subuids + subuid-ranges)) + (subids-extension))) + +(define (oci-objects-merge-lst a b object get-name) + (define (contains? value lst) + (member value (map get-name lst))) + (let loop ((merged '()) + (lst (append a b))) + (if (null? lst) + merged + (loop + (let ((element (car lst))) + (when (contains? element merged) + (raise + (formatted-message + (G_ "Duplicated ~a: ~a. Names of ~a should be unique, please +remove the duplicate.") object (get-name element) object))) + (cons element merged)) + (cdr lst))))) + +(define (oci-extension-merge a b) + (oci-extension + (containers (oci-objects-merge-lst + (oci-extension-containers a) + (oci-extension-containers b) + "container" + (lambda (config) + (define maybe-name + (oci-container-configuration-provision config)) + (if (maybe-value-set? maybe-name) + maybe-name + (oci-image->container-name + (oci-container-configuration-image config)))))) + (networks (oci-objects-merge-lst + (oci-extension-networks a) + (oci-extension-networks b) + "network" + oci-network-configuration-name)) + (volumes (oci-objects-merge-lst + (oci-extension-volumes a) + (oci-extension-volumes b) + "volume" + oci-volume-configuration-name)))) + +(define (oci-service-profile runtime runtime-cli) + `(,bash-minimal + ,@(if (string? runtime-cli) + '() + (list + (cond + ((maybe-value-set? runtime-cli) + runtime-cli) + ((eq? 'podman runtime) + podman) + (else + docker-cli)))))) + +(define (oci-configuration-extend config extension) + (oci-configuration + (inherit config) + (containers + (oci-objects-merge-lst + (oci-configuration-containers config) + (oci-extension-containers extension) + "container" + (lambda (oci-config) + (define runtime + (oci-configuration-runtime config)) + (oci-container-shepherd-name runtime oci-config)))) + (networks (oci-objects-merge-lst + (oci-configuration-networks config) + (oci-extension-networks extension) + "network" + oci-network-configuration-name)) + (volumes (oci-objects-merge-lst + (oci-configuration-volumes config) + (oci-extension-volumes extension) + "volume" + oci-volume-configuration-name)))) + +(define oci-service-type + (service-type + (name 'oci) + (extensions + (list + (service-extension profile-service-type + (lambda (config) + (let ((runtime-cli + (oci-configuration-runtime-cli config)) + (runtime + (oci-configuration-runtime config))) + (oci-service-profile runtime runtime-cli)))) + (service-extension subids-service-type + oci-service-subids) + (service-extension account-service-type + oci-service-accounts) + (service-extension shepherd-root-service-type + oci-configuration->shepherd-services))) + ;; Concatenate OCI object lists. + (compose (lambda (args) + (fold oci-extension-merge + (oci-extension) + args))) + (extend oci-configuration-extend) + (default-value (oci-configuration)) + (description + "This service implements the provisioning of OCI objects such +as containers, networks and volumes."))) diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm index fef8915439..c905d35a34 100644 --- a/gnu/services/dict.scm +++ b/gnu/services/dict.scm @@ -29,7 +29,6 @@ #:use-module (gnu services shepherd) #:use-module (gnu system shadow) #:use-module ((gnu packages admin) #:select (shadow)) - #:use-module (gnu packages dico) #:use-module (gnu packages dictionaries) #:autoload (gnu build linux-container) (%namespaces) #:autoload (gnu system file-systems) (file-system-mapping) diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm index 828ceea313..6abfbc49a0 100644 --- a/gnu/services/docker.scm +++ b/gnu/services/docker.scm @@ -31,7 +31,10 @@ #:use-module (gnu system shadow) #:use-module (gnu packages docker) #:use-module (gnu packages linux) ;singularity + #:use-module (guix deprecation) + #:use-module (guix diagnostics) #:use-module (guix gexp) + #:use-module (guix i18n) #:use-module (guix records) #:use-module (srfi srfi-1) #:use-module (ice-9 format) @@ -67,16 +70,18 @@ oci-container-configuration-volumes oci-container-configuration-container-user oci-container-configuration-workdir - oci-container-configuration-extra-arguments - oci-container-shepherd-service - %oci-container-accounts) + oci-container-configuration-extra-arguments) #:export (containerd-configuration containerd-service-type docker-configuration docker-service-type singularity-service-type - oci-container-service-type)) + ;; For backwards compatibility, until the + ;; oci-container-service-type is fully deprecated. + oci-container-shepherd-service + oci-container-service-type + %oci-container-accounts)) (define-maybe file-like) @@ -297,17 +302,26 @@ bundles in Docker containers.") ;;; OCI container. ;;; -(define (configs->shepherd-services configs) - (map oci-container-shepherd-service configs)) +;; For backwards compatibility, until the +;; oci-container-service-type is fully deprecated. +(define-deprecated (oci-container-shepherd-service config) + oci-service-type + ((@ (gnu services containers) oci-container-shepherd-service) + 'docker config)) +(define %oci-container-accounts + (filter user-account? (oci-service-accounts (oci-configuration)))) (define oci-container-service-type (service-type (name 'oci-container) - (extensions (list (service-extension profile-service-type - (lambda _ (list docker-cli))) - (service-extension account-service-type - (const %oci-container-accounts)) - (service-extension shepherd-root-service-type - configs->shepherd-services))) + (extensions + (list (service-extension oci-service-type + (lambda (containers) + (warning + (G_ + "'oci-container-service-type' is\ + deprecated, use 'oci-service-type' instead~%")) + (oci-extension + (containers containers)))))) (default-value '()) (extend append) (compose concatenate) diff --git a/gnu/tests/containers.scm b/gnu/tests/containers.scm index 618da2a92c..1a442cddc6 100644 --- a/gnu/tests/containers.scm +++ b/gnu/tests/containers.scm @@ -27,6 +27,9 @@ #:use-module (gnu services) #:use-module (gnu services containers) #:use-module (gnu services desktop) + #:use-module ((gnu services docker) + #:select (containerd-service-type + docker-service-type)) #:use-module (gnu services dbus) #:use-module (gnu services networking) #:use-module (gnu system) @@ -39,7 +42,9 @@ #:use-module (guix profiles) #:use-module ((guix scripts pack) #:prefix pack:) #:use-module (guix store) - #:export (%test-rootless-podman)) + #:export (%test-rootless-podman + %test-oci-service-rootless-podman + %test-oci-service-docker)) (define %rootless-podman-os @@ -133,7 +138,7 @@ (status (close-pipe port))) output))) (let* ((bash - ,(string-append #$bash "/bin/bash")) + (string-append #$bash "/bin/bash")) (response1 (slurp bash "-c" (string-append "ls -la /sys/fs/cgroup | " @@ -345,3 +350,555 @@ standard output device and then enters a new line.") (name "rootless-podman") (description "Test rootless Podman service.") (value (build-tarball&run-rootless-podman-test)))) + + +(define %oci-network + (oci-network-configuration (name "my-network"))) + +(define %oci-volume + (oci-volume-configuration (name "my-volume"))) + +(define %oci-wait-for-file + #~(define (wait-for-file file) + ;; Wait until FILE shows up. + (let loop ((i 6)) + (cond ((file-exists? file) + #t) + ((zero? i) + (error "file didn't show up" file)) + (else + (pk 'wait-for-file file) + (sleep 1) + (loop (- i 1))))))) + +(define %oci-read-lines + #~(define (read-lines file-or-port) + (define (loop-lines port) + (let loop ((lines '())) + (match (read-line port) + ((? eof-object?) + (reverse lines)) + (line + (loop (cons line lines)))))) + + (if (port? file-or-port) + (loop-lines file-or-port) + (call-with-input-file file-or-port + loop-lines)))) + +(define %oci-slurp + #~(define slurp + (lambda args + (let* ((port + (apply open-pipe* OPEN_READ + (list "sh" "-l" "-c" + (string-join args " ")))) + (output (read-lines port)) + (status (close-pipe port))) + output)))) + +(define (%oci-rootless-podman-run commands) + #~((use-modules (srfi srfi-1) + (ice-9 format) + (ice-9 popen) + (ice-9 match) + (ice-9 rdelim) + (gnu build oci-containers)) + + #$%oci-wait-for-file + #$%oci-read-lines + #$%oci-slurp + + (define responses + (map + (lambda (index) + (format #f "/tmp/response_~a" index)) + (iota (length '#$commands)))) + + (match (primitive-fork) + (0 + (begin + (setgid (passwd:gid (getpwnam "oci-container"))) + (setuid (passwd:uid (getpw "oci-container"))) + + (let* ((outputs + (list #$@commands)) + (outputs-responses + (zip outputs responses))) + (for-each + (match-lambda + ((output response) + (call-with-output-file response + (lambda (port) + (display (string-join output "\n") port))))) + outputs-responses)))) + (pid + (cdr (waitpid pid)))) + + (for-each wait-for-file responses) + (map + (lambda (response) + (sort (slurp "cat" response) string<=?)) + responses))) + +(define %oci-rootless-podman-os + (simple-operating-system + (service dhcpcd-service-type) + (service dbus-root-service-type) + (service polkit-service-type) + (service elogind-service-type) + (service iptables-service-type) + (service rootless-podman-service-type) + (extra-special-file "/shared.txt" + (plain-file "shared.txt" "hello")) + (service oci-service-type + (oci-configuration + (runtime 'podman) + (verbose? #t))) + (simple-service 'oci-provisioning + oci-service-type + (oci-extension + (networks + (list %oci-network)) + (volumes + (list %oci-volume)) + (containers + (list + (oci-container-configuration + (provision "first") + (image + (oci-image + (repository "guile") + (value + (specifications->manifest '("guile"))) + (pack-options + '(#:symlinks (("/bin" -> "bin")))))) + (entrypoint "/bin/guile") + (network "my-network") + (command + '("-c" "(use-modules (web server)) +(define (handler request request-body) + (values '((content-type . (text/plain))) \"out of office\")) +(run-server handler 'http `(#:addr ,(inet-pton AF_INET \"0.0.0.0\")))")) + (host-environment + '(("VARIABLE" . "value"))) + (volumes + '(("my-volume" . "/my-volume"))) + (extra-arguments + '("--env" "VARIABLE"))) + (oci-container-configuration + (provision "second") + (image + (oci-image + (repository "guile") + (value + (specifications->manifest '("guile"))) + (pack-options + '(#:symlinks (("/bin" -> "bin")))))) + (entrypoint "/bin/guile") + (network "my-network") + (command + '("-c" "(let l ((c 300)) +(display c) +(newline) +(sleep 1) +(when (positive? c) + (l (- c 1))))")) + (volumes + '(("my-volume" . "/my-volume") + ("/shared.txt" . "/shared.txt:ro")))))))))) + +(define (run-rootless-podman-oci-service-test) + (define os + (marionette-operating-system + (operating-system-with-gc-roots + %oci-rootless-podman-os + (list)) + #:imported-modules '((gnu build oci-containers) + (gnu build dbus-service) + (gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (volatile? #f) + (memory-size 1024) + (disk-image-size (* 5000 (expt 2 20))) + (port-forwardings '()))) + + (define test + (with-imported-modules '((gnu build oci-containers) + (gnu build dbus-service) + (gnu build marionette)) + #~(begin + (use-modules (srfi srfi-1) (srfi srfi-11) (srfi srfi-64) + (gnu build dbus-service) + (gnu build marionette)) + + (define marionette + ;; Relax timeout to accommodate older systems and + ;; allow for pulling the image. + (make-marionette (list #$vm) #:timeout 60)) + + (test-runner-current (system-test-runner #$output)) + (test-begin "rootless-podman-oci-service") + + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (wait-for-service 'user-processes)) + marionette) + + (test-assert "podman-volumes running" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((oci-object-service-available? + "/run/current-system/profile/bin/podman" + "volume" + '("my-volume") + #:verbose? #t)))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 (equal? '("my-volume") (run-test))))) + + (test-assert "podman-networks running" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((oci-object-service-available? + "/run/current-system/profile/bin/podman" + "network" + '("my-network") + #:verbose? #t)))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 (equal? '("my-network" "podman") (run-test))))) + + (test-assert "image loaded" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((oci-object-service-available? + "/run/current-system/profile/bin/podman" + "image" + '("localhost/guile:latest") + #:format-string "{{.Repository}}:{{.Tag}}" + #:verbose? #t)))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 + (equal? + '("localhost/guile:latest") + (run-test))))) + + (test-assert "passing host environment variables" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((slurp + "/run/current-system/profile/bin/podman" + "exec" "first" + "/bin/guile" "-c" + "'(display (getenv \"VARIABLE\"))'")))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 (equal? '("value") (run-test))))) + + (test-equal "mounting host files" + '("hello") + (first + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((slurp + "/run/current-system/profile/bin/podman" + "exec" "second" + "/bin/guile" "-c" "'(begin +(use-modules (ice-9 popen) (ice-9 rdelim)) +(display (call-with-input-file \"/shared.txt\" read-line)))'")))) + marionette))) + + (test-equal "read and write to provisioned volumes" + '("world") + (second + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((slurp + "/run/current-system/profile/bin/podman" + "exec" "first" + "/bin/guile" "-c" "'(begin +(use-modules (ice-9 popen) (ice-9 rdelim)) +(call-with-output-file \"/my-volume/out.txt\" + (lambda (p) (display \"world\" p))))'") + (slurp + "/run/current-system/profile/bin/podman" + "exec" "second" + "/bin/guile" "-c" "'(begin +(use-modules (ice-9 popen) (ice-9 rdelim)) +(display + (call-with-input-file \"/my-volume/out.txt\" read-line)))'")))) + marionette))) + + (test-equal + "can read and write to ports over provisioned network" + '("out of office") + (first + (marionette-eval + `(begin + #$@(%oci-rootless-podman-run + #~((slurp + "/run/current-system/profile/bin/podman" + "exec" "second" + "/bin/guile" "-c" "'(begin +(use-modules (web client)) +(define-values (response out) (http-get \"http://first:8080\")) +(display out))'")))) + marionette))) + + (test-end)))) + + (gexp->derivation "rootless-podman-oci-service-test" test)) + +(define %test-oci-service-rootless-podman + (system-test + (name "oci-service-rootless-podman") + (description "Test Rootless-Podman backed OCI provisioning service.") + (value (run-rootless-podman-oci-service-test)))) + +(define (%oci-docker-run commands) + #~((use-modules (srfi srfi-1) + (ice-9 format) + (ice-9 popen) + (ice-9 match) + (ice-9 rdelim) + (gnu build oci-containers)) + + #$%oci-read-lines + #$%oci-slurp + + (let ((outputs (list #$@commands))) + (map + (lambda (output) + (sort output string<=?)) + outputs)))) + +(define %oci-docker-os + (simple-operating-system + (service dhcpcd-service-type) + (service dbus-root-service-type) + (service polkit-service-type) + (service elogind-service-type) + (service containerd-service-type) + (service docker-service-type) + (extra-special-file "/shared.txt" + (plain-file "shared.txt" "hello")) + (service oci-service-type + (oci-configuration + (verbose? #t))) + (simple-service 'oci-provisioning + oci-service-type + (oci-extension + (networks + (list %oci-network)) + (volumes + (list %oci-volume)) + (containers + (list + (oci-container-configuration + (provision "first") + (image + (oci-image + (repository "guile") + (value + (specifications->manifest '("guile"))) + (pack-options + '(#:symlinks (("/bin" -> "bin")))))) + (entrypoint "/bin/guile") + (network "my-network") + (command + '("-c" "(use-modules (web server)) +(define (handler request request-body) + (values '((content-type . (text/plain))) \"out of office\")) +(run-server handler 'http `(#:addr ,(inet-pton AF_INET \"0.0.0.0\")))")) + (host-environment + '(("VARIABLE" . "value"))) + (volumes + '(("my-volume" . "/my-volume"))) + (extra-arguments + '("--env" "VARIABLE"))) + (oci-container-configuration + (provision "second") + (image + (oci-image + (repository "guile") + (value + (specifications->manifest '("guile"))) + (pack-options + '(#:symlinks (("/bin" -> "bin")))))) + (entrypoint "/bin/guile") + (network "my-network") + (command + '("-c" "(let l ((c 300)) +(display c) +(newline) +(sleep 1) +(when (positive? c) + (l (- c 1))))")) + (volumes + '(("my-volume" . "/my-volume") + ("/shared.txt" . "/shared.txt:ro")))))))))) + +(define (run-docker-oci-service-test) + (define os + (marionette-operating-system + (operating-system-with-gc-roots + %oci-docker-os + (list)) + #:imported-modules '((gnu build oci-containers) + (gnu build dbus-service) + (gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (volatile? #f) + (memory-size 1024) + (disk-image-size (* 5000 (expt 2 20))) + (port-forwardings '()))) + + (define test + (with-imported-modules '((gnu build oci-containers) + (gnu build dbus-service) + (gnu build marionette)) + #~(begin + (use-modules (srfi srfi-1) (srfi srfi-11) (srfi srfi-64) + (gnu build dbus-service) + (gnu build marionette)) + + (define marionette + ;; Relax timeout to accommodate older systems and + ;; allow for pulling the image. + (make-marionette (list #$vm) #:timeout 60)) + + (test-runner-current (system-test-runner #$output)) + (test-begin "docker-oci-service") + + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (wait-for-service 'dockerd)) + marionette) + + (test-assert "docker-volumes running" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-docker-run + #~((oci-object-service-available? + "/run/current-system/profile/bin/docker" + "volume" + '("my-volume") + #:verbose? #t)))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 (equal? '("my-volume") (run-test))))) + + (test-assert "docker-networks running" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-docker-run + #~((oci-object-service-available? + "/run/current-system/profile/bin/docker" + "network" + '("my-network") + #:verbose? #t)))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 (equal? + '("my-network" "none") + (run-test))))) + + (test-assert "passing host environment variables" + (begin + (define (run-test) + (first + (marionette-eval + `(begin + #$@(%oci-docker-run + #~((slurp + "/run/current-system/profile/bin/docker" + "exec" "first" + "/bin/guile" "-c" + "'(display (getenv \"VARIABLE\"))'")))) + marionette))) + ;; Allow services to come up on slower machines. + (with-retries 80 1 (equal? '("value") (run-test))))) + + (test-equal "read and write to provisioned volumes" + '("world") + (second + (marionette-eval + `(begin + #$@(%oci-docker-run + #~((slurp + "/run/current-system/profile/bin/docker" + "exec" "first" + "/bin/guile" "-c" "'(begin +(use-modules (ice-9 popen) (ice-9 rdelim)) +(call-with-output-file \"/my-volume/out.txt\" + (lambda (p) (display \"world\" p))))'") + (slurp + "/run/current-system/profile/bin/docker" + "exec" "second" + "/bin/guile" "-c" "'(begin +(use-modules (ice-9 popen) (ice-9 rdelim)) +(display + (call-with-input-file \"/my-volume/out.txt\" read-line)))'")))) + marionette))) + + (test-equal + "can read and write to ports over provisioned network" + '("out of office") + (first + (marionette-eval + `(begin + #$@(%oci-docker-run + #~((slurp + "/run/current-system/profile/bin/docker" + "exec" "second" + "/bin/guile" "-c" "'(begin (use-modules (web client)) + (define-values (response out) + (http-get \"http://first:8080\")) + (display out))'")))) + marionette))) + + (test-end)))) + + (gexp->derivation "docker-oci-service-test" test)) + +(define %test-oci-service-docker + (system-test + (name "oci-service-docker") + (description "Test Docker backed OCI provisioning service.") + (value (run-docker-oci-service-test)))) diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index 8952daab2f..9fee3905f0 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org> ;;; Copyright © 2019-2023 Ludovic Courtès <ludo@gnu.org> -;;; Copyright © 2024 Giacomo Leidi <goodoldpaul@autistici.org> +;;; Copyright © 2024, 2025 Giacomo Leidi <goodoldpaul@autistici.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -414,71 +414,54 @@ docker-image} inside Docker.") (test-runner-current (system-test-runner #$output)) (test-begin "oci-container") - (test-assert "containerd service running" - (marionette-eval - '(begin - (use-modules (gnu services herd)) - (match (start-service 'containerd) - (#f #f) - (('service response-parts ...) - (match (assq-ref response-parts 'running) - ((pid) pid))))) - marionette)) - - (test-assert "containerd PID file present" - (wait-for-file "/run/containerd/containerd.pid" marionette)) - - (test-assert "dockerd running" - (marionette-eval - '(begin - (use-modules (gnu services herd)) - (match (start-service 'dockerd) - (#f #f) - (('service response-parts ...) - (match (assq-ref response-parts 'running) - ((pid) pid))))) - marionette)) - - (sleep 10) ; let service start + (wait-for-file "/run/containerd/containerd.pid" marionette) (test-assert "docker-guile running" (marionette-eval '(begin (use-modules (gnu services herd)) - (match (start-service 'docker-guile) - (#f #f) - (('service response-parts ...) - (match (assq-ref response-parts 'running) - ((pid) pid))))) + (wait-for-service 'docker-guile #:timeout 120) + #t) marionette)) - (test-equal "passing host environment variables and volumes" - '("value" "hello") - (marionette-eval - `(begin - (use-modules (ice-9 popen) - (ice-9 rdelim)) + (test-assert "passing host environment variables and volumes" + (begin + (define (run-test) + (marionette-eval + `(begin + (use-modules (ice-9 popen) + (ice-9 rdelim)) - (define slurp - (lambda args - (let* ((port (apply open-pipe* OPEN_READ args)) - (output (let ((line (read-line port))) - (if (eof-object? line) - "" - line))) - (status (close-pipe port))) - output))) - (let* ((response1 (slurp - ,(string-append #$docker-cli "/bin/docker") - "exec" "docker-guile" - "/bin/guile" "-c" "(display (getenv \"VARIABLE\"))")) - (response2 (slurp - ,(string-append #$docker-cli "/bin/docker") - "exec" "docker-guile" - "/bin/guile" "-c" "(begin (use-modules (ice-9 popen) (ice-9 rdelim)) + (define slurp + (lambda args + (let* ((port (apply open-pipe* OPEN_READ args)) + (output (let ((line (read-line port))) + (if (eof-object? line) + "" + line))) + (status (close-pipe port))) + output))) + (let* ((response1 (slurp + ,(string-append #$docker-cli "/bin/docker") + "exec" "docker-guile" + "/bin/guile" "-c" "(display (getenv \"VARIABLE\"))")) + (response2 (slurp + ,(string-append #$docker-cli "/bin/docker") + "exec" "docker-guile" + "/bin/guile" "-c" "(begin (use-modules (ice-9 popen) (ice-9 rdelim)) (display (call-with-input-file \"/shared.txt\" read-line)))"))) - (list response1 response2))) - marionette)) + (list response1 response2))) + marionette)) + ;; Allow services to come up on slower machines + (let loop ((attempts 0)) + (if (= attempts 60) + (error "Service didn't come up after more than 60 seconds") + (if (equal? '("value" "hello") + (run-test)) + #t + (begin + (sleep 1) + (loop (+ 1 attempts)))))))) (test-end)))) diff --git a/po/packages/POTFILES.in b/po/packages/POTFILES.in index bb92184d32..4f22eb0f6b 100644 --- a/po/packages/POTFILES.in +++ b/po/packages/POTFILES.in @@ -110,7 +110,6 @@ gnu/packages/decker.scm gnu/packages/dejagnu.scm gnu/packages/dezyne.scm gnu/packages/dhall.scm -gnu/packages/dico.scm gnu/packages/dictd.scm gnu/packages/dictionaries.scm gnu/packages/diffoscope.scm |