From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Installing binaries with package.el Date: Tue, 07 Feb 2017 11:05:23 -0500 Message-ID: References: <3fdcbe78-969e-f9e1-2a9d-a5f8494c35b3@mit.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486483718 25938 195.159.176.226 (7 Feb 2017 16:08:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2017 16:08:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 17:08:35 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb8Jm-0006Vc-NU for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2017 17:08:34 +0100 Original-Received: from localhost ([::1]:55088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cb8Js-0002l9-7H for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2017 11:08:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cb8Gv-0001Hz-0g for emacs-devel@gnu.org; Tue, 07 Feb 2017 11:05:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cb8Gq-0001po-1Q for emacs-devel@gnu.org; Tue, 07 Feb 2017 11:05:36 -0500 Original-Received: from [195.159.176.226] (port=38505 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cb8Gp-0001oy-SL for emacs-devel@gnu.org; Tue, 07 Feb 2017 11:05:31 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cb8Gi-0007EC-Ce for emacs-devel@gnu.org; Tue, 07 Feb 2017 17:05:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:Of4rSc0kH63psSeykWG4ullyTpU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212100 Archived-At: > Can package.el install binaries? That is, if my package includes a command > line interface, can I ask package.el to install it to somewhere like > .emacs.d/bin, or ~/.bin? Or should I do this by adding autoloaded code that > runs at package installation time? package.el installs packages using a very simple procedure: - untar the package into ~/.emacs.d/elpa/- - create the autoloads file. - byte-compile the .el files. If you want to do something else, you have to abuse one of the above steps, and the only one that can be abused reliably is the byte-compile step. E.g. you can place in one of the .el files something like (eval-when-compile ...copy some file to ~/bin...) The same trick can be used by pdf-tools and dynloaded modules. But obviously, package.el should be extended to support this more directly. In your case the problem of course, is that when uninstalling a package, the procedure is even simpler: - rm -r ~/.emacs.d/elpa/- and I don't know of any way to abuse this to also remove something you might have added to ~/bin. Notice that this second problem doesn't affect cases such as dynloaded modules or pdf-tools. Stefan