From patchwork Fri Sep 20 20:39:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adrien 'neox' Bourmault X-Patchwork-Id: 68181 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6136527BBEA; Fri, 20 Sep 2024 21:40:55 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ADD8B27BBE2 for ; Fri, 20 Sep 2024 21:40:54 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srkQm-0007Hb-Dv; Fri, 20 Sep 2024 16:40:44 -0400 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 1srkQl-0007HE-Hs for guix-patches@gnu.org; Fri, 20 Sep 2024 16:40:43 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srkQl-0005yr-7e for guix-patches@gnu.org; Fri, 20 Sep 2024 16:40:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=AL4lIL4YEuqT5HpMxok6qOTbSt9uTVytxTv46UzbVZg=; b=ljwxLo1/0MtqUbZSuIby02FgBKQkzdw4LVigTyZQ5xkQ9oLVWg3e/gHtD29+2Qfa8eGkb0OJ7gLas/CRCIzalz9tDTWi8wxnrJ/2rn4I66723Vo+neRZgyy+nmXpvsgWXjdrRv8G+no3VAAmRiTQ3ZBJ9tP/gGmhlj5JRlmfi5SJAHINvRjAPm3bd6DLxpwSBNK1fAkc9zbo5eMGNA9Gk3jjEc0X8FTWluDkVSezmHmLvxOiC/CyHnYU3Lt6nRxu1teQoJYDA1MwVrF3v3jYglGRa0CNBshttQN7COB3DnFDnie7wMjeHsVogRnEqPDGd0aIeRGzw6xZB+i7B+wBjA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srkR4-0002t8-95 for guix-patches@gnu.org; Fri, 20 Sep 2024 16:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73391] [PATCH v2 1/2] gnu: sane-backends-minimal: fix lock path for plustek backend Resent-From: neox Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2024 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73391 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73391@debbugs.gnu.org Cc: Adrien 'neox' Bourmault Received: via spool by 73391-submit@debbugs.gnu.org id=B73391.172686484911055 (code B ref 73391); Fri, 20 Sep 2024 20:41:02 +0000 Received: (at 73391) by debbugs.gnu.org; 20 Sep 2024 20:40:49 +0000 Received: from localhost ([127.0.0.1]:36431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srkQq-0002sF-LC for submit@debbugs.gnu.org; Fri, 20 Sep 2024 16:40:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srkQm-0002rl-CW for 73391@debbugs.gnu.org; Fri, 20 Sep 2024 16:40:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srkQN-0005xI-Nx; Fri, 20 Sep 2024 16:40:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=AL4lIL4YEuqT5HpMxok6qOTbSt9uTVytxTv46UzbVZg=; b=WBGrRnIqvhYH8MizDnjA GJHoevw4eombvydnmFTDjTpdnqHXsX8nGuqdxQpF0ZoLmwcKWHDORw7YL55lw3xSFlkhpJj3w1NqP 19GkHWNMOZ5KnWKJgXpa/66wr4w6vJUsiSmYjNJFiNgAooJlQRayFFMKdV9drjFOV1flIGDQqkDJ5 6blwE478dwhw/vAzMSxXzGHFYbOrpQzYeka/3NEf71y6i6ec5ir2aFom5HF5e3lvn2vf03MjhZH63 mCnP7RELrwWV5RujhugAhSIHVuvlzKJQjClvRz3RleugOBm7w92uzTlkHTaiLz7BRCDP5QVDIVIl3 86XFiaU6BVjQIQ==; From: neox Date: Fri, 20 Sep 2024 22:39:29 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Adrien 'neox' Bourmault * gnu/packages/scanner.scm (sane-backends-minimal) [arguments]<#:configure-flags>: add "--with-lockdir=/var/lock/sane" [arguments]<#:phases>: add disable-lockdir-creation to prevent creating the lockpath during install Change-Id: I338c16cd4c0bfa0d165c9906b0f1f87ab79a4f75 Signed-off-by: Adrien 'neox' Bourmault --- gnu/packages/scanner.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/packages/scanner.scm b/gnu/packages/scanner.scm index a2faaa2728..a346f004ae 100644 --- a/gnu/packages/scanner.scm +++ b/gnu/packages/scanner.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017, 2019, 2020, 2022 Tobias Geerinckx-Rice ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2022 João Gabriel +;;; Copyright © 2024 Adrien Bourmault ;;; ;;; This file is part of GNU Guix. ;;; @@ -136,7 +137,8 @@ (define-public sane-backends-minimal (inputs (list libusb)) (arguments - `(#:phases + `(#:configure-flags '("--with-lockdir=/var/lock/sane") ;; Avoid errors with plustek + #:phases (modify-phases %standard-phases (add-before 'bootstrap 'zap-unnecessary-git-dependency (lambda _ @@ -145,6 +147,12 @@ (define-public sane-backends-minimal (("/bin/sh") (which "sh"))) (with-output-to-file ".tarball-version" (lambda _ (format #t ,version))))) + (add-before 'configure 'disable-lockdir-creation + (lambda _ + ;; Modify the Makefile.am to prevent the creation of the lock dir + (substitute* "backend/Makefile.am" + (("^install-lockpath:.*$") + "install-lockpath: # pass")))) (add-before 'configure 'disable-backends (lambda _ (setenv "BACKENDS" " ") From patchwork Fri Sep 20 20:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adrien 'neox' Bourmault X-Patchwork-Id: 68182 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 18E8A27BBE9; Fri, 20 Sep 2024 21:41:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 12AB227BBE2 for ; Fri, 20 Sep 2024 21:41:19 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srkQm-0007Hq-Ql; Fri, 20 Sep 2024 16:40:44 -0400 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 1srkQl-0007HI-Q2 for guix-patches@gnu.org; Fri, 20 Sep 2024 16:40:43 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srkQl-0005z0-H9 for guix-patches@gnu.org; Fri, 20 Sep 2024 16:40:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=hc7VHbjagNnoGkqriDSZL+cvz5v/9LXxF2gvnBV503g=; b=L276YdYEAw0pynVRyW00qxQ6CfW1MWXifQGn9sh6/2LLZ003U3Cq44XoKQlKSa/U2sRcQeEwBMbURdGfB+KtVLPPP3hCpmzBEKmzs4x6fC0wOio05BB431ZInmgRfknKRSzQprQq95wh1dQ3HGHj1tq93CzlD3O9smiUIHXj1og/DemmOCE3RAHwJrrM5/P7BClFr6KkbXALXmqaw7HVAujVXPq+28rVow74Zu9VDRf+mAIblqZdGCyCdNKzWpJGFklbC/RKrZArBWzJDvLv5wwzELGtmjMUu+jY8LSxEukVlSjYKz/9BjllO/GeaJVpSABeiV2AUxINIXEB2X7fSA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srkR4-0002tG-Oz for guix-patches@gnu.org; Fri, 20 Sep 2024 16:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73391] [PATCH v2 2/2] services: sane-service-type: create lock path for plustek backend Resent-From: neox Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2024 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73391 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73391@debbugs.gnu.org Cc: Adrien 'neox' Bourmault Received: via spool by 73391-submit@debbugs.gnu.org id=B73391.172686485311071 (code B ref 73391); Fri, 20 Sep 2024 20:41:02 +0000 Received: (at 73391) by debbugs.gnu.org; 20 Sep 2024 20:40:53 +0000 Received: from localhost ([127.0.0.1]:36435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srkQv-0002sV-3R for submit@debbugs.gnu.org; Fri, 20 Sep 2024 16:40:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srkQs-0002sA-Ua for 73391@debbugs.gnu.org; Fri, 20 Sep 2024 16:40:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srkQU-0005xY-Ce; Fri, 20 Sep 2024 16:40:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=hc7VHbjagNnoGkqriDSZL+cvz5v/9LXxF2gvnBV503g=; b=d7qVQ7R9F2/1rjyyUGix U6025bPg2Ry8T9ESW73xhdR5hWITtq+ejjX3cyyzr8YNzjxc2vJ2/K1EwIqs137G2uldKDUsmivsF U7F/Gtl3TfGTaXSp151zVYrERDoQCx3DvAS4LT0NH7wdkyV/Rh/fw8FSMP4qUonVePFRIvvkJYgR/ pfxX9oA0XFCJhCaunPDl2jkh37ViwT/2l1JaieSX0etLYd9sO39tYyO7I3XZu+4l4nRuf8GfSLuhr lJC/8KtCGeI4UjPp9plO8XpJXTipTF1lVbPBgIsOoxx7h/GwiQ51gN76AfXaFarugsGCG9hbCDieA pyXnlM9AuKDkqg==; From: neox Date: Fri, 20 Sep 2024 22:39:30 +0200 Message-ID: <8604617ae2896e2d73d24958aab7ee534c656dfa.1726864525.git.neox@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Adrien 'neox' Bourmault * gnu/services/desktop.scm (sane-service-type): extend with an activation service to create the lockpath and give the right permissions Change-Id: I187886d12b5f0b4fe21b03de178ea2187205387a Signed-off-by: Adrien 'neox' Bourmault --- gnu/services/desktop.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 274aeeef9b..500527cb50 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2021, 2022 muradm ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2024 Adrien Bourmault ;;; ;;; This file is part of GNU Guix. ;;; @@ -1408,6 +1409,17 @@ (define %sane-accounts ;; The '60-libsane.rules' udev rules refers to the "scanner" group. (list (user-group (name "scanner") (system? #t)))) +(define %sane-activation + #~(begin + (use-modules (guix build utils)) + (let ((lockpath "/var/lock/sane") + (gid (vector-ref (getgrnam "scanner") 2))) + ;; Create the lock directory at runtime and give right perms + (mkdir-p lockpath) + (chown lockpath -1 gid) + (chmod lockpath #o770)) + #t)) + (define sane-service-type (service-type (name 'sane) @@ -1418,6 +1430,8 @@ (define sane-service-type (default-value sane-backends-minimal) (extensions (list (service-extension udev-service-type list) + (service-extension activation-service-type + (const %sane-activation)) (service-extension account-service-type (const %sane-accounts))))))