From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: bug#26302: [website] translations Date: Tue, 5 Nov 2019 08:31:30 +0100 Message-ID: <20191105073130.j5eft6jgqhkcnqf3@pelzflorian.localdomain> References: <20170329154040.ddscahwp2agknihb@abyayala> <16d07cb5a1d.ca69255821627.8144164908931126811@zoho.com> <20190908171638.cna67eearj4rbn2k@pelzflorian.localdomain> <16d18a5a9e8.12ab66c8254154.2756956535677606704@zoho.com> <20190915201819.3yxm25fayvbxwdpl@pelzflorian.localdomain> <20191007081502.wog4q4wjptvhmejf@pelzflorian.localdomain> <874kznbqa5.fsf@gnu.org> <20191102131515.sq6mlvwsfybagsd2@pelzflorian.localdomain> <87ftj38spn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fmrl3amnpkvjg4md" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55703) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRtJs-0006P8-EL for bug-guix@gnu.org; Tue, 05 Nov 2019 02:32:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRtJq-00053r-SA for bug-guix@gnu.org; Tue, 05 Nov 2019 02:32:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57243) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iRtJq-00053h-O2 for bug-guix@gnu.org; Tue, 05 Nov 2019 02:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iRtJq-0007Cf-Ia for bug-guix@gnu.org; Tue, 05 Nov 2019 02:32:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87ftj38spn.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: sirgazil , 26302 <26302@debbugs.gnu.org> --fmrl3amnpkvjg4md Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Nov 04, 2019 at 06:19:32PM +0100, Ludovic Courtès wrote: > "pelzflorian (Florian Pelz)" skribis: > > On Fri, Nov 01, 2019 at 03:54:42PM +0100, Ludovic Courtès wrote: > >> […] > >> Perhaps “nginx-accept-language-module”, to match the name of the > >> upstream repo? > >> > > > > I agree. Arch (who have no package for nginx-accept-language-module) > > change their various nginx module package names to be more consistent, > > I think, but this is not necessary in Guix, I think. > > For Guix the general rule is to follow upstream (info "(guix) Package > Naming"). > Makes sense. I agree the general rule is appropriate here. > > From: Florian Pelz > > Date: Sat, 2 Nov 2019 13:13:01 +0100 > > Subject: [PATCH 1/3] doc: Add warning on the '--source' build option when > > linking statically. > > > > * doc/guix.texi (Additional Build Options): Add warning. > > […] > > +Note that for statically linked packages, @command{guix build -S} will > > +@emph{not} return the complete and corresponding sources since these > > +would include the sources of statically linked dependencies. In this > > +case, when distributing sources for license compliance, you may want to > > +play it safe and use the following @code{--sources} option instead. > > I don’t think this bit is necessary: ‘-S’ is documented to return “the > source of the package” and that’s exactly what it does; static > vs. dynamic linking is not a concern at this level, as I see it. > > WDYT? > I guess the meaning of `guix build -S` is not clear enough. Let me make an alternative proposal (attached). > > From: Florian Pelz > > Date: Sat, 2 Nov 2019 14:05:30 +0100 > > Subject: [PATCH 3/3] services: Make it possible to include dynamic modules in > > nginx. > > > > * gnu/services/web.scm (): Add modules field. > > (nginx-configuration-modules): New field accessor. > > (emit-load-module): New procedure. > > (default-nginx-config): Add support for the modules field. > > * doc/guix.texi (NGINX): Document it. > > […] > > +@item @code{modules} (default: @code{'()}) > > +List of nginx dynamic modules to load. Should be a list of strings or > > +string valued G-expressions. > > Then… how does nginx find the module in question, specifically the > ‘nginx-accept-language-module’ package? One has to specify > ‘nginx-accept-language-module’ as the nginx package to use, is that > right? (I had overlooked that before.) > > What about adding an example with the ‘accept-language’ module? > Of course you are right. I attach a patch with only a changed doc/guix.texi. I do not attach again the nginx-accept-language-module. Are these proposals OK? Shall I push the three patches? Regards, Florian --fmrl3amnpkvjg4md Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-doc-Explain-more-licensing-aspects-of-the-source-bui.patch" >From 3bbdd2dc4c983ca8bbf31cd348b64f1d60a51ee5 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Tue, 5 Nov 2019 08:22:04 +0100 Subject: [PATCH 01/13] doc: Explain more licensing aspects of the '--source' build option. * doc/guix.texi (Additional Build Options): Explain more. --- doc/guix.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index da2423b422..b4ad9d846a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8328,6 +8328,13 @@ The returned source tarball is the result of applying any patches and code snippets specified in the package @code{origin} (@pxref{Defining Packages}). +Note that @command{guix build -S} compiles the sources only of the +specified package. They do not include the sources of statically linked +dependencies, dynamically linked dependencies, or any other +dependencies. When distributing complete corresponding sources for +license compliance, you may want to play it safe and use the following +@code{--sources} option instead. + @item --sources Fetch and return the source of @var{package-or-derivation} and all their dependencies, recursively. This is a handy way to obtain a local copy -- 2.23.0 --fmrl3amnpkvjg4md Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0003-services-Make-it-possible-to-include-dynamic-modules.patch" Content-Transfer-Encoding: 8bit >From 04df1e5ee3fd542776b13eb3a59872e1647eb5f8 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Tue, 5 Nov 2019 08:08:20 +0100 Subject: [PATCH 03/13] services: Make it possible to include dynamic modules in nginx. * gnu/services/web.scm (): Add modules field. (nginx-configuration-modules): New field accessor. (emit-load-module): New procedure. (default-nginx-config): Add support for the modules field. * doc/guix.texi (NGINX): Document it. --- doc/guix.texi | 11 +++++++++++ gnu/services/web.scm | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index b4ad9d846a..11cdc1ae83 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19771,6 +19771,17 @@ use the size of the processors cache line. @item @code{server-names-hash-bucket-max-size} (default: @code{#f}) Maximum bucket size for the server names hash tables. +@item @code{modules} (default: @code{'()}) +List of nginx dynamic modules to load. Should be a list of strings or +string valued G-expressions. For example: + +@lisp +(modules + (list + (file-append nginx-accept-language-module "\ +/etc/nginx/modules/ngx_http_accept_language_module.so"))) +@end lisp + @item @code{extra-content} (default: @code{""}) Extra content for the @code{http} block. Should be string or a string valued G-expression. diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 899be1c168..896d06eb18 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -9,6 +9,7 @@ ;;; Copyright 2018 Pierre-Antoine Rouby ;;; Copyright 2017, 2018, 2019 Christopher Baines ;;; Copyright 2018 Marius Bakke +;;; Copyright 2019 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -95,6 +96,7 @@ nginx-configuration-upstream-blocks nginx-configuration-server-names-hash-bucket-size nginx-configuration-server-names-hash-bucket-max-size + nginx-configuration-modules nginx-configuration-extra-content nginx-configuration-file @@ -522,6 +524,7 @@ (default #f)) (server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size (default #f)) + (modules nginx-configuration-modules (default '())) (extra-content nginx-configuration-extra-content (default "")) (file nginx-configuration-file ;#f | string | file-like @@ -542,6 +545,9 @@ of index files." ((? string? str) (list str " "))) names)) +(define (emit-load-module module) + (list "load_module " module ";\n")) + (define emit-nginx-location-config (match-lambda (($ uri body) @@ -615,12 +621,14 @@ of index files." server-blocks upstream-blocks server-names-hash-bucket-size server-names-hash-bucket-max-size + modules extra-content) (apply mixed-text-file "nginx.conf" (flatten "user nginx nginx;\n" "pid " run-directory "/pid;\n" "error_log " log-directory "/error.log info;\n" + (map emit-load-module modules) "http {\n" " client_body_temp_path " run-directory "/client_body_temp;\n" " proxy_temp_path " run-directory "/proxy_temp;\n" -- 2.23.0 --fmrl3amnpkvjg4md--