[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defining package variants automatically
From: |
Ludovic Courtès |
Subject: |
Re: defining package variants automatically |
Date: |
Tue, 24 Sep 2019 18:06:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Ricardo Wurmus <address@hidden> 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’d need ‘resolve-interface’ here, or a call to
‘module-export!’.
But… it’s evil! :-)
Ludo’.