From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8PifHF9MpWPL0gAAbAwnHQ (envelope-from ) for ; Fri, 23 Dec 2022 07:36:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aJDIG19MpWNhQgAAG6o9tA (envelope-from ) for ; Fri, 23 Dec 2022 07:36:15 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E4AC526584 for ; Fri, 23 Dec 2022 07:36:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8bf3-0005fA-9b; Fri, 23 Dec 2022 01:36:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8bf1-0005Wt-7A for guix-patches@gnu.org; Fri, 23 Dec 2022 01:36:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8bf0-0005Pn-VC for guix-patches@gnu.org; Fri, 23 Dec 2022 01:36:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8bf0-0003b3-I3 for guix-patches@gnu.org; Fri, 23 Dec 2022 01:36:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60250] [PATCH v2] gnu: Add bees. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Dec 2022 06:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60250 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60250@debbugs.gnu.org Cc: Adam Faiz Received: via spool by 60250-submit@debbugs.gnu.org id=B60250.167177732313810 (code B ref 60250); Fri, 23 Dec 2022 06:36:02 +0000 Received: (at 60250) by debbugs.gnu.org; 23 Dec 2022 06:35:23 +0000 Received: from localhost ([127.0.0.1]:36728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8beM-0003ag-J9 for submit@debbugs.gnu.org; Fri, 23 Dec 2022 01:35:23 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:40982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8beI-0003aM-G4 for 60250@debbugs.gnu.org; Fri, 23 Dec 2022 01:35:19 -0500 Date: Fri, 23 Dec 2022 14:35:03 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1671777308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lEUhf5wYifsx6d4wYT+RfFSbVc2jJfHojwV5RASQF1E=; b=cZF33Ud6tco008clXCKaOA37PGBeQRCHRXx3DBCCCmU7i0YxXyi9XrK4SAhe2ORAyPngv2 T+RWp8jd4nsEoflAKIp+V1lz4cagjKJRcIOJopxEGjEq1Y4PyPHnvDIZXVoRQ5sOUpHW5Y AqWBKx+AdUBbFsFNkKDXVDPmq+Lc8lNFB1rfxpyiykIDq77nGffGrRtYqwy3M2LTBmfFlu TvXj+miX2O9wyIP6mWyEN0rZpyJUV+cSXkqDX2KMFsx4VW7S3kPGH2+7GAzZHXc153HXin VZhWgtO9D1Jjq1iYgASUSP2y/Btzc53eGyzd5S+mOuhhuQy3JM01J76lWia6/g== Message-ID: <874jtm7hm0.wl-hako@ultrarare.space> In-Reply-To: <875ye27i1p.wl-hako@ultrarare.space> References: <21e09616-e1cc-05bc-5b9b-6b833198945b@disroot.org> <875ye27i1p.wl-hako@ultrarare.space> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671777375; a=rsa-sha256; cv=none; b=VYHM4Kn+tRvsan7fCaYJj+cj+iGAb2SgxwnK+cHZOA7TZXNFpHIcfFYy3bDeVci7ZrE/Dc slapRYU8VyYetuNwxGwVkto+/i8x5LZmDdFbpDtM73+icLbRDsR3hoqJPEsFXP2zoyZobH xg3mIjOqUT0rQRZ+3lJmg0LqfhjEM8nfLOZL44p5fItOD6KpFcB0axB3cc1140zKpxUXAi p+xFWWYK95M/q9VhatyrELYtzhcFGKxkVOHbhhF2mL3pIQTekzS7F4YieX1Wb1MoW/Oaqt 9102p+iMUopHi1iPTHwYYlHvhRjhTEsiubVHLJOynei4J7dB/J5dKA9wtV7pOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=cZF33Ud6; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671777375; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=lEUhf5wYifsx6d4wYT+RfFSbVc2jJfHojwV5RASQF1E=; b=H57Ta4wKjIGp8KcflFSSn5b4V/NuJML1uqPyzKNts7HdWEWIeQUdoygQ/iNNY+orIBi19C tptLI91mTjN3Z7HN+c4lpmSQBfvZ27PGt+OH5VO903tfGn47YaPvwYUvPXqXS2SWzNcwk9 +O4lI1FkltuYLFiN6fUjOwTTSk5X7u5G/xzXRMitZLX/Jn4wIcL3yBQhuKjo4GL/R191Eb XF0zvgoTi/YE0Zj3EAuU8YFSyNUm+FMh+qV3uDsXEKuyXlR0wC1/MdOeVFi5a0d6TO1D33 4BQuQDotnvu8TQCXQlNoUue5exFet3NU8bOdkxA2GhknY9rPjlI9oSqzIfQTOA== X-Spam-Score: -3.81 X-Migadu-Queue-Id: E4AC526584 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=cZF33Ud6; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.81 X-TUID: 2vxCvdAwg1FR * gnu/packages/patches/bees-beesd-honor-destdir-on-installation.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/file-systems.scm (bees): New variable. --- v1 -> v2: 1. Unbundle cityhash. 2. Patch beesd.in for DESTDIR handling. 3. Modify beesd.in to use absolute paths of commands. gnu/local.mk | 1 + gnu/packages/file-systems.scm | 73 +++++++++++++++++++ ...-beesd-honor-destdir-on-installation.patch | 40 ++++++++++ 3 files changed, 114 insertions(+) create mode 100644 gnu/packages/patches/bees-beesd-honor-destdir-on-installation.patch diff --git a/gnu/local.mk b/gnu/local.mk index 45d05de02d..a733d296bd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -935,6 +935,7 @@ dist_patch_DATA = \ %D%/packages/patches/bsd-games-prevent-name-collisions.patch \ %D%/packages/patches/bsd-games-stdio.h.patch \ %D%/packages/patches/beancount-disable-googleapis-fonts.patch \ + %D%/packages/patches/bees-beesd-honor-destdir-on-installation.patch \ %D%/packages/patches/beignet-correct-file-names.patch \ %D%/packages/patches/bidiv-update-fribidi.patch \ %D%/packages/patches/binutils-2.37-file-descriptor-leak.patch \ diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index 57a25a0d90..b7c681d1fb 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -81,6 +81,7 @@ (define-module (gnu packages file-systems) #:use-module (gnu packages rsync) #:use-module (gnu packages sssd) #:use-module (gnu packages sqlite) + #:use-module (gnu packages textutils) #:use-module (gnu packages time) #:use-module (gnu packages tls) #:use-module (gnu packages valgrind) @@ -1766,3 +1767,75 @@ (define-public udftools and other optical media. It supports read-only media (DVD/CD-R) and rewritable media that wears out (DVD/CD-RW).") (license license:gpl2+))) + +(define-public bees + (package + (name "bees") + (version "0.8") + (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)) + (modules '((guix build utils))) + (snippet + ;; Unbundle cityhash. + #~(begin + (for-each delete-file + '("lib/city.cc" "include/crucible/city.h")) + (substitute* "lib/Makefile" + (("city.o.*") "")) + (substitute* "src/bees-hash.cc" + (("#include .crucible/city.h.") "#include ")))) + (patches + (search-patches + ;; XXX: Cherry-picked from upstream, remove the patch when + ;; bumping version. + "bees-beesd-honor-destdir-on-installation.patch")) + (sha256 + (base32 + "1kxpz1p9k5ir385kpvmfjawki5vg22hlx768k7835w6n5z5a65y4")))) + (build-system gnu-build-system) + (arguments + (list #:test-target "test" + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + (string-append "DESTDIR=" #$output) + (string-append "BEES_VERSION=" #$version) + "PREFIX=''") + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'fixpath + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "scripts/beesd.in" + (((string-append "\\<(" (string-join (list "realpath" + "uuidparse" + "grep" + "false" + "sed" + "true" + "head" + "mkdir" + "mount" + "touch" + "du" + "cut" + "rm" + "truncate" + "chmod") + "|") ")\\>") command) + (search-input-file inputs (string-append "/bin/" command))) + + (("btrfs sub") + (string-append (search-input-file inputs "/bin/btrfs") " sub")))))))) + (inputs (list btrfs-progs cityhash util-linux)) + (home-page "https://github.com/Zygo/bees") + (synopsis "Best-Effort Extent-Same, a btrfs dedupe agent") + (description + "@code{bees} is a block-oriented userspace deduplication agent designed +for large btrfs filesystems. It is an offline dedupe combined with an +incremental data scan capability to minimize time data spends on disk from +write to dedupe.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/bees-beesd-honor-destdir-on-installation.patch b/gnu/packages/patches/bees-beesd-honor-destdir-on-installation.patch new file mode 100644 index 0000000000..4800bfc618 --- /dev/null +++ b/gnu/packages/patches/bees-beesd-honor-destdir-on-installation.patch @@ -0,0 +1,40 @@ +From 66b00f8a972ebb4da68f7aa0d0656f43ce2a2c3a Mon Sep 17 00:00:00 2001 +From: Hilton Chain +Date: Fri, 23 Dec 2022 11:04:46 +0800 +Subject: [PATCH] beesd: Honor DESTDIR on installation. + +Co-authored-by: Adam Faiz +Signed-off-by: Hilton Chain +--- + Defines.mk | 1 + + scripts/beesd.in | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Defines.mk b/Defines.mk +index 9e8df40..e5394ba 100644 +--- a/Defines.mk ++++ b/Defines.mk +@@ -2,6 +2,7 @@ MAKE += PREFIX=$(PREFIX) LIBEXEC_PREFIX=$(LIBEXEC_PREFIX) ETC_PREFIX=$(ETC_PREFI + + define TEMPLATE_COMPILER = + sed $< >$@ \ ++ -e's#@DESTDIR@#$(DESTDIR)#' \ + -e's#@PREFIX@#$(PREFIX)#' \ + -e's#@ETC_PREFIX@#$(ETC_PREFIX)#' \ + -e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#' +diff --git a/scripts/beesd.in b/scripts/beesd.in +index 174bb6c..35d04aa 100755 +--- a/scripts/beesd.in ++++ b/scripts/beesd.in +@@ -15,7 +15,7 @@ readonly AL128K="$((128*1024))" + readonly AL16M="$((16*1024*1024))" + readonly CONFIG_DIR=@ETC_PREFIX@/bees/ + +-readonly bees_bin=$(realpath @LIBEXEC_PREFIX@/bees) ++readonly bees_bin=$(realpath @DESTDIR@/@LIBEXEC_PREFIX@/bees) + + command -v "$bees_bin" &> /dev/null || ERRO "Missing 'bees' agent" + +-- +2.38.1 + base-commit: 1b29fccff2334fb5d6e979a290233a452969e39b -- 2.38.1