With a little side of applesauce...

Thursday, February 8, 2007

Ubuntu - php-mode fails to install

I have been getting the following errors when trying to install php-mode (emacs21 and emacs-snapshot):

Setting up php-mode (0.1-1) ...
install/php-mode: Handling install for emacsen flavor emacs21
While compiling toplevel forms in file /usr/share/emacs21/site-lisp/php-mode/php-mode.el:
!! Wrong type argument ((stringp nil))
Wrote /usr/share/emacs21/site-lisp/php-mode/php3-mode.elc
emacs-package-install: /usr/lib/emacsen-common/packages/install/php-mode emacs21 emacs21 failed at /usr/lib/emacsen-common/emacs-package-install line 30, line 1.
dpkg: error processing php-mode (--install):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:

The problem seems to revolve around the SITEFLAG variable, which is set in:


The --no-site-file flag tells emacs _not_ to load the /etc/emacs/site-start.el file, but mine was empty, so I simply removed the flag and was able to install php-mode. Here is how I did it on Ubuntu Feisty:

sudo apt-get source php-mode
cd emacs-extras-0.1/

Apply the following patch:

--- php-mode.emacsen-install.orig 2007-02-08 01:07:16.000000000 -0600
+++ php-mode.emacsen-install 2007-02-08 00:57:19.000000000 -0600
@@ -16,7 +16,7 @@
if [ ${FLAVORTEST} = xemacs ] ; then
- SITEFLAG="--no-site-file"
FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"

And, then compile the binary packages:

sudo debian/rules binary
sudo dpkg -i ../php-mode_0.1-1_all.deb

NOTE: I didn't need to change anything else for eiffel-mode, emacs-extra, or tiger-mode to compile and install correctly.

No comments: