summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-07-11 10:37:07 +0200
committerDavid Bremner <david@tethera.net>2015-07-11 10:37:07 +0200
commit5ade77db1229943a772535a0b66167dbd8f47a93 (patch)
tree01e5057de33379d4b62b541b5d04bcf874fea8d7
dh-elpa: initial chicken scratchings in the dirt
One function "borrowed" from package.el. We don't want to rely on the private (seeming) API, and anyway it's easier to modify certain aspects, like byte compiling.
-rw-r--r--README.org3
-rw-r--r--dh-elpa.el55
-rw-r--r--notes.org15
3 files changed, 73 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..56a81ee
--- /dev/null
+++ b/README.org
@@ -0,0 +1,3 @@
+* Intro
+
+This is a (so far vapourware) project to generate Debian packages of Emacs Lisp extensions that integrate with the built in (since GNU Emacs 24.1) package system package.el
diff --git a/dh-elpa.el b/dh-elpa.el
new file mode 100644
index 0000000..f7bd7d9
--- /dev/null
+++ b/dh-elpa.el
@@ -0,0 +1,55 @@
+;;; dh-elpa.el --- package.el style packages for Debian -*- lexical-binding:t -*-
+
+;; Copyright (C) 2015 David Bremner
+
+;; Author: David Bremner <bremner@debian.org>
+;; Created: 11 July 2015
+;; Version: 0.0.1
+;; Keywords: tools
+;; Package-Requires: ((tabulated-list "1.0"))
+
+;; This file is NOT part of GNU Emacs.
+
+;; dh-elpa is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;; Originally package-unpack from package.el in Emacs 24.5
+(defun dhelpa-unpack (pkg-desc)
+ "Install the contents of the current buffer as a package."
+ (let* ((name (package-desc-name pkg-desc))
+ (dirname (package-desc-full-name pkg-desc))
+ (pkg-dir (expand-file-name dirname package-user-dir)))
+ (pcase (package-desc-kind pkg-desc)
+ (`tar
+ (make-directory package-user-dir t)
+ ;; FIXME: should we delete PKG-DIR if it exists?
+ (let* ((default-directory (file-name-as-directory package-user-dir)))
+ (package-untar-buffer dirname)))
+ (`single
+ (let ((el-file (expand-file-name (format "%s.el" name) pkg-dir)))
+ (make-directory pkg-dir t)
+ (package--write-file-no-coding el-file)))
+ (kind (error "Unknown package kind: %S" kind)))
+ (package--make-autoloads-and-stuff pkg-desc pkg-dir)
+ ;; Update package-alist.
+ (let ((new-desc (package-load-descriptor pkg-dir)))
+ ;; FIXME: Check that `new-desc' matches `desc'!
+ ;; FIXME: Compilation should be done as a separate, optional, step.
+ ;; E.g. for multi-package installs, we should first install all packages
+ ;; and then compile them.
+ (package--compile new-desc))
+ ;; Try to activate it.
+ (package-activate name 'force)
+ pkg-dir))
+
+;;; dh-elpa.el ends here
diff --git a/notes.org b/notes.org
new file mode 100644
index 0000000..75ae6a1
--- /dev/null
+++ b/notes.org
@@ -0,0 +1,15 @@
+* package.el
+
+- package-directory-list (v)
+ list of additional directories containing elpa packages. In particular this has an emacs version specific directory where we can install byte compiled files.
+
+- package-unpack (f)
+
+ does the actual installation, using dynamically bound
+ *package-user-dir*. The current version is safe to call without
+ network access, but it's probably considered internal.
+
+* workflow
+** at package build time
+- install using package-unpack (or workalike) into
+ $(DESTDIR)/usr/share/emacs/site-lisp/elpa