From a8ae0e4176d183773df939fa9f641da891890e32 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Thu, 26 Jun 2025 13:49:48 +0100 Subject: [PATCH] gnu: Add go-github-com-gopacket-gopacket. * gnu/packages/golang-web.scm (go-github-com-gopacket-gopacket): New variable. Change-Id: I43c7a5532700b4ff029562e24f901535c9f0302e --- gnu/packages/golang-web.scm | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm index e4755fc053b..75175205e21 100644 --- a/gnu/packages/golang-web.scm +++ b/gnu/packages/golang-web.scm @@ -3884,6 +3884,59 @@ values that are guaranteed to be safe, by construction or by escaping or sanitization, to use in various HTML contexts and with various DOM APIs.") (license license:bsd-3))) +(define-public go-github-com-gopacket-gopacket + (package + (name "go-github-com-gopacket-gopacket") + (version "1.3.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/gopacket/gopacket") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "10kjn30chywh010zys92idlsfg4kff7amnsnyv1a72mi56107jb8")))) + (build-system go-build-system) + (arguments + (list + #:import-path "github.com/gopacket/gopacket" + #:test-flags + #~(list "-skip" (string-join + ;; Tests require network setup or root access. + (list "TestEthernetHandle_Close_WithCancel" + "TestEthernetHandle_Close_WithTimeout" + "TestNgWriterDSB" + "TestRouting") + "|")) + ;; TODO: Full tests suite and build requires + ;; >, run just top level ones. + #:test-subdirs #~(list ".") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-examples + (lambda* (#:key tests? import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (delete-file-recursively "examples")))) + (add-after 'check 'remove-dump-data + (lambda* (#:key tests? import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (for-each delete-file + (find-files "." ".*\\.(pcamp|pcapng)$")))))))) + (native-inputs + (list go-github-com-vishvananda-netlink + go-github-com-vishvananda-netns)) + (propagated-inputs + (list ;; libpcap + ;; pf-ring ; + go-golang-org-x-net + go-golang-org-x-sys)) + (home-page "https://github.com/gopacket/gopacket") + (synopsis "Packet processing capabilities for Golang") + (description + "Package gopacket provides packet decoding for the Go language.") + (license license:bsd-3))) + (define-public go-github-com-gorilla-context (let ((commit "08b5f424b9271eedf6f9f0ce86cb9396ed337a42") (revision "0"))