gnu: nginx: Use G-expressions.
* gnu/packages/web.scm (nginx)[arguments]: Rewrite in gexp style. Remove trailing #t's.master
parent
cee03495bf
commit
4079cd9ba3
|
@ -384,78 +384,74 @@ the same, being completely separated from the Internet.")
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(inputs (list libxml2 libxslt openssl pcre zlib))
|
(inputs (list libxml2 libxslt openssl pcre zlib))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f ; no test target
|
(list
|
||||||
#:phases
|
#:tests? #f ; no test target
|
||||||
(modify-phases %standard-phases
|
#:phases
|
||||||
(add-before 'configure 'patch-/bin/sh
|
#~(modify-phases %standard-phases
|
||||||
(lambda _
|
(add-before 'configure 'patch-/bin/sh
|
||||||
(substitute* "auto/feature"
|
(lambda _
|
||||||
(("/bin/sh") (which "sh")))
|
(substitute* "auto/feature"
|
||||||
#t))
|
(("/bin/sh") (which "sh")))))
|
||||||
(replace 'configure
|
(replace 'configure
|
||||||
;; The configure script is hand-written, not from GNU autotools.
|
;; The configure script is hand-written, not from GNU autotools.
|
||||||
(lambda* (#:key configure-flags inputs outputs #:allow-other-keys)
|
(lambda* (#:key configure-flags inputs outputs #:allow-other-keys)
|
||||||
(let ((flags
|
(let ((flags
|
||||||
(append (list (string-append "--prefix=" (assoc-ref outputs "out"))
|
(append (list (string-append "--prefix=" (assoc-ref outputs "out"))
|
||||||
"--with-http_ssl_module"
|
"--with-http_ssl_module"
|
||||||
"--with-http_v2_module"
|
"--with-http_v2_module"
|
||||||
"--with-http_xslt_module"
|
"--with-http_xslt_module"
|
||||||
"--with-http_gzip_static_module"
|
"--with-http_gzip_static_module"
|
||||||
"--with-http_gunzip_module"
|
"--with-http_gunzip_module"
|
||||||
"--with-http_addition_module"
|
"--with-http_addition_module"
|
||||||
"--with-http_sub_module"
|
"--with-http_sub_module"
|
||||||
"--with-pcre-jit"
|
"--with-pcre-jit"
|
||||||
"--with-debug"
|
"--with-debug"
|
||||||
"--with-stream"
|
"--with-stream"
|
||||||
;; Even when not cross-building, we pass the
|
;; Even when not cross-building, we pass the
|
||||||
;; --crossbuild option to avoid customizing for the
|
;; --crossbuild option to avoid customizing for the
|
||||||
;; kernel version on the build machine.
|
;; kernel version on the build machine.
|
||||||
,(let ((system "Linux") ; uname -s
|
#$(let ((system "Linux") ; uname -s
|
||||||
(release "3.2.0") ; uname -r
|
(release "3.2.0") ; uname -r
|
||||||
;; uname -m
|
;; uname -m
|
||||||
(machine (match (or (%current-target-system)
|
(machine (match (or (%current-target-system)
|
||||||
(%current-system))
|
(%current-system))
|
||||||
("x86_64-linux" "x86_64")
|
("x86_64-linux" "x86_64")
|
||||||
("i686-linux" "i686")
|
("i686-linux" "i686")
|
||||||
("mips64el-linux" "mips64")
|
("mips64el-linux" "mips64")
|
||||||
;; Prevent errors when querying
|
;; Prevent errors when querying
|
||||||
;; this package on unsupported
|
;; this package on unsupported
|
||||||
;; platforms, e.g. when running
|
;; platforms, e.g. when running
|
||||||
;; "guix package --search="
|
;; "guix package --search="
|
||||||
(_ "UNSUPPORTED"))))
|
(_ "UNSUPPORTED"))))
|
||||||
(string-append "--crossbuild="
|
(string-append "--crossbuild="
|
||||||
system ":" release ":" machine)))
|
system ":" release ":" machine)))
|
||||||
configure-flags)))
|
configure-flags)))
|
||||||
(setenv "CC" ,(cc-for-target))
|
(setenv "CC" #$(cc-for-target))
|
||||||
;; Fix ./configure test for ‘#include <libxml/parser.h>’.
|
;; Fix ./configure test for ‘#include <libxml/parser.h>’.
|
||||||
(setenv "CFLAGS" ; CPPFLAGS is not respected
|
(setenv "CFLAGS" ; CPPFLAGS is not respected
|
||||||
(string-append "-I" (assoc-ref inputs "libxml2")
|
(string-append "-I" (assoc-ref inputs "libxml2")
|
||||||
"/include/libxml2"))
|
"/include/libxml2"))
|
||||||
(format #t "configure flags: ~s~%" flags)
|
(format #t "configure flags: ~s~%" flags)
|
||||||
(apply invoke "./configure" flags)
|
(apply invoke "./configure" flags))))
|
||||||
#t)))
|
(add-after 'install 'install-man-page
|
||||||
(add-after 'install 'install-man-page
|
(lambda _
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(let ((man (string-append #$output "/share/man")))
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(install-file "objs/nginx.8" (string-append man "/man8")))))
|
||||||
(man (string-append out "/share/man")))
|
(add-after 'install 'fix-root-dirs
|
||||||
(install-file "objs/nginx.8" (string-append man "/man8"))
|
(lambda _
|
||||||
#t)))
|
;; 'make install' puts things in strange places, so we need to
|
||||||
(add-after 'install 'fix-root-dirs
|
;; clean it up ourselves.
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(let* ((out #$output)
|
||||||
;; 'make install' puts things in strange places, so we need to
|
(share (string-append out "/share/nginx")))
|
||||||
;; clean it up ourselves.
|
;; This directory is empty, so get rid of it.
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(rmdir (string-append out "/logs"))
|
||||||
(share (string-append out "/share/nginx")))
|
;; Example configuration and HTML files belong in
|
||||||
;; This directory is empty, so get rid of it.
|
;; /share.
|
||||||
(rmdir (string-append out "/logs"))
|
(mkdir-p share)
|
||||||
;; Example configuration and HTML files belong in
|
(rename-file (string-append out "/conf")
|
||||||
;; /share.
|
(string-append share "/conf"))
|
||||||
(mkdir-p share)
|
(rename-file (string-append out "/html")
|
||||||
(rename-file (string-append out "/conf")
|
(string-append share "/html"))))))))
|
||||||
(string-append share "/conf"))
|
|
||||||
(rename-file (string-append out "/html")
|
|
||||||
(string-append share "/html"))
|
|
||||||
#t))))))
|
|
||||||
(home-page "https://nginx.org")
|
(home-page "https://nginx.org")
|
||||||
(synopsis "HTTP and reverse proxy server")
|
(synopsis "HTTP and reverse proxy server")
|
||||||
(description
|
(description
|
||||||
|
|
Reference in New Issue