unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 73682@debbugs.gnu.org
Cc: Nicolas Graves <ngraves@ngraves.fr>
Subject: [bug#73682] [PATCH v2 3/3] gnu: varnish: Improve style.
Date: Tue, 15 Oct 2024 21:56:27 +0200	[thread overview]
Message-ID: <20241015195634.6829-3-ngraves@ngraves.fr> (raw)
In-Reply-To: <20241015195634.6829-1-ngraves@ngraves.fr>

* gnu/packages/web.scm (varnish): Improve style.
  [arguments]: Rewrite using gexps.
  [inputs]: Replace coreutils by coreutils-minimal, python by
  python-minimal. Add glibc.
---
 gnu/packages/web.scm | 106 ++++++++++++++++++++++---------------------
 1 file changed, 55 insertions(+), 51 deletions(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index fe6b40067b..87eab9b4af 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -6617,66 +6617,70 @@ (define-public varnish
                 "0p2xf4a8bk2w8j9q20fazrc93fwcfhw8zcvdd8ssbahvlg2q78mb"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
-                               (string-append "CC=" ,(cc-for-target))
-                               ;; Use absolute path of GCC so it's found at runtime.
-                               (string-append "PTHREAD_CC="
-                                              (search-input-file %build-inputs
-                                                                 "/bin/gcc"))
-                               "--localstatedir=/var")
-       ,@(if (target-x86-32?)
-             '(#:make-flags
-               (list "CFLAGS+=-fexcess-precision=standard"))
-             '())
+     (append
+      (if (target-x86-32?)
+          '(#:make-flags
+            (list "CFLAGS+=-fexcess-precision=standard"))
+          '())
+      (list
+       #:configure-flags
+       #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
+               (string-append "CC=" #$(cc-for-target))
+               ;; Use absolute path of GCC so it's found at runtime.
+               (string-append "PTHREAD_CC="
+                              (search-input-file %build-inputs
+                                                 "/bin/gcc"))
+               "--localstatedir=/var")
        #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'use-absolute-file-names
-           (lambda _
-             (substitute* '("bin/varnishtest/vtc_varnish.c"
-                            "bin/varnishtest/vtc_process.c"
-                            "bin/varnishtest/vtc_haproxy.c"
-                            "bin/varnishtest/tests/u00014.vtc"
-                            "bin/varnishd/mgt/mgt_vcc.c")
-               (("/bin/sh") (which "bash")))
-             (let* ((rm (which "rm")))
-               (substitute* "bin/varnishd/mgt/mgt_shmem.c"
-                 (("rm -rf") (string-append rm " -rf")))
-               (substitute* "bin/varnishtest/vtc_main.c"
-                 (("/bin/rm") rm)))
-             (substitute* "bin/varnishtest/tests/u00000.vtc"
-               (("/bin/echo") (which "echo")))))
-         (add-after 'unpack 'remove-failing-tests
-           (lambda  _
-             ;; This test seems to fail because of
-             ;; Failed: Servname not supported for ai_socktype
-             (delete-file "bin/varnishtest/tests/b00085.vtc")))
-         (add-before 'install 'patch-Makefile
-           (lambda _
-             (substitute* "Makefile"
-               ;; Do not create /var/varnish during install.
-               (("^install-data-am: install-data-local") "install-data-am: "))))
-         (add-after 'install 'wrap-varnishd
-           ;; Varnish uses GCC to compile VCL, so wrap it with required GCC
-           ;; environment variables to avoid propagating them to profiles.
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (varnishd (string-append out "/sbin/varnishd"))
-                    (PATH (string-append (assoc-ref inputs "binutils") "/bin"))
-                    (LIBRARY_PATH (string-append (assoc-ref inputs "libc") "/lib")))
-               (wrap-program varnishd
+       #~(modify-phases %standard-phases
+           (add-after 'unpack 'use-absolute-file-names
+             (lambda _
+               (substitute* '("bin/varnishtest/vtc_varnish.c"
+                              "bin/varnishtest/vtc_process.c"
+                              "bin/varnishtest/vtc_haproxy.c"
+                              "bin/varnishtest/tests/u00014.vtc"
+                              "bin/varnishd/mgt/mgt_vcc.c")
+                 (("/bin/sh") (which "bash")))
+               (let* ((rm (which "rm")))
+                 (substitute* "bin/varnishd/mgt/mgt_shmem.c"
+                   (("rm -rf") (string-append rm " -rf")))
+                 (substitute* "bin/varnishtest/vtc_main.c"
+                   (("/bin/rm") rm)))
+               (substitute* "bin/varnishtest/tests/u00000.vtc"
+                 (("/bin/echo") (which "echo")))))
+           (add-after 'unpack 'remove-failing-tests
+             (lambda  _
+               ;; This test seems to fail because of
+               ;; Failed: Servname not supported for ai_socktype
+               (delete-file "bin/varnishtest/tests/b00085.vtc")))
+           (add-before 'install 'patch-Makefile
+             (lambda _
+               (substitute* "Makefile"
+                 ;; Do not create /var/varnish during install.
+                 (("^install-data-am: install-data-local")
+                  "install-data-am: "))))
+           (add-after 'install 'wrap-varnishd
+             ;; Varnish uses GCC to compile VCL, so wrap it with required GCC
+             ;; environment variables to avoid propagating them to profiles.
+             (lambda _
+               (wrap-program (string-append #$output "/sbin/varnishd")
                  ;; Add binutils to PATH so gcc finds the 'as' executable.
-                 `("PATH" ":" prefix (,PATH))
+                 `("PATH" ":" prefix (,(dirname (which "as"))))
                  ;; Make sure 'crti.o' et.al is found.
-                 `("LIBRARY_PATH" ":" prefix (,LIBRARY_PATH)))))))))
+                 `("LIBRARY_PATH" ":" prefix
+                   (,(dirname
+                      (search-input-file inputs "lib/libc.so")))))))))))
     (native-inputs
-     (list pkg-config python-sphinx python-docutils))
+     (list pkg-config
+           python-sphinx
+           python-docutils))
     (inputs
      (list bash-minimal
-           coreutils
+           coreutils-minimal
            jemalloc
            ncurses
            pcre2
-           python
+           python-minimal
            readline))
     (synopsis "Web application accelerator")
     (description
-- 
2.46.0





      parent reply	other threads:[~2024-10-15 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 21:54 [bug#73682] [PATCH 0/3] gnu: varnish: Update to 7.6.0. [security fixes] Nicolas Graves via Guix-patches via
2024-10-07 22:07 ` [bug#73682] [PATCH 1/3] " Nicolas Graves via Guix-patches via
2024-10-08  6:21 ` [bug#73682] [PATCH 2/3] gnu: varnish-modules: Update to 0.25.0 Nicolas Graves via Guix-patches via
2024-10-08  6:21   ` [bug#73682] [PATCH 3/3] gnu: varnish: Improve style Nicolas Graves via Guix-patches via
2024-10-15 16:25     ` Ludovic Courtès
2024-10-15 19:56 ` [bug#73682] [PATCH v2 1/3] gnu: varnish: Update to 7.6.0. [security fixes] Nicolas Graves via Guix-patches via
2024-10-15 19:56   ` [bug#73682] [PATCH v2 2/3] gnu: varnish-modules: Update to 0.25.0 Nicolas Graves via Guix-patches via
2024-10-15 19:56   ` Nicolas Graves via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241015195634.6829-3-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=73682@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).