I finally got around to ironing out all the details so that anyone
should be able to easily create cedet package and to install it.
Save away the shell script below into a file, then execute it to apply
to edit couple of files as well as to create couple of files.
See the first few lines of the script for instructions.
CEDET involves a thorny issue which prevents it from being used as other
packages. CEDET comes with eieio which in turn is used by the packaging
system, i.e. package.el. That is why cedet-remove-builtin.el is
modified by the patch below to take out 'eieio', because eieio has to be
loaded already when we evalutate the code in this file as part of
package installation.
This email applies only to emacs 24 for now.
If there is interest, I can also provide similar instruction on how to
create and install ELPA package for emacs 23 as well.
Enjoy.
#!/bin/sh
# This patch makes changes to cedet files to allow creation of an ELPA
# package of cedet, and also details how to install such a package.
#
# Usage:
# - apply this patch which edits the top level makefile and
# cedet-remove-builtin.el files. Also install-cedet-elpa-package.el
# is created which is used in installing the ELPA package later on.
# - Type "make clean-all elpa" in a shell. This creates three files:
# cedet-YYYYMMDD.tar, cedet-readme.txt, and archives-contents.
# - Type "cp cedet-YYYYMMDD.tar cedet-readme.txt ~/public_html/elpa" to copy
# two files to your own ELPA repository. This of course assumes that your
# local ELPA repository is <http://localhost/~USERNAME/elpa>.
# - Edit ~/public_html/elpa/archive-contents to add entry for cedet, e.g.,
# (cedet . [(20120707) nil "CEDET" tar])
# If you are new to ELPA and cedet is your first package, then just
# copy archives-contents file created earlier. See
# http://elpa.gnu.org/packages/archive-contents for what these files
# are supposed to contain.
# - Launch emacs and execute code in install-cedet-elpa-package.el, e.g,
# emacs -q -l install-cedet-elpa-package.el
# You should make sure that the three papameters at the beginning of
# install-cedet-elpa-package.el are appropriate for you beforehand.
if [ ! -d lisp/cedet ]; then
echo 'You need to run this script at the cedet bzr root directory!'
exit 1
fi
# Protect against this patch being applied multiple times by removing
# file created by this patch.
rm -f install-cedet-elpa-package.el archive-contents
patch -p0 $1 << 'EOF'
=== modified file 'Makefile'
--- Makefile 2012-05-04 10:28:00 +0000
+++ Makefile 2012-07-15 20:47:34 +0000
@@ -36,6 +36,9 @@
INFO_FILES=$(shell $(FIND) $(CURDIR)/doc/texi -type f -name '*.info')
INFODIR=$(CURDIR)/doc/info
+# Date of today such as "20120707". This is used as ELPA package version.
+DATE = $(shell date +%Y%m%d)
+
all: clean-autoloads autoloads touch-makefiles compile info install-info
compile:
@@ -66,6 +69,53 @@
@mkdir -p $(INFODIR)
@$(foreach infofile,$(INFO_FILES),cp $(infofile) $(INFODIR);$(INSTALL-INFO) --info-dir=$(INFODIR) $(infofile);)
+# Create ELPA package of cedet and use today's date as version.
+elpa: autoloads dist info install-info cedet-$(DATE).tar cedet-readme.txt archive-contents
+
+dist :
+ $(MAKE) -C lisp $@ PRELOADS=semantic/grammar
+ rm -rf ./lisp/cedet/cedet-topdir-1.1beta
+
+cedet-$(DATE).tar : cedet-$(DATE)
+ tar cf $@ $<
+
+# Because 'autoloads' and 'info' targets were already made, all *.el
+# files such as c-by.el should have been generated.
+# So create a directory and copy all *.el and *.info files along with
+# the 'dir' file to that directory. Other files are not needed, but
+# may be needed to satisfy GPL requirements.
+# Also create _cedet_autoloads.el just to have one line with autoload
+# cookie. When `package-install' is executed, this will be used to
+# create cedet-autoloads.el file with the one line.
+# Also create cedet-readme.txt with some blurb about cedet.
+cedet-$(DATE):
+ mkdir -p $@/doc/info
+ find lisp \( -name '*.el' -o -name '*.wy' -o -name '*.by' \) -exec cp --parents {} $@ \;
+ cp -p *.el $@
+ cp -p doc/info/* $@/doc/info
+ echo ';;;###autoload' > $@/_cedet_autoloads.el
+ echo '(load-library "cedet-devel-load.el")' >> $@/_cedet_autoloads.el
+ echo "(define-package \"cedet\" \"$(DATE)\" \"CEDET\")" > $@/cedet-pkg.el
+
+cedet-readme.txt:
+ echo "CEDET is a Collection of Emacs Development Environment Tools including" > $@
+ echo "core libraries such as EIEIO, and semantic, and user interface tools" >> $@
+ echo "such as Speedbar, EDE, and COGRE." >> $@
+ echo "" >> $@
+ echo "While these tools are independent, and all have their own manuals," >> $@
+ echo "they are also all co-dependent within CEDET, and are dependent on the" >> $@
+ echo "CEDET common libraries such as inversion and ezimage." >> $@
+ echo "" >> $@
+ echo "This manual describes how to configure the tools as a whole to" >> $@
+ echo "accomplish some tasks." >> $@
+ echo "" >> $@
+ echo "To send bug reports, or participate in discussions about CEDET, use" >> $@
+ echo "the mailing list cedet-devel.net via the URL:" >> $@
+ echo "http://lists.sourceforge.net/lists/listinfo/cedet-devel" >> $@
+
+archive-contents:
+ echo "(1 (cedet . [($(DATE)) nil \"CEDET\" tar]))" > $@
+
clean-autoloads:
@echo Removing loaddefs.el files from subprojects.
@$(foreach proj,$(PROJECTS_AUTOLOADS),cd $(CURDIR)/$(proj) && if [ -f $(LOADDEFS) ];then $(RM) -f $(LOADDEFS);fi;)
@@ -73,6 +123,7 @@
clean-all: clean-autoloads
@echo Calling \"$(MAKE) clean\" in all projects.
@$(foreach proj,$(PROJECTS),echo " > $(proj)";cd $(CURDIR)/$(proj) && $(MAKE) clean;)
+ rm -rf cedet-$(DATE) cedet-$(DATE).tar cedet-readme.txt
utest:
$(EMACS) -Q -l cedet-devel-load.el --eval '$(UTEST)' -f cedet-utest
=== modified file 'cedet-remove-builtin.el'
--- cedet-remove-builtin.el 2011-11-28 20:59:31 +0000
+++ cedet-remove-builtin.el 2012-07-15 20:34:20 +0000
@@ -22,7 +22,7 @@
;;; Code:
(defvar cedet-remove-builtin-package-list
- '(eieio semantic srecode ede data-debug speedbar)
+ '(semantic srecode ede data-debug speedbar)
"CEDET packages part of Emacs proper that should be removed.
The 'cedet' package itself is implicitly included.")
=== added file 'install-cedet-elpa-package.el'
--- install-cedet-elpa-package.el 1970-01-01 00:00:00 +0000
+++ install-cedet-elpa-package.el 2012-07-07 17:17:01 +0000
@@ -0,0 +1,58 @@
+;;; install-cedet-elpa-package --- install cedet ELPA package
+
+;;; Copyright (C) 2012 Richard Kim
+
+;; Author: Richard Kim <emacs18@...>
+
+;; This file is not part of GNU Emacs.
+
+;; This 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 2, or (at your option)
+;; any later version.
+
+;; This software 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; This is what I use to install the cedet package created by "make elpa".
+;; Here is the step by step instruction:
+;;
+;; - Update the three variables at the beginning of this file to suit your site.
+;; - Type "make elpa" in a shell which creates cedet-YYYYMMDD.tar file.
+;; - Type "cp cedet-YYYYMMDD.tar cedet-readme.txt ~/public_html/elpa" to copy
+;; two files to your own ELPA repository. This of course assumes that your
+;; local ELPA repository is <http://localhost/~USERNAME/elpa>.
+;; - Edit ~/public_html/elpa/archive-contents to add entry for cedet, e.g.,
+;; (cedet . [(20120707) nil "CEDET" tar])
+;; - Launch emacs and execute code in this file, e.g,
+;; emacs -q -l install-cedet-elpa-package.el
+;;
+
+(defvar site-cedet-bzr-root "~/src/cedet/trunk"
+ "The local directory where the cedet trunk is located, i.e.,
+where you typed \"make elpa\" to create the ELPA package.
+We need this to use the new eieio (rather than the built-in one) which
+package.el depends on.")
+
+(defvar site-elpa-url (format "http://localhost/~%s/elpa/" user-login-name)
+ "The URL of ELPA repository where cedet package is located.")
+
+(defvar site-elpa-install-direcotry "~/elisp/emacs-24"
+ "The directory to which ELPA package is to be installed.")
+
+;; Install cedet package using the three parameters above.
+(add-to-list 'load-path (expand-file-name "lisp/eieio" site-cedet-bzr-root))
+(require 'package)
+(custom-set-variables `(package-archives '(("local" . ,site-elpa-url))))
+(custom-set-variables `(package-user-dir ,site-elpa-install-direcotry))
+(package-refresh-contents)
+(package-install 'cedet)
EOF
|