diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2024-10-17 06:30:00 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-10-24 14:50:09 +0200 |
| commit | 952682fca61d73ee52a086e552e3985c7f539fde (patch) | |
| tree | b6a110db6fb867f41369142725c40fc0648c246c | |
| parent | 50f9651a68c386d88199794c63239e659ba2d737 (diff) | |
gnu: varnish: Improve style.
* gnu/packages/web.scm (varnish): Improve style.
[arguments]: Rewrite using gexps.
[inputs]: Replace coreutils by coreutils-minimal, python by
python-minimal.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | gnu/packages/web.scm | 106 |
1 files changed, 55 insertions, 51 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 068588e811d..34739bf088e 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm | |||
| @@ -6641,66 +6641,70 @@ deployments.") | |||
| 6641 | "0p2xf4a8bk2w8j9q20fazrc93fwcfhw8zcvdd8ssbahvlg2q78mb")))) | 6641 | "0p2xf4a8bk2w8j9q20fazrc93fwcfhw8zcvdd8ssbahvlg2q78mb")))) |
| 6642 | (build-system gnu-build-system) | 6642 | (build-system gnu-build-system) |
| 6643 | (arguments | 6643 | (arguments |
| 6644 | `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib") | 6644 | (append |
| 6645 | (string-append "CC=" ,(cc-for-target)) | 6645 | (if (target-x86-32?) |
| 6646 | ;; Use absolute path of GCC so it's found at runtime. | 6646 | '(#:make-flags |
| 6647 | (string-append "PTHREAD_CC=" | 6647 | (list "CFLAGS+=-fexcess-precision=standard")) |
| 6648 | (search-input-file %build-inputs | 6648 | '()) |
| 6649 | "/bin/gcc")) | 6649 | (list |
| 6650 | "--localstatedir=/var") | 6650 | #:configure-flags |
| 6651 | ,@(if (target-x86-32?) | 6651 | #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") |
| 6652 | '(#:make-flags | 6652 | (string-append "CC=" #$(cc-for-target)) |
| 6653 | (list "CFLAGS+=-fexcess-precision=standard")) | 6653 | ;; Use absolute path of GCC so it's found at runtime. |
| 6654 | '()) | 6654 | (string-append "PTHREAD_CC=" |
| 6655 | (search-input-file %build-inputs | ||
| 6656 | "/bin/gcc")) | ||
| 6657 | "--localstatedir=/var") | ||
| 6655 | #:phases | 6658 | #:phases |
| 6656 | (modify-phases %standard-phases | 6659 | #~(modify-phases %standard-phases |
| 6657 | (add-after 'unpack 'use-absolute-file-names | 6660 | (add-after 'unpack 'use-absolute-file-names |
| 6658 | (lambda _ | 6661 | (lambda _ |
| 6659 | (substitute* '("bin/varnishtest/vtc_varnish.c" | 6662 | (substitute* '("bin/varnishtest/vtc_varnish.c" |
| 6660 | "bin/varnishtest/vtc_process.c" | 6663 | "bin/varnishtest/vtc_process.c" |
| 6661 | "bin/varnishtest/vtc_haproxy.c" | 6664 | "bin/varnishtest/vtc_haproxy.c" |
| 6662 | "bin/varnishtest/tests/u00014.vtc" | 6665 | "bin/varnishtest/tests/u00014.vtc" |
| 6663 | "bin/varnishd/mgt/mgt_vcc.c") | 6666 | "bin/varnishd/mgt/mgt_vcc.c") |
| 6664 | (("/bin/sh") (which "bash"))) | 6667 | (("/bin/sh") (which "bash"))) |
| 6665 | (let* ((rm (which "rm"))) | 6668 | (let* ((rm (which "rm"))) |
| 6666 | (substitute* "bin/varnishd/mgt/mgt_shmem.c" | 6669 | (substitute* "bin/varnishd/mgt/mgt_shmem.c" |
| 6667 | (("rm -rf") (string-append rm " -rf"))) | 6670 | (("rm -rf") (string-append rm " -rf"))) |
| 6668 | (substitute* "bin/varnishtest/vtc_main.c" | 6671 | (substitute* "bin/varnishtest/vtc_main.c" |
| 6669 | (("/bin/rm") rm))) | 6672 | (("/bin/rm") rm))) |
| 6670 | (substitute* "bin/varnishtest/tests/u00000.vtc" | 6673 | (substitute* "bin/varnishtest/tests/u00000.vtc" |
| 6671 | (("/bin/echo") (which "echo"))))) | 6674 | (("/bin/echo") (which "echo"))))) |
| 6672 | (add-after 'unpack 'remove-failing-tests | 6675 | (add-after 'unpack 'remove-failing-tests |
| 6673 | (lambda _ | 6676 | (lambda _ |
| 6674 | ;; This test seems to fail because of | 6677 | ;; This test seems to fail because of |
| 6675 | ;; Failed: Servname not supported for ai_socktype | 6678 | ;; Failed: Servname not supported for ai_socktype |
| 6676 | (delete-file "bin/varnishtest/tests/b00085.vtc"))) | 6679 | (delete-file "bin/varnishtest/tests/b00085.vtc"))) |
| 6677 | (add-before 'install 'patch-Makefile | 6680 | (add-before 'install 'patch-Makefile |
| 6678 | (lambda _ | 6681 | (lambda _ |
| 6679 | (substitute* "Makefile" | 6682 | (substitute* "Makefile" |
| 6680 | ;; Do not create /var/varnish during install. | 6683 | ;; Do not create /var/varnish during install. |
| 6681 | (("^install-data-am: install-data-local") "install-data-am: ")))) | 6684 | (("^install-data-am: install-data-local") |
| 6682 | (add-after 'install 'wrap-varnishd | 6685 | "install-data-am: ")))) |
| 6683 | ;; Varnish uses GCC to compile VCL, so wrap it with required GCC | 6686 | (add-after 'install 'wrap-varnishd |
| 6684 | ;; environment variables to avoid propagating them to profiles. | 6687 | ;; Varnish uses GCC to compile VCL, so wrap it with required GCC |
| 6685 | (lambda* (#:key inputs outputs #:allow-other-keys) | 6688 | ;; environment variables to avoid propagating them to profiles. |
| 6686 | (let* ((out (assoc-ref outputs "out")) | 6689 | (lambda* (#:key inputs #:allow-other-keys) |
| 6687 | (varnishd (string-append out "/sbin/varnishd")) | 6690 | (wrap-program (string-append #$output "/sbin/varnishd") |
| 6688 | (PATH (string-append (assoc-ref inputs "binutils") "/bin")) | ||
| 6689 | (LIBRARY_PATH (string-append (assoc-ref inputs "libc") "/lib"))) | ||
| 6690 | (wrap-program varnishd | ||
| 6691 | ;; Add binutils to PATH so gcc finds the 'as' executable. | 6691 | ;; Add binutils to PATH so gcc finds the 'as' executable. |
| 6692 | `("PATH" ":" prefix (,PATH)) | 6692 | `("PATH" ":" prefix (,(dirname (which "as")))) |
| 6693 | ;; Make sure 'crti.o' et.al is found. | 6693 | ;; Make sure 'crti.o' et.al is found. |
| 6694 | `("LIBRARY_PATH" ":" prefix (,LIBRARY_PATH))))))))) | 6694 | `("LIBRARY_PATH" ":" prefix |
| 6695 | (,(dirname | ||
| 6696 | (search-input-file inputs "lib/libc.so"))))))))))) | ||
| 6695 | (native-inputs | 6697 | (native-inputs |
| 6696 | (list pkg-config python-sphinx python-docutils)) | 6698 | (list pkg-config |
| 6699 | python-sphinx | ||
| 6700 | python-docutils)) | ||
| 6697 | (inputs | 6701 | (inputs |
| 6698 | (list bash-minimal | 6702 | (list bash-minimal |
| 6699 | coreutils | 6703 | coreutils-minimal |
| 6700 | jemalloc | 6704 | jemalloc |
| 6701 | ncurses | 6705 | ncurses |
| 6702 | pcre2 | 6706 | pcre2 |
| 6703 | python | 6707 | python-minimal |
| 6704 | readline)) | 6708 | readline)) |
| 6705 | (synopsis "Web application accelerator") | 6709 | (synopsis "Web application accelerator") |
| 6706 | (description | 6710 | (description |
