guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: gnu: Add varnish.


From: Marius Bakke
Subject: 01/05: gnu: Add varnish.
Date: Sat, 18 Aug 2018 10:06:14 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit da682825df0d07e05d4d4bc370ff7a486be3d8a5
Author: Marius Bakke <address@hidden>
Date:   Mon Nov 7 21:25:31 2016 +0000

    gnu: Add varnish.
    
    * gnu/packages/web.scm (varnish): New variable.
---
 gnu/packages/web.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 70 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 2302387..f558396 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -19,7 +19,7 @@
 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2016 Bake Timmons <address@hidden>
 ;;; Copyright © 2017 Thomas Danckaert <address@hidden>
-;;; Copyright © 2017 Marius Bakke <address@hidden>
+;;; Copyright © 2017, 2018 Marius Bakke <address@hidden>
 ;;; Copyright © 2017 Kei Kebreau <address@hidden>
 ;;; Copyright © 2017 Petter <address@hidden>
 ;;; Copyright © 2017 Pierre Langlois <address@hidden>
@@ -110,6 +110,7 @@
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
   #:use-module (gnu packages valgrind)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages curl)
@@ -4996,6 +4997,74 @@ scalability (including load-balancing), making it 
suitable for large
 deployments.")
   (license l:gpl2+)))
 
+(define-public varnish
+  (package
+    (name "varnish")
+    (home-page "https://varnish-cache.org/";)
+    (version "6.0.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append home-page "_downloads/varnish-" version 
".tgz"))
+              (sha256
+               (base32
+                "1vhbdch33m6ig4ijy57zvrramhs9n7cba85wd8rizgxjjnf87cn7"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" %output 
"/lib")
+                               ;; Use absolute path of GCC so it's found at 
runtime.
+                               (string-append "PTHREAD_CC="
+                                              (assoc-ref %build-inputs "gcc")
+                                              "/bin/gcc")
+                               "--localstatedir=/var")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-/bin/sh
+           (lambda _
+             (substitute* '("bin/varnishtest/vtc_varnish.c"
+                            "bin/varnishtest/vtc_process.c"
+                            "bin/varnishd/mgt/mgt_vcc.c")
+               (("/bin/sh") (which "sh")))
+             #t))
+         (add-before 'install 'patch-Makefile
+           (lambda _
+             (substitute* "Makefile"
+               ;; Do not create /var/varnish during install.
+               (("^install-data-am: install-data-local") "install-data-am: "))
+             #t))
+         (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
+                 ;; Add binutils to PATH so gcc finds the 'as' executable.
+                 `("PATH" ":" prefix (,PATH))
+                 ;; Make sure 'crti.o' et.al is found.
+                 `("LIBRARY_PATH" ":" prefix (,LIBRARY_PATH)))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("rst2man" ,python-docutils)))
+    (inputs
+     `(("jemalloc" ,jemalloc)
+       ("ncurses" ,ncurses)
+       ("pcre" ,pcre)
+       ("python" ,python-wrapper)
+       ("readline" ,readline)))
+    (synopsis "Web application accelerator")
+    (description
+     "Varnish is a high-performance HTTP accelerator.  It acts as a caching
+reverse proxy and load balancer.  You install it in front of any server that
+speaks HTTP and configure it to cache the contents through an extensive
+configuration language.")
+    (license (list l:bsd-2           ;main distribution
+                   l:zlib            ;lib/libvgz/*
+                   l:public-domain   ;bin/varnishncsa/as64.c, include/miniobj.h
+                   l:bsd-3))))       ;include/vqueue.h, 
lib/libvarnishcompat/daemon.c
+
 (define-public xinetd
   (package
     (name "xinetd")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]