From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: defining package variants automatically Date: Tue, 24 Sep 2019 18:06:03 +0200 Message-ID: <87y2ydof10.fsf@gnu.org> References: <87v9u3u3f6.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCnKO-0000MT-Bw for help-guix@gnu.org; Tue, 24 Sep 2019 12:06:14 -0400 In-Reply-To: <87v9u3u3f6.fsf@elephly.net> (Ricardo Wurmus's message of "Sun, 08 Sep 2019 00:50:21 +0200") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Ricardo Wurmus Cc: help-guix@gnu.org Ricardo Wurmus skribis: > (define-module (gnu packages emacs-custom) > #:use-module (guix packages) > #:use-module (guix utils) > #:use-module (gnu packages) > #:use-module (gnu packages emacs) > #:use-module (gnu packages emacs-xyz) > #:use-module (guix build-system emacs)) > > (define my-custom-emacs emacs-no-x) ; just a test > > (define package-with-my-emacs > (package-mapping > (lambda (pkg) > (package > (inherit pkg) > (name (string-append (package-name pkg) "-rekado")) > (arguments > (substitute-keyword-arguments (package-arguments pkg) > ((#:emacs _ '()) > my-custom-emacs))))) > (lambda (pkg) > (eq? emacs-build-system (package-build-system pkg))))) > > (fold-packages (lambda (pkg result) > (let ((variable-name > (string->symbol (string-append (package-name pkg)= "-rekado")))) > (module-define! > (resolve-module '(gnu packages emacs-custom)) I suspect you=E2=80=99d need =E2=80=98resolve-interface=E2=80=99 here, or a= call to =E2=80=98module-export!=E2=80=99. But=E2=80=A6 it=E2=80=99s evil! :-) Ludo=E2=80=99.