From patchwork Tue Mar 8 23:10:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fesoj000 X-Patchwork-Id: 37694 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 24DA927BBEA; Tue, 8 Mar 2022 23:12:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS 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 A9A0527BBE9 for ; Tue, 8 Mar 2022 23:12:47 +0000 (GMT) Received: from localhost ([::1]:53632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRj0Y-0008UX-R7 for patchwork@mira.cbaines.net; Tue, 08 Mar 2022 18:12:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRiys-0007iy-Ui for guix-patches@gnu.org; Tue, 08 Mar 2022 18:11:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRiys-0001Ru-Ly for guix-patches@gnu.org; Tue, 08 Mar 2022 18:11:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRiys-00047F-Hb for guix-patches@gnu.org; Tue, 08 Mar 2022 18:11:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54266] [PATCH] samba: wrap scripts with GUIX_PYTHONPATH References: <50be1b85-e682-d910-970c-14a08275278f@gmail.com> In-Reply-To: <50be1b85-e682-d910-970c-14a08275278f@gmail.com> Resent-From: fesoj000 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54266 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54266@debbugs.gnu.org Received: via spool by 54266-submit@debbugs.gnu.org id=B54266.164678105715811 (code B ref 54266); Tue, 08 Mar 2022 23:11:02 +0000 Received: (at 54266) by debbugs.gnu.org; 8 Mar 2022 23:10:57 +0000 Received: from localhost ([127.0.0.1]:58109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRiym-00046w-Ql for submit@debbugs.gnu.org; Tue, 08 Mar 2022 18:10:57 -0500 Received: from mail-ej1-f52.google.com ([209.85.218.52]:45815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRiyl-00046i-0D for 54266@debbugs.gnu.org; Tue, 08 Mar 2022 18:10:55 -0500 Received: by mail-ej1-f52.google.com with SMTP id qa43so1121770ejc.12 for <54266@debbugs.gnu.org>; Tue, 08 Mar 2022 15:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject :content-language:to:content-transfer-encoding; bh=3igOC5lXPI+hkUSIhpFB2Q6h9ZgNXSBeoDY/pOHXtKE=; b=cRsDQny2WVYTc/BT9zNr3LuZJHtvPmKBHJJLR+h8sBP2qvLfUeD/hdmJGcPl0a6ZHe g6FgJCd5X8+XNzZYYn6iiP3sr99FHL1imvLZzWaiRG26sgJotyM8kYSwbdBj36M9etgM ipgWH6M4N1TMU3iNOtYYWtymlGMW9wm475JyFzgizeXs9JDfRXb1L9fL2NQjJ5brJiHi GPS4v5iGY4gZJjc6tODUlEp7MmYCouedUZL1F+KpLTXrTkY56pBeXt1WLcYEQ+8azt0a XglNvEhR6AN5+SmhSsA69DnoI6zNNxSrizy/oGRAfgJ4zDIkhkBEwr0XP5e6rgwGnwiq maOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:content-language:to:content-transfer-encoding; bh=3igOC5lXPI+hkUSIhpFB2Q6h9ZgNXSBeoDY/pOHXtKE=; b=i3fNiiKb5KwWXLLz3DHVd/flSnyQfMnPbJksN0jtHBY8O52ivzJYwjG4713jGui97H GwpXQ6TLf1cc7lTdGbM0Ah37YOHXy75MJ/B3NzbtI7o5qwHDSEaTAqxyQz7rbkcpieuP tZRg6zomk5DQDUQ7lLg/FBs42Ww26TjpH3MRKFRBuaR8TRUHfyClHiVeyB7x79SwgMki sVWSTcQ5U2tuhmwZFVnFXVctVtoB2+ULsGkujUi3ah33s5RXQdjuXty4M2sxZz83td2k tm0etQswVmLmWc9kVJ627m6pm271BNdgfiLLXNK+cl77DSgiEHcw51grD1hTlhyQ4aF3 MeWA== X-Gm-Message-State: AOAM5316e36Dglb74xAeq29BYl0qsUD/FOBsKDFVU/vWW+CoKim8FORG 92nF3Y20O3ixnIkIsIy6VC9sXL6CoLc= X-Google-Smtp-Source: ABdhPJwgKK7we6VG2N3NO5NjSFHEw6+3CzX8Rz27tPPFOgOiyeBS7G1TElUNkPyMfLAvqYLEq6EL3g== X-Received: by 2002:a17:907:8a04:b0:6cd:2902:8db3 with SMTP id sc4-20020a1709078a0400b006cd29028db3mr15504503ejc.530.1646781049480; Tue, 08 Mar 2022 15:10:49 -0800 (PST) Received: from ?IPV6:2003:ee:af2f:e00:c2f9:c2bb:bf95:1fc5? (p200300eeaf2f0e00c2f9c2bbbf951fc5.dip0.t-ipconnect.de. [2003:ee:af2f:e00:c2f9:c2bb:bf95:1fc5]) by smtp.gmail.com with ESMTPSA id q22-20020a170906771600b006cf8a37ebf5sm54047ejm.103.2022.03.08.15.10.48 for <54266@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 15:10:49 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 00:10:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: fesoj000 Content-Language: en-US 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" X-getmail-retrieved-from-mailbox: Patches Tools like samba-tool need the python libraries installed by samba and some of sambas inputs. * gnu/packages/samba.scm: new buildstep (samba)[wrap-scripts]: Add build step. --- gnu/packages/samba.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index b775ad905c..cb34fd8c2c 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -40,6 +40,7 @@ (define-module (gnu packages samba) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) #:use-module (gnu packages crypto) #:use-module (gnu packages cups) @@ -195,6 +196,10 @@ (define-public samba (arguments (list #:make-flags #~(list "TEST_OPTIONS=--quick") ;some tests are very long + #:imported-modules `((guix build python-build-system) + ,@%gnu-build-system-modules) + #:modules `(((guix build python-build-system) #:select (python-version)) + ,@%gnu-build-system-modules) #:phases #~(modify-phases %standard-phases (add-before 'configure 'setup-docbook-stylesheets @@ -231,12 +236,35 @@ (define-public samba (add-before 'install 'disable-etc,var-samba-directories-setup (lambda _ (substitute* "dynconfig/wscript" - (("bld\\.INSTALL_DIR.*") ""))))) + (("bld\\.INSTALL_DIR.*") "")))) + (add-after 'install 'wrap-scripts + (lambda* (#:key inputs #:allow-other-keys) + (define (site-package-path python) + (string-append "/lib/python" (python-version python) + "/site-packages")) + (define (guix-pythonpath site-package-path) + (string-join + (map (lambda (input) + (string-append (assoc-ref inputs input) + site-package-path)) + '("tdb" "ldb" "talloc")) + ":")) + (for-each (lambda (file) + (wrap-program (string-append #$output file) + `("GUIX_PYTHONPATH" = + (,(guix-pythonpath + (site-package-path + (assoc-ref inputs "python"))))))) + '("/bin/samba-tool" "/sbin/samba_dnsupdate" + "/sbin/samba_downgrade_db" "/sbin/samba-gpupdate" + "/sbin/samba_kcc" "/sbin/samba_spnupdate" + "/sbin/samba_upgradedns"))))) ;; FIXME: The test suite seemingly hangs after failing to provision the ;; test environment. #:tests? #f)) (inputs (list acl + bash-minimal cmocka cups gamin