|
@@ -1,7 +1,7 @@
|
|
|
-;;; org-fixup.el - to make life easier for folks without GNU make
|
|
|
+;;; org-fixup.el --- make life easier for folks without GNU make
|
|
|
;;
|
|
|
;; Author: Achim Gratz
|
|
|
-;; Keywords: outlines, hypermedia, calendar, wp
|
|
|
+;; Keywords: orgmode
|
|
|
;; Homepage: http://orgmode.org
|
|
|
;;
|
|
|
;; This file is not part of GNU Emacs.
|
|
@@ -24,10 +24,16 @@
|
|
|
;;
|
|
|
;;; Commentary:
|
|
|
|
|
|
-(load "autoload" nil 'nomessage)
|
|
|
-(load "org-compat.el" nil 'nomessage 'nosuffix)
|
|
|
+(require 'autoload)
|
|
|
+(require 'org-compat "org-compat.el")
|
|
|
|
|
|
(defun org-make-org-version (org-release org-git-version odt-dir)
|
|
|
+ "Make the file org-version.el in the current directory.
|
|
|
+This function is internally used by the build system and should
|
|
|
+be used by foreign build systems or installers to produce this
|
|
|
+file in the installation directory of org-mode. Org will not
|
|
|
+work correctly if this file is not present (except directly from
|
|
|
+the Git work tree)."
|
|
|
(with-temp-buffer
|
|
|
(insert "\
|
|
|
;;; org-version.el --- autogenerated file, do not edit
|
|
@@ -55,6 +61,11 @@
|
|
|
(write-file "org-version.el")))
|
|
|
|
|
|
(defun org-make-org-install ()
|
|
|
+ "Make the file org-install.el in the current directory.
|
|
|
+This function is internally used by the build system and should
|
|
|
+be used by foreign build systems or installers to produce this
|
|
|
+file in the installation directory of org-mode. Org will not
|
|
|
+work correctly if this file is not up-to-date."
|
|
|
(with-temp-buffer
|
|
|
(set-visited-file-name "org-install.el")
|
|
|
(insert ";;; org-install.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")
|
|
@@ -67,7 +78,12 @@
|
|
|
(toggle-read-only 0)
|
|
|
(save-buffer)))
|
|
|
|
|
|
-(defun org-make-autoloads ()
|
|
|
+(defun org-make-autoloads (&optional compile force)
|
|
|
+ "Make the files org-install and org-version.el in the install directory.
|
|
|
+Finds the install directory by looking for library \"org\".
|
|
|
+Optionally byte-compile lisp files in the install directory or
|
|
|
+force re-compilation. This function is provided for easier
|
|
|
+manual install when the build system can't be used."
|
|
|
(let* ((origin default-directory)
|
|
|
(dirlisp (org-find-library-dir "org"))
|
|
|
(dirorg (concat dirlisp "../" ))
|
|
@@ -79,20 +95,24 @@
|
|
|
(cd dirlisp)
|
|
|
(org-fixup)
|
|
|
(org-make-org-version (org-release) (org-git-version) dirodt)
|
|
|
- (org-make-org-install))
|
|
|
+ (org-make-org-install)
|
|
|
+ (when compile (byte-recompile-directory dirlisp 0 force)))
|
|
|
(cd origin))))
|
|
|
|
|
|
-(defun org-make-autoloads-compile (&rest force)
|
|
|
- (let* ((origin default-directory)
|
|
|
- (dirlisp (org-find-library-dir "org")))
|
|
|
- (unwind-protect
|
|
|
- (progn
|
|
|
- (cd dirlisp)
|
|
|
- (org-make-autoloads)
|
|
|
- (byte-recompile-directory dirlisp 0 force))
|
|
|
- (cd origin))))
|
|
|
+(defun org-make-autoloads-compile ()
|
|
|
+ "Call org-make-autoloads with compile argument.
|
|
|
+Convenience function for easier invocation from command line."
|
|
|
+ (org-make-autoloads 'compile nil))
|
|
|
+
|
|
|
+(defun org-make-autoloads-compile-force ()
|
|
|
+ "Call org-make-autoloads with compile force arguments.
|
|
|
+Convenience function for easier invocation from command line."
|
|
|
+ (org-make-autoloads 'compile 'force))
|
|
|
+
|
|
|
+;; Internal functions
|
|
|
|
|
|
(defun org-make-local-mk ()
|
|
|
+ "Internal function for the build system."
|
|
|
(let ((default "default.mk")
|
|
|
(local "local.mk"))
|
|
|
(unwind-protect
|
|
@@ -123,6 +143,7 @@ oldorg: # do what the old Makfile did by default
|
|
|
nil)))
|
|
|
|
|
|
(defun org-make-letterformat (a4name lettername)
|
|
|
+ "Internal function for the build system."
|
|
|
(unwind-protect
|
|
|
(with-temp-buffer
|
|
|
(insert-file-contents a4name)
|
|
@@ -133,6 +154,8 @@ oldorg: # do what the old Makfile did by default
|
|
|
(write-file lettername))
|
|
|
nil))
|
|
|
|
|
|
+;; redefine version functions
|
|
|
+
|
|
|
(defmacro org-fixup ()
|
|
|
(let* ((origin default-directory)
|
|
|
(dirlisp (org-find-library-dir "org"))
|
|
@@ -156,15 +179,15 @@ oldorg: # do what the old Makfile did by default
|
|
|
(git0 (substring (shell-command-to-string "git describe --abbrev=0 HEAD") 0 -1))
|
|
|
(gitd (string-match "\\S-"
|
|
|
(shell-command-to-string "git status -uno --porcelain"))))
|
|
|
- (setq org-git-version (concat git6 (when gitd ".dirty")))
|
|
|
+ (setq org-git-version (concat git6 (when gitd ".dirty") "-git"))
|
|
|
(if (string-match "^release_" git0)
|
|
|
(setq org-version (substring git0 8))
|
|
|
(setq org-version git0))))
|
|
|
- (cd origin)))))
|
|
|
+ (cd origin)))))
|
|
|
+ (message "org-fixup.el: redefined org version.")
|
|
|
`(progn
|
|
|
(defun org-release () ,org-version)
|
|
|
- (defun org-git-version () ,org-git-version)
|
|
|
- "org-fixup.el: redefined org version.")))
|
|
|
+ (defun org-git-version () ,org-git-version))))
|
|
|
|
|
|
(provide 'org-fixup)
|
|
|
|