[Pkg-octave-commit] [dynare] 03/05: Switch to dh-elpa for providing the Emacs mode.

Sébastien Villemot sebastien at debian.org
Tue Jul 25 16:22:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository dynare.

commit 4b7179a9f06d098dcc7b0b7be0f6efb0fdb0f7e5
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Tue Jul 25 16:28:49 2017 +0200

    Switch to dh-elpa for providing the Emacs mode.
    
    + d/dynare.emacsen*: dropped
    + d/dynare.install: no longer manually install dynare.el
    + d/control: add dh-elpa to Build-Depends
    + d/rules: dh --with elpa
    + d/dynare.elpa: new file
    + d/elpa-test: disable testsuite (non-existent)
    + d/p/emacs-use-autoload-magic-comment.patch: new patch for autoload
    
    Gbp-Dch: Full
---
 debian/control                                     |  1 +
 debian/dynare.elpa                                 |  1 +
 debian/dynare.emacsen-compat                       |  1 -
 debian/dynare.emacsen-install                      | 29 -----------------
 debian/dynare.emacsen-remove                       | 16 ---------
 debian/dynare.emacsen-startup                      |  6 ----
 debian/dynare.install                              |  1 -
 debian/elpa-test                                   |  1 +
 .../patches/emacs-use-autoload-magic-comment.patch | 38 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/rules                                       |  2 +-
 11 files changed, 43 insertions(+), 54 deletions(-)

diff --git a/debian/control b/debian/control
index b5498a4..d433caa 100644
--- a/debian/control
+++ b/debian/control
@@ -4,6 +4,7 @@ Uploaders: Sébastien Villemot <sebastien at debian.org>
 Section: math
 Priority: optional
 Build-Depends: debhelper (>= 10),
+               dh-elpa,
                liboctave-dev (>= 4.2),
                libboost-graph-dev,
                libmatio-dev,
diff --git a/debian/dynare.elpa b/debian/dynare.elpa
new file mode 100644
index 0000000..54d4e78
--- /dev/null
+++ b/debian/dynare.elpa
@@ -0,0 +1 @@
+scripts/dynare.el
diff --git a/debian/dynare.emacsen-compat b/debian/dynare.emacsen-compat
deleted file mode 100644
index 573541a..0000000
--- a/debian/dynare.emacsen-compat
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/debian/dynare.emacsen-install b/debian/dynare.emacsen-install
deleted file mode 100644
index 5512d0c..0000000
--- a/debian/dynare.emacsen-install
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-set -e
-
-FLAVOR=$1
-echo install/foo: Handling install of emacsen flavor ${FLAVOR}
-
-byte_compile_options="-batch -f batch-byte-compile"
-el_files="dynare.el" 
-el_dir=/usr/share/emacs/site-lisp/dynare/
-elc_dir=/usr/share/${FLAVOR}/site-lisp/dynare/
-
-if [ ${FLAVOR} != emacs ]
-then
-  echo install/foo: byte-compiling for ${FLAVOR}
-
-  [ -d ${elc_dir} ] || mkdir ${elc_dir}
-
-  # Copy the temp .el files
-  (cd ${el_dir} && cp ${el_files} ${elc_dir})
-
-  # Byte compile them
-  (cd ${elc_dir} \
-   && ${FLAVOR} ${byte_compile_options} ${el_files} 2> /dev/null)
-
-  # remove the redundant .el files
-  # presumes that any .el files in the <flavor> dir are trash.
-  rm ${elc_dir}/*.el
-fi
-exit 0;
diff --git a/debian/dynare.emacsen-remove b/debian/dynare.emacsen-remove
deleted file mode 100644
index 5e4fb33..0000000
--- a/debian/dynare.emacsen-remove
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-set -e
-
-FLAVOR=$1
-elc_dir=/usr/share/${FLAVOR}/site-lisp/dynare
-
-echo remove/foo: Handling removal of emacsen flavor ${FLAVOR}
-
-if [ ${FLAVOR} != emacs ]
-then
-  echo emacsen-common: purging byte-compiled files for ${FLAVOR}
-  rm -f ${elc_dir}/*.elc
-  rm -f ${elc_dir}/*.el         # Install might have been interrupted.
-  [ -d ${elc_dir} ] && rmdir --ignore-fail-on-non-empty ${elc_dir}
-fi
-exit 0;
diff --git a/debian/dynare.emacsen-startup b/debian/dynare.emacsen-startup
deleted file mode 100644
index 6f64cd2..0000000
--- a/debian/dynare.emacsen-startup
+++ /dev/null
@@ -1,6 +0,0 @@
-;; -*-emacs-lisp-*-
-;;
-;; Emacs startup file for the Dynare mode
-
-(autoload 'dynare-mode "dynare" "Enter dynare mode." t)
-(add-to-list 'auto-mode-alist '("\\.mod\\'" . dynare-mode))
diff --git a/debian/dynare.install b/debian/dynare.install
index 5897782..8d1827f 100644
--- a/debian/dynare.install
+++ b/debian/dynare.install
@@ -2,4 +2,3 @@ usr/lib/dynare/matlab/
 usr/lib/dynare/mex/
 usr/lib/dynare/contrib/
 usr/bin/dynare++
-scripts/dynare.el                       /usr/share/emacs/site-lisp/dynare
diff --git a/debian/elpa-test b/debian/elpa-test
new file mode 100644
index 0000000..e1dd79b
--- /dev/null
+++ b/debian/elpa-test
@@ -0,0 +1 @@
+disable=1
diff --git a/debian/patches/emacs-use-autoload-magic-comment.patch b/debian/patches/emacs-use-autoload-magic-comment.patch
new file mode 100644
index 0000000..62531f0
--- /dev/null
+++ b/debian/patches/emacs-use-autoload-magic-comment.patch
@@ -0,0 +1,38 @@
+Description: Use magic comments for autoloads in Emacs mode file
+ Also automatically trigger the mode for files with the .mod extension.
+Author: Sébastien Villemot <sebastien at debian.org>
+Applied-Upstream: https://github.com/DynareTeam/dynare/commit/2faf8bddbdab9269010f479d4be7febb86925787
+Last-Update: 2017-07-25
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/scripts/dynare.el
++++ b/scripts/dynare.el
+@@ -28,8 +28,6 @@
+ ;;   add this to your .emacs or site-init.el file:
+ ;;
+ ;;   (require 'dynare)
+-;;   (autoload 'dynare-mode "dynare" "Enter dynare mode." t)
+-;;   (setq auto-mode-alist (cons '("\\.mod\\'" . dynare-mode) auto-mode-alist))
+ 
+ ;;; Commentary:
+ ;;
+@@ -107,7 +105,8 @@ For detail, see `comment-dwim'."
+     ("(\\(+\\|-\\)[1-9])" . font-lock-constant-face)
+     ))
+ 
+-;; define the major mode
++;;; define the major mode
++;;;###autoload
+ (define-derived-mode dynare-mode fundamental-mode
+   "dynare mode"
+   "dynare is a mode for editing mod files used by dynare."
+@@ -149,5 +148,9 @@ For detail, see `comment-dwim'."
+   (setq dynare-functions-regexp nil)
+   )
+ 
++;;; mode trigger
++;;;###autoload
++(add-to-list 'auto-mode-alist '("\\.mod$" . dynare-mode))
++
+ (provide 'dynare)
+ ;;; dynare.el ends here
diff --git a/debian/patches/series b/debian/patches/series
index d400ad4..588b6d6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 extra-addpatch.patch
 hardcode-dynareroot.patch
+emacs-use-autoload-magic-comment.patch
diff --git a/debian/rules b/debian/rules
index 9b20364..8a5bbec 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 include /usr/share/octave/debian/defs.make
 
 %:
-	dh $@
+	dh $@ --with elpa
 
 # Disable multi-arch path
 override_dh_auto_configure:

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/dynare.git



More information about the Pkg-octave-commit mailing list