From f6d9b3ded7642260915e2217b856c376940e2aa3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Dec 2014 23:28:48 +0100 Subject: gnu: Add socat. * gnu/packages/socat.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu/packages/socat.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 gnu/packages/socat.scm (limited to 'gnu') diff --git a/gnu/packages/socat.scm b/gnu/packages/socat.scm new file mode 100644 index 0000000000..7c0bc3d964 --- /dev/null +++ b/gnu/packages/socat.scm @@ -0,0 +1,55 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages socat) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages openssl)) + +;; XXX: Group with other networking tools like tcpdump in a module? +(define-public socat + (package + (name "socat") + (version "1.7.2.4") + (source (origin + (method url-fetch) + (uri (string-append + "http://www.dest-unreach.org/socat/download/socat-" + version ".tar.bz2")) + (sha256 + (base32 + "028yjka2zr6j1i8pmfmvzqki8ajczdl1hnry1x31xbbg3j83jxsb")))) + (build-system gnu-build-system) + (arguments '(#:tests? #f)) ;no 'check' phase + (inputs `(("openssl" ,openssl))) + (home-page "http://www.dest-unreach.org/socat/") + (synopsis + "Open bidirectional communication channels from the command line") + (description + "socat is a relay for bidirectional data transfer between two independent +data channels---files, pipes, devices, sockets, etc. It can create +\"listening\" sockets, named pipes, and pseudo terminals. + +socat can be used, for instance, as TCP port forwarder, as a shell interface +to UNIX sockets, IPv6 relay, for redirecting TCP oriented programs to a serial +line, to logically connect serial lines on different computers, or to +establish a relatively secure environment (su and chroot) for running client +or server shell scripts with network connections. ") + (license license:gpl2))) -- cgit v1.2.3 efine-record-type*): Define CTOR-PROCEDURE and pass it to ‘make-syntactic-constructor’. Change-Id: Ifd7b4e884e9fbf21c43fb4c3ad963126ef5cb476 2024-05-04records: Do not inline throws for ABI mismatches.Ludovic Courtès * guix/records.scm (record-abi-mismatch-error): New procedure. (abi-check): Use it. Change-Id: I49936599716e117b8fbf26fb9d8f462bbbb8e88b 2023-06-09records: Remove "guix" from error message.Ludovic Courtès * guix/records.scm (map-fields): Tweak error message. 2023-06-06records: Use SRFI-11 instead of SRFI-71, for Guile 2.0 compatibility.Ludovic Courtès This fixes a failure of 'tests/packages.scm' introduced in b88e38d4b51b9aa0e857baeb614c000e491ad309: some of the tests import (guix records) on the build side, which uses '%bootstrap-guile' (Guile 2.0) where SRFI-71 is unavailable. * guix/records.scm (match-record-inner): Use SRFI-11 instead of SRFI-71. 2023-06-04records: match-record: Do not show internal form.Josselin Poiret * guix/records.scm (lookup-field+wrapper): Attach source properties to the field syntax object instead. 2023-06-04records: Add MATCH-RECORD-LAMBDA.(unmatched-parenthesis ew syntax * guix/records.scm (match-record-lambda): New syntax. * tests/records.scm ("match-record-lambda"): New test. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> 2023-06-04records: match-record: Support thunked and delayed fields.(unmatched-parenthesis d * guix/records.scm (match-record): Unwrap matched thunked and delayed fields. * tests/records.scm ("match-record, thunked field", "match-record, delayed field"): New tests. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> 2023-06-04records: match-record: Raise a syntax error if TYPE is nonexistent.(unmatched-parenthesis * guix/records.scm (match-record): Raise a human-compherensible syntax error if the given record type identifier is unbound. Co-authored-by: Josselin Poiret <dev@jpoiret.xyz> Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> 2023-03-13guix: Strip #:use-module lists.Ludovic Courtès This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused. 2022-12-27records: match-record supports specifying a different variable name.Attila Lendvai An example: (match-record obj <my-type> (field1 (field2 custom-var-name) field3) ...) * guix/records.scm (match-record-inner): Add support for the new syntax. * tests/records.scm ("match-record, simple"): Add a simple test case for the new syntax. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2022-12-02records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition. 2021-08-12records: Support field sanitizers.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Add #:sanitizers. [field-sanitizer]: New procedure. [wrap-field-value]: Honor F's sanitizer. (define-record-type*)[field-sanitizer]: New procedure. Pass #:sanitizer to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & sanitize") ("define-record-type* & sanitize & thunked"): New tests. 2020-04-08records: Have ABI check work well for cross-compilation.Ludovic Courtès Reported by Jan (janneke) Nieuwenhuizen <janneke@gnu.org>. * guix/records.scm (define-record-type*): Use 'target-most-positive-fixnum' on Guile 3 instead of 'most-positive-fixnum'. 2020-01-16records: Improve reporting of "invalid field specifier" errors.Ludovic Courtès Previously users would just see: error: invalid field specifier without source location or hints. * guix/records.scm (expand): Add optional 'parent-form' parameter and pass it to 'syntax-violation' when it is true. (make-syntactic-constructor): Pass S as a third argument to 'report-invalid-field-specifier'. * guix/ui.scm (report-load-error): For 'syntax-error', show SUBFORM or FORM in the message. * tests/records.scm ("define-record-type* & wrong field specifier"): Add a 'subform' parameter and adjust test accordingly. ("define-record-type* & wrong field specifier, identifier"): New test. * tests/guix-system.sh: Add test. 2019-03-30records: Support custom 'this' identifiers.Ludovic Courtès This lets record users choose an identifier other than 'this-record'. * guix/records.scm (make-syntactic-constructor): Add #:this-identifier. [wrap-field-value]: Honor it. (define-record-type*): Add form with extra THIS-IDENTIFIER and honor it. * tests/records.scm ("define-record-type* & thunked & inherit & custom this"): New test. 2019-03-25records: Allow thunked fields to refer to 'this-record'.Ludovic Courtès * guix/records.scm (this-record): New syntax parameter. (make-syntactic-constructor)[wrap-field-value]: When F is thunked, return a one-argument lambda instead of a thunk, and parameterize THIS-RECORD. (define-record-type*)[thunked-field-accessor-definition]: Pass X to (real-get X). * tests/records.scm ("define-record-type* & thunked & this-record") ("define-record-type* & thunked & default & this-record") ("define-record-type* & thunked & inherit & this-record"): New tests. 2019-01-24records: Make 'report-duplicate-field-specifier' available at expansion-time.Ludovic Courtès Fixes a regression in 'guix pack -R' introduced with commit c2dcff41c2e47f5f978f467864d5ed7829939884. The imported modules of 'c-compiler' would be compiled in this order: first (guix records), then (guix search-paths). Consequently, 'report-duplicate-field-specifier' would be reported as unbound while compiling (guix search-paths), leading to a build failure. * guix/records.scm (report-invalid-field-specifier) (report-duplicate-field-specifier): Move within 'eval-expand'. 2019-01-22records: Detect duplicate field initializers.Ludovic Courtès * guix/records.scm (report-duplicate-field-specifier): New procedure. (make-syntactic-constructor): Call it. * tests/records.scm ("define-record-type* & duplicate initializers"): New test. Co-authored-by: Mark H Weaver <mhw@netris.org> 2018-08-31records: Adjust to test changes in 'record-abi-mismatch-error'.Ludovic Courtès Fixes a test failure introduced in de5cbd4a38a33e0412f1c481fe8e01a871dc13e5. * guix/records.scm (abi-check): Refer to TYPE in an unquoted context so we get at the RTD. * tests/records.scm ("ABI checks"): Adjust 'catch' handler to changes in the 'record-abi-mismatch-error' arguments. 2018-08-29records: Adjust 'record-abi-mismatch-error' arguments.Ludovic Courtès Previously, 'display-error' (as used by 'warn-about-load-error', for instance) would be called with a wrong number of arguments when a 'record-abi-mismatch-error' was caught: warning: failed to load '(gnu tests install)': Backtrace: [...] ERROR: In procedure display-error: Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)> Now you get warnings and error reports as intended: warning: failed to load '(gnu tests install)': In procedure abi-check: <openssh-configuration>: record ABI mismatch; recompilation needed warning: failed to load '(gnu tests ssh)': In procedure abi-check: <openssh-configuration>: record ABI mismatch; recompilation needed * guix/records.scm (print-record-abi-mismatch-error): Remove. Remove top-level call to 'set-exception-printer!'. (abi-check): Use arguments as expected by 'display-error'. 2018-05-31records: Make a couple of procedures available at expansion time.Ludovic Courtès * guix/records.scm (current-abi-identifier, abi-check): Wrap in 'eval-when'. 2018-05-23records: Insert record type ABI checks in constructors.Ludovic Courtès * guix/records.scm (print-record-abi-mismatch-error): New procedure. <top level>: Add 'set-exception-printer!' call. (current-abi-identifier, abi-check): New procedures. (make-syntactic-constructor): Add #:abi-cookie parameter. Insert calls to 'abi-check'. (define-record-type*)[compute-abi-cookie]: New procedure. Use it and emit a definition of the 'current-abi-identifier' for TYPE. * tests/records.scm ("ABI checks"): New test. 2017-12-01records: Use 'make-struct/no-tail'.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Use 'make-struct/no-tail' as 'make-struct' is deprecated as of 2.2.3. 2017-11-05guix: records: Add match-record.nee * guix/records.scm: New syntax-rule. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2017-04-17records: Slight simplification.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Simplify 'find' expression. 2016-07-14records: Improve reporting of invalid field specifiers.Ludovic Courtès Fixes <http://bugs.gnu.org/23969>. Reported by Vincent Legoll <vincent.legoll@gmail.com>. * guix/records.scm (report-invalid-field-specifier): New procedure. * tests/records.scm ("define-record-type* & wrong field specifier"): New test. 2015-06-11records: Remove unnecessary 'begin'.Ludovic Courtès * guix/records.scm (define-record-type*): Remove unnecessary 'begin'. 2015-06-11records: Add support for 'innate' fields.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Add #:innate parameter. [record-inheritance]: Honor it. [innate-field?]: New procedure. (define-record-type*)[innate-field?]: New procedure. Pass #:innate to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & inherit & innate", "define-record-type* & thunked & innate"): New tests. 2015-06-11records: "options" → "properties".Ludovic Courtès * guix/records.scm (define-record-type*): Change "options" to "properties". 2015-06-11records: Factorize field property predicates.Ludovic Courtès * guix/records.scm (define-field-property-predicate): New macro. (define-record-type*)[thunked-field?, delayed-field?]: Use it. 2015-06-11records: Separate default-value handling.Ludovic Courtès * guix/records.scm (make-syntactic-constructor)[default-values]: New variable. [field-default-value]: New procedure. Use them. 2015-06-11records: Replace 'eval-when' with a proper 'define-syntax'.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Remove enclosing 'eval-when'. Turn into a 'syntax-rules' macro. 2015-05-04records: Make 'make-syntactic-constructor' available at load/eval/expand.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Wrap in 'eval-when'. 2015-01-19records: Add support for delayed fields.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): Add #:delayed parameter. [delayed-field?]: New procedure. [wrap-field-value]: Use it. (define-record-type*)[delayed-field?, wrapped-field?]: New procedures. [thunked-field-accessor-name]: Rename to... [wrapped-field-accessor-name]: ... this. [field-spec->srfi-9]: Change 'thunked' to 'wrapped'. [delayed-field-accessor-definition]: New procedure. Compute delayed-field accessors and emit them. Pass #:delayed to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & delayed", "define-record-type* & delayed & default", "define-record-type* & delayed & inherited"): New tests. 2015-01-19make-syntactic-constructor kwarg defaultLudovic Courtès 2015-01-19records: Factorize value wrapping in the record constructor.Ludovic Courtès * guix/records.scm (make-syntactic-constructor)[wrap-field-value]: New procedure. [field-bindings, field-value]: Use it. 2015-01-19records: Move 'make-syntactic-constructor' to the top level.Ludovic Courtès * guix/records.scm (make-syntactic-constructor): New procedure, formerly nested in 'define-record-type*'. 2015-01-19records: Use keyword parameters for 'make-syntactic-constructor'.Ludovic Courtès * guix/records.scm (define-record-type*)[make-syntactic-constructor]: Turn THUNKED and DEFAULTS into keyword arguments. Adjust caller accordingly. Declare 'thunked' and 'defaults' local variables. 2015-01-09records: Optimize 'recutils->alist' by avoiding regexps.Ludovic Courtès * guix/records.scm (%recutils-field-rx, %recutils-comment-rx, %recutils-plus-rx): Remove. (%recutils-field-charset): New variable. (recutils->alist): Adjust to use tests (string-ref line 0) instead of regexps. 2014-10-17records: Improve the docstring of 'define-record-type*'.Ludovic Courtès * guix/records.scm (define-record-type*): Agument the docstring, give examples. 2014-07-17records: Report unknown field names in inheriting forms.Ludovic Courtès * guix/records.scm (define-record-type*)[record-inheritance]: Check for unexpected field names. * tests/records.scm ("define-record-type* with let* behavior"): Return #t, not *unspecified*. ("define-record-type* & inherit & extra initializers"): New test. 2014-07-17records: Factorize error-reporting macro.Ludovic Courtès * guix/records.scm (record-error): New macro. (define-record-type*)[error*]: Remove. Use 'record-error' instead.