* gnu/packages/web.scm (varnish): New variable. --- gnu/packages/web.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 753a816..b1313ee 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -49,6 +49,7 @@ #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages apr) + #:use-module (gnu packages base) #:use-module (gnu packages documentation) #:use-module (gnu packages docbook) #:use-module (gnu packages autotools) @@ -58,14 +59,17 @@ #:use-module (gnu packages bison) #:use-module (gnu packages flex) #:use-module (gnu packages mit-krb5) + #:use-module (gnu packages gcc) #:use-module (gnu packages gd) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gperf) + #:use-module (gnu packages graphviz) #:use-module (gnu packages gtk) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) + #:use-module (gnu packages jemalloc) #:use-module (gnu packages lua) #:use-module (gnu packages ncurses) #:use-module (gnu packages base) @@ -77,6 +81,7 @@ #:use-module (gnu packages xml) #:use-module (gnu packages curl) #:use-module (gnu packages perl) + #:use-module (gnu packages readline) #:use-module (gnu packages texinfo) #:use-module (gnu packages textutils) #:use-module (gnu packages tls) @@ -3867,3 +3872,77 @@ useful for users behind restrictive firewalls. As long as Web traffic is allowed, even through a HTTP-only proxy, httptunnel can be combined with other tools like SSH (Secure Shell) to reach the outside world.") (license l:gpl2+))) + +(define-public varnish + (package + (name "varnish") + (version "5.0.0") + (source (origin + (method url-fetch) + (uri (string-append "https://repo.varnish-cache.org/source/varnish-" + version ".tar.gz")) + (sha256 + (base32 + "0jizha1mwqk42zmkrh80y07vfl78mg1d9pp5w83qla4xn9ras0ai")))) + (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-after 'configure '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-binary + (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 "glibc") "/lib"))) + ;; Add binutils to PATH so gcc finds the 'as' executable. + (wrap-program varnishd + `("PATH" ":" prefix (,PATH))) + ;; Without this, we get an error such as "ld: cannot find crti.o" + ;; when compiling VCL. + (wrap-program varnishd + `("LIBRARY_PATH" ":" prefix (,LIBRARY_PATH))) + #t)))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("rst2man" ,python-docutils))) + (inputs + `(("binutils" ,binutils) + ("gcc" ,gcc) + ("glibc" ,glibc/linux) + ("jemalloc" ,jemalloc) + ("ncurses" ,ncurses) + ("pcre" ,pcre) + ("python" ,python-wrapper) + ("readline" ,readline))) + (home-page "https://www.varnish-cache.org/") + (synopsis "High-performance caching HTTP reverse proxy") + (description + "Varnish is a web application 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 + l:expat ; doc/html/_static/underscore.js + l:gpl2+)))) ; doc/html/_static/jquery.js is dual MIT/GPL2+ -- 2.10.2