GNU bug report logs - #47983
[PATCH] gnu: Add bees.

Previous Next

Package: guix-patches;

Reported by: Jack Hill <jackhill <at> jackhill.us>

Date: Fri, 23 Apr 2021 21:17:02 UTC

Severity: normal

Tags: patch

Done: Jack Hill <jackhill <at> jackhill.us>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47983 in the body.
You can then email your comments to 47983 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47983; Package guix-patches. (Fri, 23 Apr 2021 21:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jack Hill <jackhill <at> jackhill.us>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 23 Apr 2021 21:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add bees.
Date: Fri, 23 Apr 2021 17:16:02 -0400
* gnu/packages/file-system.scm (bees): New variable.
---

Submitting this patch for review and collaboration. Bees builds and
installs fine, and the runpath is correct. However, I have not tested
it against an actual filesystem.

I'm not sure if substituting all the external programs in the launcher
shell script should be factored out (I noticed several common regex
patterns when I was writing it), but I think it might be clearer as it is.


 gnu/packages/file-systems.scm | 106 ++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index 6724ad96bb..b08cc68d7e 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith <at> outlook.com>
 ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework <at> protonmail.com>
 ;;; Copyright © 2021 Stefan Reichör <stefan <at> xsteve.at>
+;;; Copyright © 2021 Jack Hill <jackhill <at> jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -59,6 +60,7 @@
   #:use-module (gnu packages kerberos)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages markup)
   #:use-module (gnu packages nfs)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages openldap)
@@ -155,6 +157,110 @@ large and/or frequently changing (network) environment.")
     (license (list license:bsd-3        ; modules/cyrus-sasl.c
                    license:gpl2+))))    ; the rest
 
+(define-public bees
+  (package
+    (name "bees")
+    (version "0.6.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Zygo/bees")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "11ppbf23b8ngzfy02am0skxlybzmgsp6kna21jimb01x9pp1q7l7"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (let ((out (assoc-ref %outputs "out")))
+         (list (string-append "CC=" ,(cc-for-target))
+               (string-append "DESTDIR=" out)
+               "LIBEXEC_PREFIX=/libexec"
+               "PREFIX=/"
+               "SYSTEMD_SYSTEM_UNIT_DIR=/lib/systemd/system"))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "src/Makefile"
+                 (("^LDFLAGS.*")
+                  (string-append "LDFLAGS=-L../lib -Wl,-rpath=" out "/lib"))))))
+         ;; Substitute external commands in beesds shell script with absolute
+         ;; store paths.  When updating package, this phase is worth extra
+         ;; review.
+         (add-after 'configure 'patch-beesd
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((btrfs (assoc-ref inputs "btrfs-progs"))
+                   (coreutils (assoc-ref inputs "coreutils"))
+                   (gawk (assoc-ref inputs "gawk"))
+                   (grep (assoc-ref inputs "grep"))
+                   (out (assoc-ref outputs "out"))
+                   (sed (assoc-ref inputs "sed"))
+                   (util-linux (assoc-ref inputs "util-linux")))
+               (substitute* "scripts/beesd.in"
+                 (("(readonly bees_bin=).*" _ start)
+                  (string-append start out "/libexec/bees"))
+                 (("\\$\\(blkid")
+                  (string-append "$(" util-linux "/sbin/blkid"))
+                 (("^([[:blank:]]+)btrfs([[:blank:]].*)" _ indent args)
+                  (string-append indent (string-append btrfs "/bin/btrfs")
+                                 args))
+                 (("([[:blank:]]+)chmod([[:blank:]]+)" _ before after)
+                  (string-append before coreutils "/bin/chmod" after))
+                 (("([[:blank:]]+)cut([[:blank:]]+)" _ before after)
+                  (string-append before coreutils "/bin/cut" after))
+                 (("\\$\\(egrep")
+                  (string-append "$(" grep "/bin/egrep"))
+                 (("\\$\\(du")
+                  (string-append "$(" coreutils "/bin/du"))
+                 (("([[:blank:]]+)awk([[:blank:]]+)" _ before after)
+                  (string-append before gawk "/bin/awk" after))
+                 (("([[:blank:]]+)grep([[:blank:]]+)" _ before after)
+                  (string-append before grep "/bin/grep" after))
+                 (("([[:blank:]]+)head([[:blank:]]+)" _ before after)
+                  (string-append before coreutils "/bin/head" after))
+                 (("^mkdir([[:blank:]]+)" _ after)
+                  (string-append coreutils "/bin/mkdir" after))
+                 (("^mount([[:blank:]]+)" _ after)
+                  (string-append util-linux "/bin/mount" after))
+                 (("([[:blank:]]+)mountpoint([[:blank:]]+)" _ before after)
+                  (string-append before util-linux "/bin/mountpoint" after))
+                 (("\\$\\(realpath")
+                  (string-append "$(" coreutils "/bin/realpath"))
+                 (("([[:blank:]]+)rm([[:blank:]]+)" _ before after)
+                  (string-append before coreutils "/bin/rm" after))
+                 (("([[:blank:]]+)sed([[:blank:]]+)" _ before after)
+                  (string-append before sed "/bin/sed" after))
+                 (("([[:blank:]]+)touch([[:blank:]]+)" _ before after)
+                  (string-append before coreutils "/bin/touch" after))
+                 (("([[:blank:]]+)truncate([[:blank:]]+)" _ before after)
+                  (string-append before coreutils "/bin/truncate" after))
+                 (("([[:blank:]]+)umount([[:blank:]]+)" _ before after)
+                  (string-append before util-linux "/bin/umount" after))
+                 (("([[:blank:]]+)uuidparse([[:blank:]]+)" _ before after)
+                  (string-append before util-linux "/bin/uuidparse" after))))))
+         (add-after 'install 'install-docs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "README.html"
+                           (string-append (assoc-ref outputs "out") "/share/doc/"
+                                          ,name "-" ,version)))))
+       #:test-target "test"))
+    (native-inputs
+     `(("markdown" ,markdown)))
+    (inputs
+     `(("gawk" ,gawk)
+       ("btrfs-progs" ,btrfs-progs)
+       ("util-linux" ,util-linux "lib")))
+    (home-page "https://github.com/Zygo/bees")
+    (synopsis "Deduplication for btrfs")
+    (description "@acronym{BEES, Best-Effort Extent-Same} is a deduplication
+agent for btrfs.  It scans a btrfs filesystem for duplicate blocks and submits
+them for deduplication.  As new data are added to the filesystem, the BEES
+daemon will scan it.")
+    (license license:gpl3+)))
+
 (define-public bindfs
   (package
     (name "bindfs")
-- 
2.31.1





Reply sent to Jack Hill <jackhill <at> jackhill.us>:
You have taken responsibility. (Tue, 17 Jan 2023 16:51:02 GMT) Full text and rfc822 format available.

Notification sent to Jack Hill <jackhill <at> jackhill.us>:
bug acknowledged by developer. (Tue, 17 Jan 2023 16:51:02 GMT) Full text and rfc822 format available.

Message #10 received at 47983-done <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: 47983-done <at> debbugs.gnu.org
Subject: Bees has been added
Date: Tue, 17 Jan 2023 11:50:44 -0500 (EST)
Bees has been added in #60250.

Thanks everyone!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Feb 2023 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.