[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie user: Feedback on custom package definition

From: Gary Johnson
Subject: Re: Newbie user: Feedback on custom package definition
Date: Thu, 02 Mar 2023 10:10:38 -0500

Rodrigo Morales <> writes:

> 8<-----------------------------------
> 8<    ...Text elided...
> 8<-----------------------------------
> 3 The questions
> ===============
>   + What changes would you do to improve the definition of the package
>     that I wrote?

Whenever possible, you should not be using the `trivial-build-system`.
Guix comes with a wealth of built-in build systems that will take care
of building and installing packages written in many different languages.
For Emacs Lisp packages, you should use the `emacs-build-system`. Here
is an example:

(define-public emacs-vcard
   (name "emacs-vcard")
   (version "0.2.1")
     (method url-fetch)
     (uri (string-append
      (base32 "0nfrh1mz2h7h259kf7sj13z30kmjywfvs83ax5qjkfwxhqm03abf"))))
   (build-system emacs-build-system)
   (home-page "";)
   (synopsis "Package for handling vCard files")
    "This file contains `vcard-mode', for viewing vCard files.  Other files in 
package contain functions for parsing and writing vCard data.")
   (license gpl3+)))

This will download and validate the source, build the package, install
it under /gnu/store, and symlink it into the profile that you installed
it into. It will take care of adding these directories to these
environment variables, which ensure that Emacs can require them later:


>   + Do you manage your Emacs packages with GUIX? Could you briefly
>     describe your workflow or point me to references/documentation?

I do manage all of my Emacs packages with Guix. I list `emacs` and all
of its packages in a manifest file (emacs.scm). It looks like this with
my custom packages elided:

(use-modules ((gnu packages) #:select (specifications->manifest)))

 (list "emacs"

I actually split up all the user packages on my system into manifests
and isntall each one into its own profile, which I then activate on
startup. However, that's not really necessary for this example. You can
install the manifest packages above into your user profile with this

guix package -m emacs.scm

If you want to include packages that you wrote yourself, you can either
add them to your GUIX_PACKAGE_PATH environment variable or you can
create your own Guix channel, add it to your ~/.config/guix/channels.scm
file, and run `guix pull`.

To get help in writing new Guix packages for Emacs, try out the `guix
import elpa` command like so:

guix import elpa --archive=melpa gemini-mode

Alright. That's it for now. Good luck and happy hacking!


Protect yourself from surveillance:
()  ascii ribbon campaign - against html e-mail
/\   - against proprietary attachments

Why is HTML email a security nightmare? See

Please avoid sending me MS-Office attachments.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]