From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SIeWF2LBAGS9SAEAbAwnHQ (envelope-from ) for ; Thu, 02 Mar 2023 16:31:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WFWQF2LBAGQlNQAAauVa8A (envelope-from ) for ; Thu, 02 Mar 2023 16:31:46 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E745D326E8 for ; Thu, 2 Mar 2023 16:31:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXktm-0001Zl-29; Thu, 02 Mar 2023 10:31:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXkth-0001YN-Hj for help-guix@gnu.org; Thu, 02 Mar 2023 10:31:10 -0500 Received: from knopi.disroot.org ([178.21.23.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXktb-00013H-Ej for help-guix@gnu.org; Thu, 02 Mar 2023 10:31:07 -0500 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3F13344444; Thu, 2 Mar 2023 16:31:00 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qs8srcybqUKf; Thu, 2 Mar 2023 16:30:58 +0100 (CET) References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1677771058; bh=O5MK19NbpbsbmKOlic6sAuvTSk1dOztgqMC8iLd57Ag=; h=References:Date:From:To:Cc:Subject:In-reply-to; b=k88BzqOxN0L/IbIZhxBsYrfFIJ8+bKs4v9LTY8wc3tFJoelLkru5XG86UMrTGTqGU TxtJw+VqZcFqeh4FpZdenBq6IK8CgK2W62h5pjm6oPRKOsOPCy1L/MFdq4NMKWZIsj 3VQQZgqPVcJM/mDHF9mvnoUUtrB/D0gcqvlr2PWV7vatPbu76DNrN2fJfNQ28UQzrG liqvPDYfhEfTSNngP0+3H3j2j/e+y8GF1ZFOcDNq5OSVtrS7+aPg89YkpyDQkNWzjV uq7XNlk39G6QhXnIPBXvaxrPLG0ZKDhLWPad/o3Zbz0U7qsci8Cu6wNMM0CzLjusez D8mD1Pnpkae8w== Date: Thu, 02 Mar 2023 10:10:38 -0500 From: Gary Johnson To: Rodrigo Morales Cc: help-guix@gnu.org Subject: Re: Newbie user: Feedback on custom package definition In-reply-to: Message-ID: <87sfen9nma.fsf@disroot.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=178.21.23.139; envelope-from=lambdatronic@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677771106; a=rsa-sha256; cv=none; b=IkGOiqE5BgxypKgSNiMDAdrRFHnJNnSw/Z0NxXOMNT6kwiXvvCA5J+OgBjETkUB/gmi7WO 3Dt4mpwGsycoAkk3DtqcZmJ0hBGUZAlCbNXBcw+oI97iQ3cIcKb/QUF9VCtVHScdOlscOl /Fzqu49f2qGblj603mA7LMwVJTqqvOdLvzQ5wT7Zx0XSd9nLvogQDGoa/5uwB9weS7at7Q sabR0FQmDCfqfOFXlrn0AFvI3v3NrODy2Dr4xTQibFa/M9xwR5bp1L5H9f/tGFV2tvG1ia KyMMtQ2FmVWhJ9jAgf/jpEqhLid3EAifBRW6mb92BJJ8dNNbOzhBfZLlS6UgcQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=k88BzqOx; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677771106; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=qZHcVwZR8yGVwezw+GkSK9+RW1LMwoSdYxG6TKaPY3U=; b=ByeKazIjxjCs7U3FaICRzHX/I1F5td4pohAEQqb9bKfSv69c3bhlRPhCtK9NQNBwTHPwhr SXyuYrml6spKmdpU1+gjGhAr7INCX0IbXzTEn4aC57mce+V/CeUaZ5ot7udu2rSyt3lvQh fKoFGj1cyYTnNoeJQE4JlyE+UC8KZUqWV7wtxFcNeY4lt77fP5flZaTUmHGpyGrEg9q7J+ zIqkOMhUs1IxfWAbKSI/fK4I6Uhv9/dldXv+xRSTGGwcYcStGZAGymZqn7OjXBgS4I+4Oq mT2Yvq3e+RMAL7hx7YbcfKXMqTyuEQRTOxqvfaZL1bY0jvK0Ca9uZrGazgEmIw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.41 X-Spam-Score: -6.41 X-Migadu-Queue-Id: E745D326E8 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=k88BzqOx; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=disroot.org X-TUID: X/ioUW8z44Ks 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 (package (name "emacs-vcard") (version "0.2.1") (source (origin (method url-fetch) (uri (string-append "https://elpa.gnu.org/packages/vcard-" version ".tar")) (sha256 (base32 "0nfrh1mz2h7h259kf7sj13z30kmjywfvs83ax5qjkfwxhqm03abf")))) (build-system emacs-build-system) (home-page "https://elpa.gnu.org/packages/vcard.html") (synopsis "Package for handling vCard files") (description "This file contains `vcard-mode', for viewing vCard files. Other files in this 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: - EMACSLOADPATH - EMACSNATIVELOADPATH > + 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))) (specifications->manifest (list "emacs" "emacs-adoc-mode" "emacs-alsamixer-el" "emacs-async" "emacs-calibredb" "emacs-cider" "emacs-clojure-mode" "emacs-company" "emacs-crdt" "emacs-csv-mode" "emacs-elpher" "emacs-emms" "emacs-eww-lnum" "emacs-exwm" "emacs-flycheck" "emacs-flymake-kondor" "emacs-flyspell-correct" "emacs-forge" "emacs-geiser" "emacs-geiser-guile" "emacs-gnuplot" "emacs-google-translate" "emacs-helm" "emacs-helm-ag" "emacs-helm-descbinds" "emacs-helm-swoop" "emacs-htmlize" "emacs-magit" "emacs-markdown-mode" "emacs-nov-el" "emacs-ob-async" "emacs-org" "emacs-org-pomodoro" "emacs-ox-gfm" "emacs-paredit" "emacs-pdf-tools" "emacs-pinentry" "emacs-rjsx-mode" "emacs-shroud" "emacs-telephone-line" "emacs-treemacs" "emacs-vterm" "emacs-web-mode" "emacs-which-key" "mu")) ``` 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 command: ``` 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! ~Gary -- Protect yourself from surveillance: https://emailselfdefense.fsf.org ======================================================================= () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments Why is HTML email a security nightmare? See https://useplaintext.email/ Please avoid sending me MS-Office attachments. See http://www.gnu.org/philosophy/no-word-attachments.html