diff --git a/glicid/packages/nginx.scm b/glicid/packages/nginx.scm index 70bb581..01f6622 100644 --- a/glicid/packages/nginx.scm +++ b/glicid/packages/nginx.scm @@ -318,3 +318,59 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.") ) ) +(define-public nginx-http_subs_filter-module + (package + (inherit nginx) + (name "nginx-http_subs_filter-module") + (version "e12e965") + (source + (origin + (method url-fetch) + (uri (list + (string-append "https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/" version ".tar.gz") + )) + (sha256 (base32 "1cxb3yv6085rj50s001p2vblvz5px2v92whwjhb14kl8fnm2cans" )) + ) + ) + (synopsis "substitutions_filter module for nginx") + (description "substitutions_filter module for nginx.") + (build-system gnu-build-system) + (inputs + `(("nginx-sources" ,(package-source nginx)) + ,@(package-inputs nginx))) + (arguments + (substitute-keyword-arguments + `(#:configure-flags '("--add-dynamic-module=.") + #:make-flags '("modules") + ,@(package-arguments nginx) + ) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'unpack-nginx-sources + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (begin + ;; The nginx source code is part of the module’s source. + (format #t "decompressing nginx source code~%") + (let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources"))) + (invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1") + ) + #t + ) + ) + ) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules"))) + (install-file "objs/ngx_http_subs_filter_module.so" modules-dir) + #t + ) + ) + ) + (delete 'fix-root-dirs) + (delete 'install-man-page) + ) + ) + ) + ) + ) +)