updating nginx and some modules defs

This commit is contained in:
Jean-François GUILLAUME 2023-01-05 09:23:05 +01:00
parent 2a6e4103cd
commit dfd23a25ba
GPG key ID: 38751DAE145EFB5A

View file

@ -4,8 +4,7 @@
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module ((guix licenses) #:use-module ((guix licenses) #:prefix license:)
#:prefix license:)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages curl) #:use-module (gnu packages curl)
@ -21,31 +20,22 @@
(define-public nginx (define-public nginx
(package (package
(name "nginx") (name "nginx")
(version "1.23.2") (version "1.23.3")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://nginx.org/download/nginx-" version (uri (string-append "https://nginx.org/download/nginx-" version ".tar.gz"))
".tar.gz")) (sha256 (base32 "0m5s8a04jlpv6qhk09sfqbj4rxj38g6923w12j5y3ymrvf3mgjvm"))))
(sha256
(base32
"0ihbkfcqlqadzkdk813raq15qqrahss1gdd81bkswanpsdrc4358"))))
(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 `(#:tests? #f
#:phases (modify-phases %standard-phases #:phases (modify-phases %standard-phases
(add-before 'configure 'patch-/bin/sh (add-before 'configure 'patch-/bin/sh
(lambda _ (lambda _ (substitute* "auto/feature" (("/bin/sh") (which "sh"))) #t))
(substitute* "auto/feature"
(("/bin/sh")
(which "sh"))) #t))
(replace 'configure (replace 'configure
;; 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 (let ((flags (append (list
#:allow-other-keys) (string-append "--prefix=" (assoc-ref outputs "out"))
(let ((flags (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"
@ -56,35 +46,17 @@
"--with-pcre-jit" "--with-pcre-jit"
"--with-debug" "--with-debug"
"--with-stream" "--with-stream"
;; Even when not cross-building, we pass the
;; --crossbuild option to avoid customizing for the
;; kernel version on the build machine.
,(let ((system "Linux") ,(let ((system "Linux")
;uname -s (release "3.2.0")
(release "3.2.0") ;uname -r (machine (match (or (%current-target-system) (%current-system))
;; uname -m ("x86_64-linux" "x86_64")
(machine (match (or (%current-target-system) ("i686-linux" "i686")
(%current-system)) ("mips64el-linux" "mips64")
("x86_64-linux"
"x86_64")
("i686-linux"
"i686")
("mips64el-linux"
"mips64")
(_ "UNSUPPORTED")))) (_ "UNSUPPORTED"))))
(string-append "--crossbuild=" (string-append "--crossbuild=" system ":" release ":" machine)))
system
":"
release
":"
machine)))
configure-flags))) configure-flags)))
(setenv "CC" (setenv "CC" ,(cc-for-target))
,(cc-for-target)) (setenv "CFLAGS" (string-append "-I" (assoc-ref inputs "libxml2") "/include/libxml2"))
(setenv "CFLAGS" ;CPPFLAGS is not respected
(string-append "-I"
(assoc-ref inputs "libxml2")
"/include/libxml2"))
(format #t "configure flags: ~s~%" flags) (format #t "configure flags: ~s~%" flags)
(apply invoke "./configure" flags) #t))) (apply invoke "./configure" flags) #t)))
(add-after 'install 'install-man-page (add-after 'install 'install-man-page
@ -115,16 +87,11 @@
(package (package
(inherit nginx) (inherit nginx)
(name "nginx-ldap-auth-module") (name "nginx-ldap-auth-module")
(version "83c059b73566c2ee9cbda920d91b66657cf120b7") (version "83c059b")
(source (origin (source (origin
(method git-fetch) (method url-fetch)
(uri (git-reference (uri (list (string-append "https://github.com/kvspb/nginx-auth-ldap/archive/" version ".tar.gz")))
(url "https://github.com/kvspb/nginx-auth-ldap") (sha256 (base32 "0r44dhsbw2ssg84vc5i68zdnhd0131nkbkbmxq7rpq9avddlw339"))))
(commit version)))
(file-name (git-file-name "nginx-ldap-auth-module" version))
(sha256
(base32
"023zmdir7w92dnb508ggskkc7kmd7k71hc597sb7i4xfgpwxzq1s"))))
(synopsis "LDAP Authentication module for nginx") (synopsis "LDAP Authentication module for nginx")
(description (description
"LDAP module for nginx which supports authentication against multiple LDAP servers.") "LDAP module for nginx which supports authentication against multiple LDAP servers.")
@ -161,12 +128,8 @@
(version "3.0.8") (version "3.0.8")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (list (string-append (uri (list (string-append "https://github.com/SpiderLabs/ModSecurity/releases/download/v" version "/modsecurity-v" version ".tar.gz")))
"https://github.com/SpiderLabs/ModSecurity/releases/download/v" (sha256 (base32 "1isng4z2xijqq92105si1zxkzlx4ifdnn38d7n38mrfp7jdwhhg2"))))
version "/modsecurity-v" version ".tar.gz")))
(sha256
(base32
"1isng4z2xijqq92105si1zxkzlx4ifdnn38d7n38mrfp7jdwhhg2"))))
(synopsis "modsecurity module for nginx") (synopsis "modsecurity module for nginx")
(description "modsecurity module for nginx.") (description "modsecurity module for nginx.")
(license license:asl2.0) (license license:asl2.0)
@ -182,15 +145,9 @@
("pkg-config" ,pkg-config) ("pkg-config" ,pkg-config)
("nginx-sources" ,(package-source nginx)))) ("nginx-sources" ,(package-source nginx))))
(arguments (arguments
`(#:configure-flags (list (string-append "--with-curl=" `(#:configure-flags (list (string-append "--with-curl=" (assoc-ref %build-inputs "curl"))
(assoc-ref %build-inputs "curl")) (string-append "--with-pcre=" (assoc-ref %build-inputs "pcre:bin") "/bin/pcre-config")
(string-append "--with-pcre=" (string-append "--with-libxml=" (assoc-ref %build-inputs "libxml2"))
(assoc-ref %build-inputs
"pcre:bin")
"/bin/pcre-config")
(string-append "--with-libxml="
(assoc-ref %build-inputs
"libxml2"))
"--enable-standalone-module"))))) "--enable-standalone-module")))))
(define-public nginx-modsecurity-module (define-public nginx-modsecurity-module
@ -200,12 +157,8 @@
(version "1.0.3") (version "1.0.3")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (list (string-append (uri (list (string-append "https://github.com/SpiderLabs/ModSecurity-nginx/releases/download/v" version "/modsecurity-nginx-v" version ".tar.gz")))
"https://github.com/SpiderLabs/ModSecurity-nginx/releases/download/v" (sha256 (base32 "1pcayz0kkpr0fvs8fwai0xv7jw9r7ph66vwxm6vrq0mc11r1r0df"))))
version "/modsecurity-nginx-v" version ".tar.gz")))
(sha256
(base32
"1pcayz0kkpr0fvs8fwai0xv7jw9r7ph66vwxm6vrq0mc11r1r0df"))))
(synopsis "ModSecurity module for nginx") (synopsis "ModSecurity module for nginx")
(description "ModSecurity module for nginx.") (description "ModSecurity module for nginx.")
(build-system gnu-build-system) (build-system gnu-build-system)
@ -221,18 +174,13 @@
(add-after 'unpack 'unpack-nginx-sources (add-after 'unpack 'unpack-nginx-sources
(lambda* (#:key inputs native-inputs #:allow-other-keys) (lambda* (#:key inputs native-inputs #:allow-other-keys)
(begin (begin
;; The nginx source code is part of the modules source.
(format #t "decompressing nginx source code~%") (format #t "decompressing nginx source code~%")
(let ((tar (assoc-ref inputs "tar")) (let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(nginx-srcs (assoc-ref inputs "nginx-sources"))) (invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")) #t)))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs
"--strip-components=1")) #t)))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") (let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
"/etc/nginx/modules"))) (install-file "objs/ngx_http_modsecurity_module.so" modules-dir) #t)))
(install-file "objs/ngx_http_modsecurity_module.so"
modules-dir) #t)))
(delete 'fix-root-dirs) (delete 'fix-root-dirs)
(delete 'install-man-page))))))) (delete 'install-man-page)))))))
@ -243,12 +191,8 @@
(version "3.4") (version "3.4")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (list (string-append (uri (list (string-append "https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/" version ".tar.gz")))
"https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/" (sha256 (base32 "0lllgnasd97r6xkj70q42rp61cxrz8qlb64l14rmlwcd6hizqwmd"))))
version ".tar.gz")))
(sha256
(base32
"0lllgnasd97r6xkj70q42rp61cxrz8qlb64l14rmlwcd6hizqwmd"))))
(synopsis "GeoIP2 module for nginx") (synopsis "GeoIP2 module for nginx")
(description "GeoIP2 module for nginx.") (description "GeoIP2 module for nginx.")
(build-system gnu-build-system) (build-system gnu-build-system)
@ -264,16 +208,12 @@
(add-after 'unpack 'unpack-nginx-sources (add-after 'unpack 'unpack-nginx-sources
(lambda* (#:key inputs native-inputs #:allow-other-keys) (lambda* (#:key inputs native-inputs #:allow-other-keys)
(begin (begin
;; The nginx source code is part of the modules source.
(format #t "decompressing nginx source code~%") (format #t "decompressing nginx source code~%")
(let ((tar (assoc-ref inputs "tar")) (let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(nginx-srcs (assoc-ref inputs "nginx-sources"))) (invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")) #t)))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs
"--strip-components=1")) #t)))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") (let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
"/etc/nginx/modules")))
(install-file "objs/ngx_http_geoip2_module.so" modules-dir) (install-file "objs/ngx_http_geoip2_module.so" modules-dir)
(install-file "objs/ngx_stream_geoip2_module.so" modules-dir) (install-file "objs/ngx_stream_geoip2_module.so" modules-dir)
#t))) #t)))
@ -287,12 +227,8 @@
(version "e12e965") (version "e12e965")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (list (string-append (uri (list (string-append "https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/" version ".tar.gz")))
"https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/" (sha256 (base32 "1cxb3yv6085rj50s001p2vblvz5px2v92whwjhb14kl8fnm2cans"))))
version ".tar.gz")))
(sha256
(base32
"1cxb3yv6085rj50s001p2vblvz5px2v92whwjhb14kl8fnm2cans"))))
(synopsis "substitutions_filter module for nginx") (synopsis "substitutions_filter module for nginx")
(description "substitutions_filter module for nginx.") (description "substitutions_filter module for nginx.")
(build-system gnu-build-system) (build-system gnu-build-system)
@ -307,17 +243,12 @@
(add-after 'unpack 'unpack-nginx-sources (add-after 'unpack 'unpack-nginx-sources
(lambda* (#:key inputs native-inputs #:allow-other-keys) (lambda* (#:key inputs native-inputs #:allow-other-keys)
(begin (begin
;; The nginx source code is part of the modules source.
(format #t "decompressing nginx source code~%") (format #t "decompressing nginx source code~%")
(let ((tar (assoc-ref inputs "tar")) (let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(nginx-srcs (assoc-ref inputs "nginx-sources"))) (invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")) #t)))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs
"--strip-components=1")) #t)))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") (let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
"/etc/nginx/modules"))) (install-file "objs/ngx_http_subs_filter_module.so" modules-dir) #t)))
(install-file "objs/ngx_http_subs_filter_module.so"
modules-dir) #t)))
(delete 'fix-root-dirs) (delete 'fix-root-dirs)
(delete 'install-man-page))))))) (delete 'install-man-page)))))))