From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.help Subject: Use package-vc.el for declarative, source-based package management? Date: Mon, 15 Apr 2024 09:51:32 +0000 Message-ID: <87plurnecb.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11435"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 11:52:21 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rwJ0e-0002p3-JI for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 11:52:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwJ06-0000H9-SO; Mon, 15 Apr 2024 05:51:46 -0400 Original-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 1rwJ05-0000H1-Pv for help-gnu-emacs@gnu.org; Mon, 15 Apr 2024 05:51:45 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwJ03-00084m-Ca for help-gnu-emacs@gnu.org; Mon, 15 Apr 2024 05:51:45 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AD43F240104 for ; Mon, 15 Apr 2024 11:51:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1713174699; bh=zJlhkAPkDrNygJotStkBPwRqHaS7X/hPz7TkDjbbNyY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=kmogVY8oZ0CAcYHqY3lPi324GalXbc8HRBMk1fBW+NBKaOfl50ybWmAUUCc3zi7r8 ZCgT4dLGiCeFmLDYCaLLaETWnW6eTSoHy0gKloB++/c4Hph+40dxiVb8Ugj5UZaHnA frwZtknUp1zzeVybtY1+GYTT6HbFXJqzzH74IomP8AxokQef/DHevFmUXmgzGV4B0N fD30HOLJXZw+a0M6X+jiGmSJMhcxJFkr5NPNpfxOfN/bl8glpcIRvY606NISd7G3tY uYiJpZqjzatDcwNffk48KGYLr4j+Qv3s5dzo6bQDL/ThXIw5WEh/OG0tw8J+JBHB2A xeZL0WQbTe4fg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VJ2WG5Wnwz9rxV; Mon, 15 Apr 2024 11:51:38 +0200 (CEST) Received-SPF: pass client-ip=185.67.36.66; envelope-from=mekeor@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146327 Archived-At: Hello :) I'm trying to use Emacs' built-in package-vc.el for an opinionated way of declarative, source-based package management. I use Emacs from master branch and I would like to use some Elpa-packages from their respective development branch too. I also want local checkouts of their repositories so that I can quickly contribute to them. And I do not want to use Emacs' built-in use-package.el. Ideally, my init.el would begin like this: ;; Here, I'd maintain a list of packages that I want to be installed: (setopt package-vc-...-list-of-packages '(consult embark vertico)) ;; Then I'd instruct package-vc.el to ensure that these packages are ;; installed, i.e. install missing packages with local repo ;; checkouts: (package-vc-...-ensure) But so far, I was only able to approximate this ideal with several caveats in my init.el, as follows. First, I load relevant modules. (require 'package) (require 'package-vc) Here I maintain a list of packages that I want to be installed. (setopt package-vc-selected-packages '( (consult :url "https://github.com/minad/consult.git") (embark :url "https://github.com/oantolin/embark.git" :ignored-files ("embark-consult.el" "avy-embark-collect.el")) (vertico :url "https://github.com/minad/vertico.git") (vertico-buffer :url "https://github.com/minad/vertico.git" :lisp-dir "extensions" :main-file "vertico-buffer.el"))) As you can see, one caveat is that I need to specify :url, :lisp-dir and similar values manually. Can I gather these somehow automatically instead? Another caveat is that some repositories, like Vertico's, contain multiple packages, like vertico-buffer. Can I avoid having multiple local checkouts of the same repository (while still keeping all (sub)packages marked as installed)? Now, I'd like to ensure that these packages are installed. But if I put (package-vc-install-selected-packages) in my init.el, Emacs interactively asks me "Overwrite previous checkout for package `consult'? (yes or no)" during startup. That's why I currently evaluate that s-expression manually whenever I change the value of package-vc-selected-packages. Is there a way to to make package-vc-install-selected-packages (1.) not ask anything interactively; and (2.) simply not overwrite already installed packages; and (3.) still install packages that not yet installed? After having ensured that packages are installed, the following initializes load-path: (package-initialize) There's another problem though: When I put a package foo in package-vc-selected-packages, and foo depends on another external package bar, and I have not put bar in -selected-packages, and I call package-vc-install-selected-packages, then Emacs will try to install to install bar from a package-archive without any local repository checkout but rather in the usual package.el way. That's why I also have this setting in my init.el: (setopt package-archives nil) This forces package.el to fail when I forgot to list a dependency in -selected-packages variable. As an unfortunate consequence, I also end up doing dependency management manually. But I'd love to have dependencies vc-installed too! Thus this question arises: Is there a way to tell package-vc-install-selected-packages to vc-install the selected packages *including* their dependencies?