From patchwork Sun Aug 23 20:45:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 23747 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 11CBC27BBE6; Sun, 23 Aug 2020 21:47:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id AEEAA27BBE5 for ; Sun, 23 Aug 2020 21:47:07 +0100 (BST) Received: from localhost ([::1]:59008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9wtP-0005WW-98 for patchwork@mira.cbaines.net; Sun, 23 Aug 2020 16:47:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9wtK-0005WM-DP for guix-patches@gnu.org; Sun, 23 Aug 2020 16:47:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9wtK-0003jj-4a for guix-patches@gnu.org; Sun, 23 Aug 2020 16:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k9wtK-0000q6-2a for guix-patches@gnu.org; Sun, 23 Aug 2020 16:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42899] [PATCH v2 02/10] gnu: dovecot: Patch and provide a static path for module directory. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 23 Aug 2020 20:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42899 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Alexey Abramov Cc: 42899@debbugs.gnu.org Received: via spool by 42899-submit@debbugs.gnu.org id=B42899.15982155763170 (code B ref 42899); Sun, 23 Aug 2020 20:47:02 +0000 Received: (at 42899) by debbugs.gnu.org; 23 Aug 2020 20:46:16 +0000 Received: from localhost ([127.0.0.1]:55191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9wsZ-0000p4-K1 for submit@debbugs.gnu.org; Sun, 23 Aug 2020 16:46:15 -0400 Received: from flashner.co.il ([178.62.234.194]:34356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9wsY-0000oq-9g for 42899@debbugs.gnu.org; Sun, 23 Aug 2020 16:46:15 -0400 Received: from localhost (unknown [31.210.181.177]) by flashner.co.il (Postfix) with ESMTPSA id AFBE740131; Sun, 23 Aug 2020 20:46:07 +0000 (UTC) Date: Sun, 23 Aug 2020 23:45:35 +0300 From: Efraim Flashner Message-ID: <20200823204535.GA1392@E5400> References: <20200818120037.30722-1-levenson@mmer.org> <20200818120037.30722-2-levenson@mmer.org> <20200819074132.GE10528@E5400> <87lfib2cnf.fsf@mmer.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87lfib2cnf.fsf@mmer.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 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 Wed, Aug 19, 2020 at 11:44:20AM +0200, Alexey Abramov wrote: > Hi, > > Efraim Flashner writes: > > > How are all the XXX_MODULE_DIR variables set? Would it be possible to > > just set MODULE_DIR to /etc/dovecot/modules and leave the others as-is? > > They seem to just use a file/folder under MODULE_DIR. > > They set during compilation time. If I pass it as a configuration option, dovecot will try to install libraries there which won't work. This was enough to jog my memory that we have a couple of packages (with services) that have configure flags for one directory and install to %outputs as expected. I came up with the attached patch to make that happen. > > For example: > > --8<---------------cut here---------------start------------->8--- > -*- mode: rg; default-directory: "~/factory/dovecot/" -*- > rg started at Wed Aug 19 10:35:00 > > /gnu/store/cxy9n8aic4c9zd0r372m6b6yzw3dhcyl-ripgrep-12.1.1/bin/rg --color always --colors match:fg:red -n --type-add gn\:\*.gn --type-add gn\:\*.gni --type-add gyp\:\*.gyp --type-add gyp\:\*.gypi --no-heading --type all -e AUTH_MODULE_DIR > > src/auth/Makefile.am:42: -DAUTH_MODULE_DIR=\""$(auth_moduledir)"\" \ > src/auth/main.c:195: modules = module_dir_load(AUTH_MODULE_DIR, NULL, &mod_set); > src/auth/main.c:226: modules = module_dir_load_missing(modules, AUTH_MODULE_DIR, names, > src/doveadm/doveadm-pw.c:40: modules = module_dir_load_missing(modules, AUTH_MODULE_DIR, NULL, &mod_set); > src/doveadm/Makefile.am:28: -DAUTH_MODULE_DIR=\""$(moduledir)/auth"\" \ > > rg finished (5 matches found) at Wed Aug 19 10:35:00 > --8<---------------cut here---------------end--------------->8--- > > --8<---------------cut here---------------start------------->8--- > -*- mode: rg; default-directory: "~/factory/dovecot/" -*- > rg started at Wed Aug 19 11:33:25 > > /gnu/store/cxy9n8aic4c9zd0r372m6b6yzw3dhcyl-ripgrep-12.1.1/bin/rg --color always --colors match:fg:red -n --type-add gn\:\*.gn --type-add gn\:\*.gni --type-add gyp\:\*.gyp --type-add gyp\:\*.gypi --no-heading --type all -e DOVEADM_MODULEDIR > > src/doveadm/doveadm-util.c:36: modules = module_dir_load_missing(modules, DOVEADM_MODULEDIR, > src/doveadm/doveadm-util.c:61: dir = opendir(DOVEADM_MODULEDIR); > src/doveadm/Makefile.am:29: -DDOVEADM_MODULEDIR=\""$(doveadm_moduledir)"\" \ > > rg finished (3 matches found) at Wed Aug 19 11:33:25 > --8<---------------cut here---------------end--------------->8--- > > -- > Alexey diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 01ba9dc057..d3d1bda1b6 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -1442,7 +1442,8 @@ facilities for checking incoming mail.") `(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var" "--with-sqlite" ; not auto-detected - "--with-lucene") + "--with-lucene" + "--with-moduledir=/etc/dovecot/modules") #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-file-names @@ -1459,9 +1460,13 @@ facilities for checking incoming mail.") (("cat") (which "cat"))) #t)) (replace 'install - (lambda* (#:key make-flags #:allow-other-keys) + (lambda* (#:key outputs make-flags #:allow-other-keys) + ;; The .la files don't like having the moduledir moved. + (for-each delete-file (find-files "." "\\.la")) ;; Simple hack to avoid installing a trivial README in /etc. (apply invoke "make" "install" "sysconfdir=/tmp/bogus" + (string-append "moduledir=" (assoc-ref outputs "out") + "/lib/dovecot") make-flags)))))) (home-page "https://www.dovecot.org") (synopsis "Secure POP3/IMAP server")