From patchwork Tue Mar 8 22:01:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: fesoj000 X-Patchwork-Id: 37692 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 5A2FB27BBEA; Tue, 8 Mar 2022 22:08:28 +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 D8F3E27BBE9 for ; Tue, 8 Mar 2022 22:08:27 +0000 (GMT) Received: from localhost ([::1]:46966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRi0J-0005rW-1N for patchwork@mira.cbaines.net; Tue, 08 Mar 2022 17:08:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRhv5-000615-Rp for guix-patches@gnu.org; Tue, 08 Mar 2022 17:03:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRhv3-0005Y0-US for guix-patches@gnu.org; Tue, 08 Mar 2022 17:03:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRhv3-0002LJ-KP for guix-patches@gnu.org; Tue, 08 Mar 2022 17:03:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54266] [PATCH] samba: wrap scripts with GUIX_PYTHONPATH Resent-From: fesoj000 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 22:03:01 +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: Maxime Devos , 54266@debbugs.gnu.org Received: via spool by 54266-submit@debbugs.gnu.org id=B54266.16467769298938 (code B ref 54266); Tue, 08 Mar 2022 22:03:01 +0000 Received: (at 54266) by debbugs.gnu.org; 8 Mar 2022 22:02:09 +0000 Received: from localhost ([127.0.0.1]:58056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRhuD-0002K5-9B for submit@debbugs.gnu.org; Tue, 08 Mar 2022 17:02:09 -0500 Received: from mail-ed1-f41.google.com ([209.85.208.41]:44595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRhuB-0002Je-Cf for 54266@debbugs.gnu.org; Tue, 08 Mar 2022 17:02:08 -0500 Received: by mail-ed1-f41.google.com with SMTP id x5so472452edd.11 for <54266@debbugs.gnu.org>; Tue, 08 Mar 2022 14:02:07 -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:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=NRze/7pQWThkDVecAbChFy2pdkP7ILUH/jT+rTPv80k=; b=NaPL0q7tD6WCfY/Z52QjbEUvdCPKpnI+OMhwGgYRom6ZKhjA210k3mu+NbdYiqg+y0 FYRcX49Xrui480tUjFPluz49TeQ5v3cfsvFcw8PZ7Rs96nV4EhlfIXSetn0wvcplBsOO YYMTfYsJ6cFstaPGSWSBpE2w9lut07sI72iOUNnEap/gyaO0huMe57h4vBb3JwwZJqqf b6f2TC+mWEQDrH+x+nIxHIFIQTOhqSlhp3+/Op1c8sA7uN84Xqg8K41ybvR77mNAkztf 2UY4wxY9EN2jc6Od3DDDT/0HBSbkN28lBMY/btY7W0ZPKm9NLtO/KD1SG53GpoVsccW/ tbNQ== 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:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=NRze/7pQWThkDVecAbChFy2pdkP7ILUH/jT+rTPv80k=; b=rU+n3FpuIa86pBsHr8YvzsZ1NqdS/T2ApR+q8mBEmxLGkaZ6iy2OQwhPjGyzqqpyjJ Uq9h0uVdiAViNByI3J8kVAX4MEIRJYBEV+Zh/Ooa/t5XPHB2piPKdPho88m1j1LWYNLI dARyQjxtKY9lgDnbehBdzCyeGXfXK2NQ2+qjEdkikuoU+futBeEZmujED2WYyn2BO6ax hc+re22R2orS66zAVxr7Z9YaaKxwKHlQo9xx2et7amK79ObHV8yS2c/gxQ6kKlO5VZdx kZQiI/9gR2H1Mzvhn1CyAjcvxdb3SmKGd6qi0j91lDA1CmK438OdxORofGvfNA+r9FOo U9qQ== X-Gm-Message-State: AOAM531nB8vAOaH11bAADkWocqYd+/Fvkeat7ysrGk6e4Bl8kN+JhUs1 +jjNstDby9fsy3J1pCUjdcs= X-Google-Smtp-Source: ABdhPJywRiMu7c+N1Zvj87/tmPvrC0b1vjdUfVVM9i33OX8B61Npgflc115K7/JauidXfDFG+vu+xA== X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr18630758edj.35.1646776921287; Tue, 08 Mar 2022 14:02:01 -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 17-20020a170906059100b006cee1bceddasm9359ejn.130.2022.03.08.14.02.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 14:02:00 -0800 (PST) Message-ID: <7a858578-21af-828c-20ab-e0683a7b78c2@gmail.com> Date: Tue, 8 Mar 2022 23:01:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US References: <50be1b85-e682-d910-970c-14a08275278f@gmail.com> From: fesoj000 In-Reply-To: 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 On 3/8/22 9:39 PM, Maxime Devos wrote: > fesoj000 schreef op di 08-03-2022 om 20:26 [+0100]: >> -     (list >> -      #:make-flags #~(list "TEST_OPTIONS=--quick") ;some tests are very long >> -      #:phases >> -      #~(modify-phases %standard-phases >> +     `(#:make-flags '("TEST_OPTIONS=--quick") ;some tests are very long > > What's the reason for turning things from G-exps into S-exps? Good question, here is the gexp version. diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index b775ad905c..c4457cc11e 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,36 @@ (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 + (append (map (lambda (input) + (string-append (assoc-ref inputs input) + site-package-path)) + '("tdb" "ldb" "talloc")) + (list (string-append #$output site-package-path))) + ":")) + (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