From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QJ6qMCmuJ2LumQAAgWs5BA (envelope-from ) for ; Tue, 08 Mar 2022 20:27:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UN8RLSmuJ2K/YAEAauVa8A (envelope-from ) for ; Tue, 08 Mar 2022 20:27:37 +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 57C7B47E90 for ; Tue, 8 Mar 2022 20:27:37 +0100 (CET) Received: from localhost ([::1]:58944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRfUe-0002wT-4N for larch@yhetil.org; Tue, 08 Mar 2022 14:27:36 -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 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646767657; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=/LZ5fqFhSy0M59DB+xjUA3OQbQbQu18bj0Onu8Rrh50=; b=NnliSbU5yZAMn3qFI8J9/kuq6qFl1rDeHurGHb4zbFax0B+nXSEyPqGKMDSL0PX/B3t2zo saVfQnla7onmYbk0KoBkRCL8vGFW1WWJjOXsKH9AMud8966ZDn/WK0Q8IXoXdmOgIKhNfK SmGjwSA3qEt1MTj/X7+DuhE9ifqb7UA8QN2DFFl/IeJmw6la8b4Cy/ioqu+h8ar9hefypv 3zYJkvc1WV/tiJrN1fjbwPoXXBPLSITrgVtIyWy8p1golgfP9YUUxsyf3Qn1CLta/Z3Alw Uygv9SIfPV2JRlPB0eVzGSlJo7qBH6OfDDWkZRmX91B6oooX82ONRc9dTpM7mw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646767657; a=rsa-sha256; cv=none; b=F0gzrmQHHFdgDITxuNDZvAz3E4W3JQzo41+8CJGQ8k4MZSuyP+4WVXgBgDUpxsyusa99Op fLF7n7q6/DFmtem1ioxVcL2NKi9VgaiYBiKs6U++H/aQacq1VowbUBhUNKv1rjrOR5kEh6 oxrW+qnIe7ag+2bcf2WW2PTwyC1JmTZ+f8q9++/JfIk39mvSOiKmExBcGo78paRT0ffOSn JHaKeUzWtd6nsTTjW+gnwY2HhxerZGzNLf8VwsJqhgZshKwmByVPbhfC6cXbCOZmFSvkNs oKicrEOSwgYgUrVKvAt1Hfc0X5JT3YWR7DpQQVP3A0GaeidTHmXfDtTHQ3h0NQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PGdIHYbe; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 5.38 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PGdIHYbe; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: 57C7B47E90 X-Spam-Score: 5.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: ee8MBZK3QAtn 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 -- 2.34.0