From patchwork Tue Mar 8 19:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fesoj000 X-Patchwork-Id: 37690 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 DEF2927BBEA; Tue, 8 Mar 2022 19:27:36 +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 68B9327BBE9 for ; Tue, 8 Mar 2022 19:27:36 +0000 (GMT) Received: from localhost ([::1]:58944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRfUd-0002wT-Hd for patchwork@mira.cbaines.net; Tue, 08 Mar 2022 14:27:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRfU6-0002tn-1J for guix-patches@gnu.org; Tue, 08 Mar 2022 14:27:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRfU5-0005gY-Nj for guix-patches@gnu.org; Tue, 08 Mar 2022 14:27:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRfU5-0004VC-Jd for guix-patches@gnu.org; Tue, 08 Mar 2022 14:27:01 -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 19:27: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: 54266@debbugs.gnu.org Received: via spool by 54266-submit@debbugs.gnu.org id=B54266.164676759517270 (code B ref 54266); Tue, 08 Mar 2022 19:27:01 +0000 Received: (at 54266) by debbugs.gnu.org; 8 Mar 2022 19:26:35 +0000 Received: from localhost ([127.0.0.1]:57960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRfTe-0004UU-P3 for submit@debbugs.gnu.org; Tue, 08 Mar 2022 14:26:35 -0500 Received: from mail-ed1-f49.google.com ([209.85.208.49]:36454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRfTd-0004UG-3u for 54266@debbugs.gnu.org; Tue, 08 Mar 2022 14:26:33 -0500 Received: by mail-ed1-f49.google.com with SMTP id o1so50750edc.3 for <54266@debbugs.gnu.org>; Tue, 08 Mar 2022 11:26:33 -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=/LZ5fqFhSy0M59DB+xjUA3OQbQbQu18bj0Onu8Rrh50=; b=PGdIHYbeYGx7ccKEip1A9R959KAvkPpgf0iCApcfwFDwwUQ3O8txM47CIqb2G+SBT8 /PI9ry+o3HMF4TRQ6UPNFLiodaeqp0TbyjmffWS7ta9AWwI0s1m8jxvkegdTAC7Qovyx 5ULnS+jPVtx/7HcM3UtcKRBLDzkuQUGvLbnPzuuwwE8dZDKzuHesnF53QxXQdtFZg8G5 uLjCG15hpimgFp2mrWFoWbXgeSmTX0dsuEDp2C2AGPth9cGzjN5TKORoQbIu6wYjnTzX XNVKB/53kt1kHk/jfliwS6hNrvBFZ480fZvhpo0pkDaxGNpzDh8q0PDnJsb8E9lz2chp RrxQ== 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=/LZ5fqFhSy0M59DB+xjUA3OQbQbQu18bj0Onu8Rrh50=; b=4j0Dy9yyO+0KStEYuYgFt1nru1MLYQtC4NZBLDhgc6Ws30m++1zPUyCsD/xJgMYDDK d2CGrx56VclEp2i6I/kbJGF5pyEVgtOVwDP6mCsNwBkneCWkfYAAkloBmR6Pm4GaBC+H 3IQYL3O0dM8JPU6XrDhyRXnnCBLuzOrL9S2c2TvxKc0AlFFPQrTOj9+9VG+Cp9IhQw5j KLN99/nW8GKVZvvIP/43h09epTtVG+D7AJGWT47bFiuIrtt8wC9shPTPCoR0h6CSk1tg mlek73DIFlUqscFohYs8XAsxUvjOl8JWNAfuR+aOR9+AVF+oGPxwhWXNwvJ1BUQ/aCid cjzw== X-Gm-Message-State: AOAM530sMwcDFInITDSm3ckD0wJIXZarmH36+fDq5d8QixYMs0nO5SOj DRLbc1nR5rWefwqoky8knAPqOMxgogg= X-Google-Smtp-Source: ABdhPJy4AljybrXWnwgn3qFlK85J9zjuTAVknrLkNA62SNwxNvLbX71WOjqdaPBOWyhlHqOSslWzxw== X-Received: by 2002:a05:6402:254b:b0:412:d172:2607 with SMTP id l11-20020a056402254b00b00412d1722607mr17624677edb.80.1646767587237; Tue, 08 Mar 2022 11:26:27 -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 o14-20020a170906774e00b006d5b915f27dsm6231230ejn.169.2022.03.08.11.26.26 for <54266@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 11:26:26 -0800 (PST) Message-ID: Date: Tue, 8 Mar 2022 20:26:24 +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 | 46 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index b775ad905c..2bdf89163e 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) @@ -193,10 +194,13 @@ (define-public samba (base32 "0zyid2np45kl8hzp9fjqwvn5lxj766a4f0mya58vldqrhcrmw4b9")))) (build-system gnu-build-system) (arguments - (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 + #: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 (lambda* (#:key inputs #:allow-other-keys) ;; Append Samba's own DTDs to XML_CATALOG_FILES @@ -212,12 +216,13 @@ (define-public samba (string-append all " $XML_CATALOG_FILES"))))) (replace 'configure ;; Samba uses a custom configuration script that runs WAF. - (lambda* (#:key inputs #:allow-other-keys) - (let* ((libdir (string-append #$output "/lib"))) + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (libdir (string-append out "/lib"))) (invoke "./configure" "--enable-selftest" "--enable-fhs" - (string-append "--prefix=" #$output) + (string-append "--prefix=" out) "--sysconfdir=/etc" "--localstatedir=/var" ;; Install public and private libraries into @@ -231,12 +236,37 @@ (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 outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (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 out site-package-path))) + ":")) + (for-each (lambda (file) + (wrap-program (string-append out 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