all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rodrigo Morales <moralesrodrigo1100@gmail.com>
To: help-guix@gnu.org
Subject: Newbie user: Feedback on custom package definition
Date: Tue, 28 Feb 2023 17:06:29 -0500	[thread overview]
Message-ID: <CAGxMbPZEpgzbT4PMU3xVtFJuQ1MtnLSRK2JmZ8DfKAJ0W46gDQ@mail.gmail.com> (raw)

Table of Contents
_________________

1. The context
2. The package I wrote
3. The questions


1 The context
=============

  Newbie user here. I'm learning how to write my own Guix packages. I've
  written the following package (please see next section). I have been
  able to successfully install it. However, I'm opening this thread so
  that any of you could give me some feedback as I'm not experienced
  with defining packages.

  I'm aware of Emacs being able to download packages from repositories
  through the functions defined in `package.el'. However, that package
  is not available neither in ELPA nor MELPA, so I thought defining a
  GUIX package for it would come in handy.


2 The package I wrote
=====================

  ,----
  | (define-module (my-simple-package)
  |   #:use-module (guix licenses)
  |   #:use-module (guix packages)
  |   #:use-module (guix gexp)
  |   #:use-module (guix build-system trivial)
  |   #:use-module (guix git-download))
  |
  | (define-public my-simple-package-org-recoll
  |   (package
  |    (name "my-simple-package-org-recoll")
  |    (version "1.0")
  |    (source (origin
  |             (method git-fetch)
  |             (uri (git-reference
  |                   (url "https://github.com/alraban/org-recoll")
  |                   (commit "1e21fbc70b5e31b746257c12d00acba3dcc1dd5c")))
  |             (file-name (git-file-name name version))
  |             (sha256
  |              (base32
  |               "09bixzl8ky7scsahb50wwkdcz335gy257m80z9rpqqhjy6q9023c"))))
  |    (build-system trivial-build-system)
  |    (arguments
  |     (list
  |      ;; Module that defines install-file. Read "(guix) Build
  |      ;; Utilities" for more information.
  |      #:modules `((guix build utils))
  |      #:builder
  |      #~(begin
  |          (use-modules (guix build utils))
  |          (chdir (assoc-ref %build-inputs "source"))
  |          (install-file "org-recoll.el"
  |                        (string-append
  |                         #$output
  |                         "/.config/emacs/libs")))))
  |    (synopsis "My synopsis")
  |    (description "My description")
  |    (home-page "https://example.org/")
  |    (license gpl3+)))
  `----

  The package I wrote downloads an Emacs package from a git repository
  and saves it into a directory

  ,----
  | guix package -i my-simple-package-org-recoll
  | echo Exit code: $?
  `----

  ,----
  | The following package will be installed:
  |    my-simple-package-org-recoll 1.0
  |
  | substitute: updating substitutes from 'https://ci.guix.gnu.org'...
100.0%
  | substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'...
100.0%
  | The following derivations will be built:
  |   /gnu/store/zm9hs6wp6v24qy8cr27dgh6ajfixirdf-profile.drv
  |
/gnu/store/iqxb2m5lz7k0mj8gklnrxg01q5572w6w-my-simple-package-org-recoll-1.0.drv
  |
/gnu/store/a29ymip131j67wq2rhzf9lr9kidqk7fq-my-simple-package-org-recoll-1.0-checkout.drv
  |
  | building
/gnu/store/a29ymip131j67wq2rhzf9lr9kidqk7fq-my-simple-package-org-recoll-1.0-checkout.drv...
  | building
/gnu/store/iqxb2m5lz7k0mj8gklnrxg01q5572w6w-my-simple-package-org-recoll-1.0.drv...
  | building CA certificate bundle...
  | listing Emacs sub-directories...
  | building fonts directory...
  | building directory of Info manuals...
  | building profile with 2 packages...
  | Exit code: 0
  `----

  By using the following commad, we can see that the file was installed
  under my home directory

  ,----
  | find ~/.guix-profile/.config/emacs/libs
  | realpath ~/.guix-profile/.config/emacs/libs/org-recoll.el
  `----

  ,----
  | /home/rdrg/.guix-profile/.config/emacs/libs
  | /home/rdrg/.guix-profile/.config/emacs/libs/org-recoll.el
  |
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/.config/emacs/libs/org-recoll.el
  `----

  By using the following command, we can see the file structure under
  `/gnu/store'.

  ,----
  | find
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/
  `----

  ,----
  |
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/
  |
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/.config
  |
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/.config/emacs
  |
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/.config/emacs/libs
  |
/gnu/store/67sw7m0ww2jw6vz0phhxrj1fphlqc414-my-simple-package-org-recoll-1.0/.config/emacs/libs/org-recoll.el
  `----


3 The questions
===============

  + What changes would you do to improve the definition of the package
    that I wrote?
  + Do you manage your Emacs packages with GUIX? Could you briefly
    describe your workflow or point me to references/documentation?

             reply	other threads:[~2023-02-28 22:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 22:06 Rodrigo Morales [this message]
2023-03-01  1:12 ` Newbie user: Feedback on custom package definition 宋文武
2023-03-02 15:10 ` Gary Johnson
2023-03-02 18:54   ` Vagrant Cascadian
2023-03-02 19:57     ` (
2023-03-07 13:41       ` Simon Tournier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGxMbPZEpgzbT4PMU3xVtFJuQ1MtnLSRK2JmZ8DfKAJ0W46gDQ@mail.gmail.com \
    --to=moralesrodrigo1100@gmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.