From unknown Sat Jun 21 10:41:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47983] [PATCH] gnu: Add bees. Resent-From: Jack Hill Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Apr 2021 21:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47983@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16192125811099 (code B ref -1); Fri, 23 Apr 2021 21:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Apr 2021 21:16:21 +0000 Received: from localhost ([127.0.0.1]:39043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1la39x-0000He-3I for submit@debbugs.gnu.org; Fri, 23 Apr 2021 17:16:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:33380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1la39u-0000HW-FB for submit@debbugs.gnu.org; Fri, 23 Apr 2021 17:16:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1la39u-00051A-1t for guix-patches@gnu.org; Fri, 23 Apr 2021 17:16:18 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:44132) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1la39q-0004Pb-4Q for guix-patches@gnu.org; Fri, 23 Apr 2021 17:16:17 -0400 Received: from [2001:470:8:9f5:f850:c9a2:75c6:a2d9] (helo=alperton.home.eronel.org) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la39o-0006W4-Ty for guix-patches@gnu.org; Fri, 23 Apr 2021 17:16:12 -0400 From: Jack Hill Date: Fri, 23 Apr 2021 17:16:02 -0400 Message-Id: <20210423211602.15255-1-jackhill@jackhill.us> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=104.248.1.95; envelope-from=jackhill@jackhill.us; helo=minsky.hcoop.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * 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 ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 Jack Hill ;;; ;;; 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 From unknown Sat Jun 21 10:41:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jack Hill Subject: bug#47983: closed (Bees has been added) Message-ID: References: <3d9b5741-7224-13ca-638d-9dbbe7e89eb6@jackhill.us> <20210423211602.15255-1-jackhill@jackhill.us> X-Gnu-PR-Message: they-closed 47983 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 47983@debbugs.gnu.org Date: Tue, 17 Jan 2023 16:51:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1673974262-5547-1" This is a multi-part message in MIME format... ------------=_1673974262-5547-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #47983: [PATCH] gnu: Add bees. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 47983@debbugs.gnu.org. --=20 47983: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D47983 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1673974262-5547-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 47983-done) by debbugs.gnu.org; 17 Jan 2023 16:50:56 +0000 Received: from localhost ([127.0.0.1]:38093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHpAm-0001RC-5k for submit@debbugs.gnu.org; Tue, 17 Jan 2023 11:50:56 -0500 Received: from minsky.hcoop.net ([104.248.1.95]:48932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHpAi-0001Qx-U8 for 47983-done@debbugs.gnu.org; Tue, 17 Jan 2023 11:50:55 -0500 Received: from cpe-76-182-57-106.nc.res.rr.com ([76.182.57.106] helo=[172.31.7.191]) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHpAb-00076Y-J6 for 47983-done@debbugs.gnu.org; Tue, 17 Jan 2023 11:50:45 -0500 Date: Tue, 17 Jan 2023 11:50:44 -0500 (EST) From: Jack Hill To: 47983-done@debbugs.gnu.org Subject: Bees has been added Message-ID: <3d9b5741-7224-13ca-638d-9dbbe7e89eb6@jackhill.us> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 47983-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Bees has been added in #60250. Thanks everyone! ------------=_1673974262-5547-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Apr 2021 21:16:21 +0000 Received: from localhost ([127.0.0.1]:39043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1la39x-0000He-3I for submit@debbugs.gnu.org; Fri, 23 Apr 2021 17:16:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:33380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1la39u-0000HW-FB for submit@debbugs.gnu.org; Fri, 23 Apr 2021 17:16:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1la39u-00051A-1t for guix-patches@gnu.org; Fri, 23 Apr 2021 17:16:18 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:44132) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1la39q-0004Pb-4Q for guix-patches@gnu.org; Fri, 23 Apr 2021 17:16:17 -0400 Received: from [2001:470:8:9f5:f850:c9a2:75c6:a2d9] (helo=alperton.home.eronel.org) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la39o-0006W4-Ty for guix-patches@gnu.org; Fri, 23 Apr 2021 17:16:12 -0400 From: Jack Hill To: guix-patches@gnu.org Subject: [PATCH] gnu: Add bees. Date: Fri, 23 Apr 2021 17:16:02 -0400 Message-Id: <20210423211602.15255-1-jackhill@jackhill.us> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=104.248.1.95; envelope-from=jackhill@jackhill.us; helo=minsky.hcoop.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * 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 ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 Jack Hill ;;; ;;; 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 ------------=_1673974262-5547-1--