diff mbox series

[bug#55682,V2,3/3] gnu: Add lcsync.

Message ID 87o7x6yxmv.fsf@contorta
State Accepted
Headers show
Series [bug#55682,V2,1/3] gnu: Add lcrq. | expand

Commit Message

Vagrant Cascadian July 30, 2022, 11:43 p.m. UTC

diff mbox series

Patch

From 14cfc0c8ac18be80eb441df3d063c4dd1175f36b Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Thu, 26 May 2022 14:37:32 -0700
Subject: [PATCH 3/3] gnu: Add lcsync.

FIXME figure out how to properly:

  setcap cap_net_raw=eip bin/lcsync

* gnu/packages/networking.scm (lcsync): New variable.
---
 gnu/packages/networking.scm | 43 +++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 41aa346036..0d2ecfcad1 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -275,6 +275,49 @@  (define-public lcrq
 the RFC.")
     (license (list license:gpl2 license:gpl3))))
 
+(define-public lcsync
+  (package
+    (name "lcsync")
+    (version "0.0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://codeberg.org/librecast/lcsync")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0s038b4xg9nlzhrganzjyfvc6n6cgd6kilnpik4axp62j2n5q11q"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:parallel-tests? #f
+       #:make-flags (let ((target ,(%current-target-system)))
+                      (list ,(string-append "CC="
+                                            (cc-for-target))
+                            ;; avoid running setcap in the install process
+                            "SETCAP_PROGRAM=true"
+                            (string-append "prefix="
+                                           (assoc-ref %outputs "out"))))
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure) ;no configure script
+                  (replace 'check
+                    (lambda _
+                      (invoke "make" "test" "CC=gcc")))
+                  (add-before 'build 'add-library-paths
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (let* ((librecast (assoc-ref inputs "librecast")))
+                        (substitute* (list "./src/Makefile" "./test/Makefile")
+                          (("-llibrecast")
+                           (string-append "-L" librecast "/lib -llibrecast")))))))))
+    (inputs (list librecast libsodium))
+    (home-page "https://librecast.net/lcsync.html")
+    (synopsis "librecast file and data syncing tool")
+    (description
+     "lcsync is a tool to sync files over IPv6 multicast or the
+local filesystem.  It splits the file into blocks, hashes them, and compares
+them in order to efficiently transfer a minimal amount of data.")
+    (license (list license:gpl2 license:gpl3))))
+
 ;; This package does not have a release yet.
 ;; But this is required to provide a feature in PipeWire.
 (define-public libcamera
-- 
2.35.1