summaryrefslogtreecommitdiff
path: root/gnu/packages/web.scm
diff options
context:
space:
mode:
authorjgart <jgart@dismail.de>2026-08-07 17:21:12 +0100
committerjgart <jgart@dismail.de>2026-08-11 09:26:15 +0100
commitec55b79582ca16e6881b226597832c3ddfac3918 (patch)
tree29943f7d30b7b15643c86aac36fe7cc2b979a794 /gnu/packages/web.scm
parent71f625d78ec78c7204da7c39b98f9639d8ae4954 (diff)
gnu: Add hurl.
* gnu/packages/web.scm (hurl): New variable. Change-Id: I9e5121a902567671487a9dd78eccd05798f65363
Diffstat (limited to 'gnu/packages/web.scm')
-rw-r--r--gnu/packages/web.scm124
1 files changed, 123 insertions, 1 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index edf0a336428..4df6a44bf06 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -58,7 +58,7 @@
58;;; Copyright © 2022 cage <cage-dev@twistfold.it> 58;;; Copyright © 2022 cage <cage-dev@twistfold.it>
59;;; Copyright © 2022 Pradana Aumars <paumars@courrier.dev> 59;;; Copyright © 2022 Pradana Aumars <paumars@courrier.dev>
60;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com> 60;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
61;;; Copyright © 2022 jgart <jgart@dismail.de> 61;;; Copyright © 2022, 2026 jgart <jgart@dismail.de>
62;;; Copyright © 2023 Paul A. Patience <paul@apatience.com> 62;;; Copyright © 2023 Paul A. Patience <paul@apatience.com>
63;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu> 63;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
64;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu> 64;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
@@ -9989,6 +9989,128 @@ concurrency, and return status.")
9989 ;; GPLv3+ with OpenSSL linking exception. 9989 ;; GPLv3+ with OpenSSL linking exception.
9990 (license license:gpl3+))) 9990 (license license:gpl3+)))
9991 9991
9992(define-public hurl
9993 (package
9994 (name "hurl")
9995 (version "8.0.1")
9996 (source
9997 (origin
9998 ;; The crates.io tarball does not include the hurlfmt crate.
9999 (method git-fetch)
10000 (uri (git-reference
10001 (url "https://github.com/Orange-OpenSource/hurl")
10002 (commit version)))
10003 (file-name (git-file-name name version))
10004 (sha256
10005 (base32 "0wsw9khfznc638qzp8zx2zwgnrg5d160ky5gnslwm9frz3p5hp0d"))))
10006 (build-system cargo-build-system)
10007 (arguments
10008 (list
10009 #:install-source? #f
10010 #:cargo-install-paths ''("packages/hurl" "packages/hurlfmt")
10011 #:cargo-test-flags
10012 '(list
10013 ;; Excluding doctests since rust-1.93 does not support them.
10014 "--lib" "--bins" "--tests")
10015 #:phases
10016 #~(modify-phases %standard-phases
10017 (add-after 'unpack 'relax-rust-version
10018 (lambda _
10019 ;; Upstream requires the latest stable Rust.
10020 (substitute* '("packages/hurl/Cargo.toml"
10021 "packages/hurlfmt/Cargo.toml")
10022 (("rust-version = \"1.95.0\"")
10023 "rust-version = \"1.93.0\""))))
10024 (add-before 'check 'start-test-server
10025 (lambda _
10026 ;; The integration tests expect a Flask test server
10027 ;; listening on port 8000.
10028 (with-directory-excursion "integration/hurl"
10029 (mkdir-p "build")
10030 (spawn "python3"
10031 '("python3" "server.py"
10032 "--host" "127.0.0.1" "--port" "8000")))
10033 ;; Wait for the server to come up.
10034 (let loop ((attempts 30))
10035 (unless (false-if-exception
10036 (let ((s (socket PF_INET SOCK_STREAM 0)))
10037 (connect s AF_INET
10038 (inet-pton AF_INET "127.0.0.1") 8000)
10039 (close-port s)))
10040 (when (zero? attempts)
10041 (error "test server did not start"))
10042 (sleep 1)
10043 (loop (1- attempts))))))
10044 (add-before 'install 'generate-man-pages
10045 (lambda _
10046 ;; Build the man pages from their Markdown sources.
10047 (for-each (lambda (name)
10048 (with-output-to-file (string-append
10049 "docs/manual/" name ".1")
10050 (lambda ()
10051 (invoke "python3" "bin/docs/build_man.py"
10052 (string-append
10053 "docs/manual/" name ".md")))))
10054 '("hurl" "hurlfmt"))))
10055 (add-before 'install 'generate-completions
10056 (lambda _
10057 ;; Generate the shell completions from the option spec
10058 ;; files, using upstream's script. This runs only the
10059 ;; completion part of generate_all.py, since the other
10060 ;; parts rewrite the source tree.
10061 (setenv "PYTHONPATH" "bin/spec/options")
10062 (invoke "python3" "-c"
10063 "import generate_all as g
10064for name in ('hurl', 'hurlfmt'):
10065 g.generate_completion_files(name, g.get_option_files('docs/spec/options/' + name))")))
10066 (add-after 'install 'install-man-pages
10067 (lambda _
10068 (let ((man1 (string-append #$output "/share/man/man1")))
10069 (for-each (lambda (page)
10070 (install-file page man1))
10071 '("docs/manual/hurl.1" "docs/manual/hurlfmt.1")))))
10072 (add-after 'install 'install-completions
10073 (lambda _
10074 (let ((bash (string-append #$output
10075 "/share/bash-completion/completions"))
10076 (fish (string-append #$output
10077 "/share/fish/vendor_completions.d"))
10078 (zsh (string-append #$output "/share/zsh/site-functions")))
10079 (for-each (lambda (name)
10080 ;; Bash completion files must be named after
10081 ;; the command, without the .bash extension.
10082 (mkdir-p bash)
10083 (copy-file (string-append "completions/"
10084 name ".bash")
10085 (string-append bash "/" name))
10086 (install-file (string-append "completions/"
10087 name ".fish")
10088 fish)
10089 (install-file (string-append "completions/_"
10090 name)
10091 zsh))
10092 '("hurl" "hurlfmt"))))))))
10093 (native-inputs
10094 (list clang
10095 pkg-config
10096 python
10097 python-flask
10098 python-waitress))
10099 (inputs
10100 (cons* curl
10101 libxml2
10102 openssl
10103 zlib
10104 (cargo-inputs 'hurl)))
10105 (home-page "https://hurl.dev")
10106 (synopsis "Run and test HTTP requests")
10107 (description
10108 "Hurl is a command line tool that runs HTTP requests defined in a plain
10109text format. It can chain requests, capture values and evaluate queries on
10110headers and body response. This package also provides @command{hurlfmt},
10111a formatter and linter for Hurl files.")
10112 (license license:asl2.0)))
10113
9992(define-public gmnisrv 10114(define-public gmnisrv
9993 (package 10115 (package
9994 (name "gmnisrv") 10116 (name "gmnisrv")