From 48e846d1d28e9ab9904abeabcc769867d0b4744b Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Tue, 13 Sep 2016 22:50:45 +0100 Subject: [PATCH] Build system now in generated makefile --- .gitignore | 2 +- lisp/emacs-lisp/package.el | 2 +- packages/admin/package-build.el | 2 +- packages/admin/package-makefile.el | 33 ++++++++++++------------------ packages/core/example/example.el | 14 +++++++++++++ packages/core/example2/example2.el | 14 +++++++++++++ packages/temp.el | 4 +--- 7 files changed, 45 insertions(+), 26 deletions(-) create mode 100644 packages/core/example/example.el create mode 100644 packages/core/example2/example2.el diff --git a/.gitignore b/.gitignore index a81a515c724..b644934cb61 100644 --- a/.gitignore +++ b/.gitignore @@ -142,7 +142,7 @@ src/stamp-h1 *.res *.so [0-9]*.core -core + core.*[0-9] gmon.out oo/ diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index baaa5e2a186..cf0417bf855 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -294,7 +294,7 @@ packages in `package-directory-list'." (push (expand-file-name "elpa" f) result))) (cons ;; And the inbuild ELPA directory - (concat (expand-file-name "../packages" data-directory)) + (concat (expand-file-name "../packages/core" data-directory)) (nreverse result))) "List of additional directories containing Emacs Lisp packages. Each directory name should be absolute. diff --git a/packages/admin/package-build.el b/packages/admin/package-build.el index 05b246c57e8..71897a2b0dd 100644 --- a/packages/admin/package-build.el +++ b/packages/admin/package-build.el @@ -8,7 +8,7 @@ (let ((descr (package-desc-create :name (make-symbol dir))) (location (package-build-dir dir))) - (archive--refresh-pkg-file location) + (archive-refresh-pkg-file location) (setq descr (package-load-descriptor location)) (package-generate-autoloads (package-desc-name descr) location) (package-activate descr) diff --git a/packages/admin/package-makefile.el b/packages/admin/package-makefile.el index 34f32d69490..ea8cece74ba 100644 --- a/packages/admin/package-makefile.el +++ b/packages/admin/package-makefile.el @@ -1,18 +1,6 @@ -(defvar package-makefile-archives - '("core") - "List of directories with packages in them. - -Directories can be either relative to the \"packages\" directory -or absolute. The order is important because we want to only build -packages which occur earlier in the list.") - -(defvar package-makefile--packages-seen nil - "List of packages we have already seen.") - (defun package-makefile--package-dirs (directory) (directory-files directory nil "[^.].*")) - (defun package-makefile--target-pkg-el (top-dir base-dir) (format "%s-pkg: %s/%s/%s-pkg.el @@ -27,24 +15,30 @@ packages which occur earlier in the list.") top-dir base-dir base-dir top-dir base-dir)) -(defun package-makefile--makefile-pkg-targets (top-dir) +(defun package-makefile--makefile-pkg-targets (top-dir all-dirs) (concat "pkg-all: " (mapconcat 'identity - (package-makefile--package-dirs top-dir) "" "-pkg ") + all-dirs + "-pkg ") + "-pkg" "\n\n" (mapconcat (lambda (base-dir) (package-makefile--target-pkg-el top-dir base-dir)) - (package-makefile--package-dirs top-dir) + all-dirs "\n"))) + +(defun package-makefile--core-packages () + (package-makefile--package-dirs "core")) + (defun package-makefile--makefile () - (mapconcat - (lambda (top-dir) - (package-makefile--makefile-pkg-targets top-dir)) - package-makefile-archives + (concat + (package-makefile--makefile-pkg-targets + "core" + (package-makefile--core-packages)) "\n")) @@ -52,7 +46,6 @@ packages which occur earlier in the list.") (with-temp-buffer (insert (package-makefile--makefile)) - (write-file "gnumakefile-inc.mk"))) ;; example: core/example/example-pkg.el diff --git a/packages/core/example/example.el b/packages/core/example/example.el new file mode 100644 index 00000000000..9044b09af8f --- /dev/null +++ b/packages/core/example/example.el @@ -0,0 +1,14 @@ +;;; example.el --- An Example + +;;; Header: + +;; This file is not part of Emacs + +;; Author: Phillip Lord +;; Maintainer: Phillip Lord +;; Version: 0.1 + +;;;###autoload +(defun example () + (interactive) + (message "Hello from Example")) diff --git a/packages/core/example2/example2.el b/packages/core/example2/example2.el new file mode 100644 index 00000000000..352078dd0b0 --- /dev/null +++ b/packages/core/example2/example2.el @@ -0,0 +1,14 @@ +;;; example2.el --- An Example + +;;; Header: + +;; This file is not part of Emacs + +;; Author: Phillip Lord +;; Maintainer: Phillip Lord +;; Version: 0.1 + +;;;###autoload +(defun example2 () + (interactive) + (message "Hello from Example2")) diff --git a/packages/temp.el b/packages/temp.el index fb2399aafaa..23e7e801c0e 100644 --- a/packages/temp.el +++ b/packages/temp.el @@ -8,6 +8,4 @@ (package-build-prepare "core/example") -(defun temp () - (interactive) - (package-makefile)) +(package-makefile) -- 2.39.5