all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Compiling emacs 24 under Debian
@ 2011-01-04  2:56 Richard Riley
  2011-01-04  3:23 ` Tim X
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Riley @ 2011-01-04  2:56 UTC (permalink / raw)
  To: help-gnu-emacs


Could someone please share the secret for making emacs 24 under Debian
(testing) so that it can still see the system installed libraries that
are not part of emacs proper?

I have this but I'm not altogether sure its good enough:-

(setq load-path (append load-path '("/usr/local/emacs/site-lisp" "/usr/share/emacs/site-lisp")))
(load-library "debian-startup")
(debian-startup 'emacs23)
(load-library "/etc/emacs/site-start")





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling emacs 24 under Debian
  2011-01-04  2:56 Compiling emacs 24 under Debian Richard Riley
@ 2011-01-04  3:23 ` Tim X
  2011-01-04 10:51   ` Richard Riley
  0 siblings, 1 reply; 4+ messages in thread
From: Tim X @ 2011-01-04  3:23 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley <rileyrg@googlemail.com> writes:

> Could someone please share the secret for making emacs 24 under Debian
> (testing) so that it can still see the system installed libraries that
> are not part of emacs proper?
>
> I have this but I'm not altogether sure its good enough:-
>
> (setq load-path (append load-path '("/usr/local/emacs/site-lisp"
> "/usr/share/emacs/site-lisp")))
> (load-library "debian-startup")
> (debian-startup 'emacs23)
> (load-library "/etc/emacs/site-start")
>

The most reliable way I've found is to edit lisp/startuo.el and add the
debian-emacs-flavor variable and modify the code further down where the
site-start library is loaded. If you do a diff on the startup.el file
from debian's emacs and the one from emacs bzr, you will quickly see the
necessary changes. 

There are some other differences, but I've found these to be cosmetic.
The startup.el file rarely changes and bzr will auto merge if possible
when you do a bzr pull to update. 

As there can be byte code issues between versions of emacs, I also tend
to install the emacs-snapshot and set the debian-emacs-flavor to
'emacs-snapshot. I also have 2 simple bash script that I run to setup
appropriate symlinks and /etc/alternatives. Not necessary, but handy if
you want to easily and consistently move between different versions of
emacs such that running 'emacs' will give consistent version results. I
install emacs into the default /usr/local tree. After running make
install, I rm /usr/local/share/emacs/24.0.50/site-lisp and replace it
with a sym link to /usr/share/emacs-snapshot/site-lisp

I use load-path-shadow to verify everything is consistent and loading
what I think it is after each new build of emacs. 

#!/bin/bash

#       Filename: setup-emacs.sh
#  Creation Date: Monday, 05 July 2010 10:33 AM EST
#  Last Modified: Tuesday, 06 July 2010 06:06 PM EST
#    Description: Simple script to setup emacs24 and make it the default alterntaive
# 

if [ -f /usr/local/bin/b2m ]; then
    if [ -f /usr/local/bin/b2m.emacs24 ]; then
        rm /usr/local/bin/b2m.emacs24
    fi
    mv /usr/local/bin/b2m /usr/local/bin/b2m.emacs24
fi

if [ -f /usr/local/bin/ctags ]; then
    if [ -f /usr/local/bin/ctags.emacs24 ]; then
        rm /usr/local/bin/ctags.emacs24
    fi
    mv /usr/local/bin/ctags /usr/local/bin/ctags.emacs24
fi

if [ -f /usr/local/bin/ebrowse ]; then
    if [ -f /usr/local/bin/ebrowse.emacs24 ]; then
        rm /usr/local/bin/ebrowse.emacs24
    fi
    mv /usr/local/bin/ebrowse /usr/local/bin/ebrowse.emacs24
fi

if [ -f /usr/local/bin/emacs ]; then
    if [ -f /usr/local/bin/emacs24-x ]; then
        rm /usr/local/bin/emacs24-x
    fi
    mv /usr/local/bin/emacs /usr/local/bin/emacs24-x
fi

if [ -f /usr/local/bin/emacsclient ]; then
    if [ -f /usr/local/bin/emacsclient.emacs24 ]; then
        rm /usr/local/bin/emacsclient.emacs24
    fi
    mv /usr/local/bin/emacsclient /usr/local/bin/emacsclient.emacs24
fi

if [ -f /usr/local/bin/etags ]; then
    if [ -f /usr/local/bin/etags.emacs24 ]; then
        rm /usr/local/bin/etags.emacs24
    fi
    mv /usr/local/bin/etags /usr/local/bin/etags.emacs24
fi

if [ -f /usr/local/bin/grep-changelog ]; then
    if [ -f /usr/local/bin/grep-changelog.emacs24 ]; then
        rm /usr/local/bin/grep-changelog.emacs24
    fi
    mv /usr/local/bin/grep-changelog /usr/local/bin/grep-changelog.emacs24
fi

if [ -f /usr/local/bin/rcs-checkin ]; then
    if [ -f /usr/local/bin/rcs-checkin.emacs24 ]; then
        rm /usr/local/bin/rcs-checkin.emacs24
    fi
    mv /usr/local/bin/rcs-checkin /usr/local/bin/rcs-checkin.emacs24
fi

#!/bin/bash
#       Filename: emacs-alternative.sh
#  Creation Date: Monday, 05 July 2010 10:54 AM EST
#  Last Modified: Monday, 05 July 2010 11:38 AM EST
#    Description: Switch between alternative emacs versions
# 

if [ $# -ne 1 ]; then
    echo "Error: Wrong # arguments"
    echo "Usage: $0 < 23 | 24 | emacs-snapshot >"
    exit 1
fi

EMACS_VERSION=$1

echo "Configureing for emacs $EMACS_VERSION"

cd /etc/alternatives

if [ $EMACS_VERSION == "23" ]; then
    echo "Configureing for Ubuntu emacs 23"
    rm b2m
    ln -s /usr/bin/b2m.emacs23 b2m
    rm ctags
    ln -s /usr/bin/ctags.emacs23 ctags
    rm ebrowse
    ln -s /usr/bin/ebrowse.emacs23 ebrowse
    rm emacs
    ln -s /usr/bin/emacs23-x emacs
    rm emacsclient
    ln -s /usr/bin/emacsclient.emacs23 emacsclient
    rm etags
    ln -s /usr/bin/etags.emacs23 etags
    rm grep-changelog
    ln -s /usr/bin/grep-changelog.emacs23 grep-changelog
    rm rcs-checkin
    ln -s /usr/bin/rcs-checkin.emacs23 rcs-checkin 
elif [ $EMACS_VERSION == "emacs-snapshot" ]; then
    echo "Configureing for Ubuntu emacs-snapshot"
    rm b2m
    ln -s /usr/bin/b2m.emacs-snapshot b2m
    rm ctags
    ln -s /usr/bin/ctags.emacs-snapshot ctags
    rm ebrowse
    ln -s /usr/bin/ebrowse.emacs-snapshot ebrowse
    rm emacs
    ln -s /usr/bin/emacs-snapshot-x emacs
    rm emacsclient
    ln -s /usr/bin/emacsclient.emacs-snapshot emacsclient
    rm etags
    ln -s /usr/bin/etags.emacs-snapshot etags
    rm grep-changelog
    ln -s /usr/bin/grep-changelog.emacs-snapshot grep-changelog
    rm rcs-checkin
    ln -s /usr/bin/rcs-checkin.emacs-snapshot rcs-checkin 
elif [ $EMACS_VERSION == "24" ]; then
    echo "Configuring for local emacs 24"
    rm b2m
    ln -s /usr/local/bin/b2m.emacs24 b2m
    rm ctags
    ln -s /usr/local/bin/ctags.emacs24 ctags
    rm ebrowse
    ln -s /usr/local/bin/ebrowse.emacs24 ebrowse
    rm emacs
    ln -s /usr/local/bin/emacs24-x emacs
    rm emacsclient 
    ln -s /usr/local/bin/emacsclient.emacs24 emacsclient
    rm etags
    ln -s /usr/local/bin/etags.emacs24 etags
    rm grep-changelog
    ln -s /usr/local/bin/grep-changelog.emacs24 grep-changelog
    rm rcs-checkin
    ln -s /usr/local/bin/rcs-checkin.emacs24 rcs-checkin
else
    echo "Unknown emacs version $EMACS_VERSION"
    exit 1
fi






-- 
tcross (at) rapttech dot com dot au


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling emacs 24 under Debian
  2011-01-04  3:23 ` Tim X
@ 2011-01-04 10:51   ` Richard Riley
  2011-01-04 22:53     ` Tim X
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Riley @ 2011-01-04 10:51 UTC (permalink / raw)
  To: help-gnu-emacs


Hi Tim,

Thanks for the reply. Some Qs below.

Tim X <timx@nospam.dev.null> writes:

> Richard Riley <rileyrg@googlemail.com> writes:
>
>> Could someone please share the secret for making emacs 24 under Debian
>> (testing) so that it can still see the system installed libraries that
>> are not part of emacs proper?
>>
>> I have this but I'm not altogether sure its good enough:-
>>
>> (setq load-path (append load-path '("/usr/local/emacs/site-lisp"
>> "/usr/share/emacs/site-lisp")))
>> (load-library "debian-startup")
>> (debian-startup 'emacs23)
>> (load-library "/etc/emacs/site-start")
>>
>
> The most reliable way I've found is to edit lisp/startuo.el and add the
> debian-emacs-flavor variable and modify the code further down where the
> site-start library is loaded. If you do a diff on the startup.el file
> from debian's emacs and the one from emacs bzr, you will quickly see the
> necessary changes. 

I just compiled and use only the above as the init : how do you feel
that compares? Certainly Emacs 24 loads and runs  (it compiled and
installed to /usr/local/bin). What would it lack do you think? It uses
the latest emacs installed as its "site lisp" after using the bzr one.

>
> There are some other differences, but I've found these to be cosmetic.
> The startup.el file rarely changes and bzr will auto merge if possible
> when you do a bzr pull to update. 

Thats cool.

>
> As there can be byte code issues between versions of emacs, I also tend
> to install the emacs-snapshot and set the debian-emacs-flavor to
> 'emacs-snapshot. I also have 2 simple bash script that I run to setup

Which repos do you use for emacs-snapshot? emacs-snapshot isn't a part
of Debian Testing, the orebokech one is gone,
http://www.emacswiki.org/emacs/EmacsSnapshotAndDebian isnt really a
snapshot (git head).

> appropriate symlinks and /etc/alternatives. Not necessary, but handy if
> you want to easily and consistently move between different versions of
> emacs such that running 'emacs' will give consistent version results. I
> install emacs into the default /usr/local tree. After running make
> install, I rm /usr/local/share/emacs/24.0.50/site-lisp and replace it
> with a sym link to /usr/share/emacs-snapshot/site-lisp
>
> I use load-path-shadow to verify everything is consistent and loading
> what I think it is after each new build of emacs. 

Crikey, certainly a lot more thorough than my way. I will give this a go
soon : certainly not what I would term simple ;)

>
> #!/bin/bash
>
> #       Filename: setup-emacs.sh
> #  Creation Date: Monday, 05 July 2010 10:33 AM EST
> #  Last Modified: Tuesday, 06 July 2010 06:06 PM EST
> #    Description: Simple script to setup emacs24 and make it the default alterntaive
> # 
>
> if [ -f /usr/local/bin/b2m ]; then
>     if [ -f /usr/local/bin/b2m.emacs24 ]; then
>         rm /usr/local/bin/b2m.emacs24
>     fi
>     mv /usr/local/bin/b2m /usr/local/bin/b2m.emacs24
> fi
>
> if [ -f /usr/local/bin/ctags ]; then
>     if [ -f /usr/local/bin/ctags.emacs24 ]; then
>         rm /usr/local/bin/ctags.emacs24
>     fi
>     mv /usr/local/bin/ctags /usr/local/bin/ctags.emacs24
> fi
>
> if [ -f /usr/local/bin/ebrowse ]; then
>     if [ -f /usr/local/bin/ebrowse.emacs24 ]; then
>         rm /usr/local/bin/ebrowse.emacs24
>     fi
>     mv /usr/local/bin/ebrowse /usr/local/bin/ebrowse.emacs24
> fi
>
> if [ -f /usr/local/bin/emacs ]; then
>     if [ -f /usr/local/bin/emacs24-x ]; then
>         rm /usr/local/bin/emacs24-x
>     fi
>     mv /usr/local/bin/emacs /usr/local/bin/emacs24-x
> fi
>
> if [ -f /usr/local/bin/emacsclient ]; then
>     if [ -f /usr/local/bin/emacsclient.emacs24 ]; then
>         rm /usr/local/bin/emacsclient.emacs24
>     fi
>     mv /usr/local/bin/emacsclient /usr/local/bin/emacsclient.emacs24
> fi
>
> if [ -f /usr/local/bin/etags ]; then
>     if [ -f /usr/local/bin/etags.emacs24 ]; then
>         rm /usr/local/bin/etags.emacs24
>     fi
>     mv /usr/local/bin/etags /usr/local/bin/etags.emacs24
> fi
>
> if [ -f /usr/local/bin/grep-changelog ]; then
>     if [ -f /usr/local/bin/grep-changelog.emacs24 ]; then
>         rm /usr/local/bin/grep-changelog.emacs24
>     fi
>     mv /usr/local/bin/grep-changelog /usr/local/bin/grep-changelog.emacs24
> fi
>
> if [ -f /usr/local/bin/rcs-checkin ]; then
>     if [ -f /usr/local/bin/rcs-checkin.emacs24 ]; then
>         rm /usr/local/bin/rcs-checkin.emacs24
>     fi
>     mv /usr/local/bin/rcs-checkin /usr/local/bin/rcs-checkin.emacs24
> fi
>
> #!/bin/bash
> #       Filename: emacs-alternative.sh
> #  Creation Date: Monday, 05 July 2010 10:54 AM EST
> #  Last Modified: Monday, 05 July 2010 11:38 AM EST
> #    Description: Switch between alternative emacs versions
> # 
>
> if [ $# -ne 1 ]; then
>     echo "Error: Wrong # arguments"
>     echo "Usage: $0 < 23 | 24 | emacs-snapshot >"
>     exit 1
> fi
>
> EMACS_VERSION=$1
>
> echo "Configureing for emacs $EMACS_VERSION"
>
> cd /etc/alternatives
>
> if [ $EMACS_VERSION == "23" ]; then
>     echo "Configureing for Ubuntu emacs 23"
>     rm b2m
>     ln -s /usr/bin/b2m.emacs23 b2m
>     rm ctags
>     ln -s /usr/bin/ctags.emacs23 ctags
>     rm ebrowse
>     ln -s /usr/bin/ebrowse.emacs23 ebrowse
>     rm emacs
>     ln -s /usr/bin/emacs23-x emacs
>     rm emacsclient
>     ln -s /usr/bin/emacsclient.emacs23 emacsclient
>     rm etags
>     ln -s /usr/bin/etags.emacs23 etags
>     rm grep-changelog
>     ln -s /usr/bin/grep-changelog.emacs23 grep-changelog
>     rm rcs-checkin
>     ln -s /usr/bin/rcs-checkin.emacs23 rcs-checkin 
> elif [ $EMACS_VERSION == "emacs-snapshot" ]; then
>     echo "Configureing for Ubuntu emacs-snapshot"
>     rm b2m
>     ln -s /usr/bin/b2m.emacs-snapshot b2m
>     rm ctags
>     ln -s /usr/bin/ctags.emacs-snapshot ctags
>     rm ebrowse
>     ln -s /usr/bin/ebrowse.emacs-snapshot ebrowse
>     rm emacs
>     ln -s /usr/bin/emacs-snapshot-x emacs
>     rm emacsclient
>     ln -s /usr/bin/emacsclient.emacs-snapshot emacsclient
>     rm etags
>     ln -s /usr/bin/etags.emacs-snapshot etags
>     rm grep-changelog
>     ln -s /usr/bin/grep-changelog.emacs-snapshot grep-changelog
>     rm rcs-checkin
>     ln -s /usr/bin/rcs-checkin.emacs-snapshot rcs-checkin 
> elif [ $EMACS_VERSION == "24" ]; then
>     echo "Configuring for local emacs 24"
>     rm b2m
>     ln -s /usr/local/bin/b2m.emacs24 b2m
>     rm ctags
>     ln -s /usr/local/bin/ctags.emacs24 ctags
>     rm ebrowse
>     ln -s /usr/local/bin/ebrowse.emacs24 ebrowse
>     rm emacs
>     ln -s /usr/local/bin/emacs24-x emacs
>     rm emacsclient 
>     ln -s /usr/local/bin/emacsclient.emacs24 emacsclient
>     rm etags
>     ln -s /usr/local/bin/etags.emacs24 etags
>     rm grep-changelog
>     ln -s /usr/local/bin/grep-changelog.emacs24 grep-changelog
>     rm rcs-checkin
>     ln -s /usr/local/bin/rcs-checkin.emacs24 rcs-checkin
> else
>     echo "Unknown emacs version $EMACS_VERSION"
>     exit 1
> fi

-- 
☘ http://www.shamrockirishbar.com, http://splash-of-open-sauce.blogspot.com/ http://www.richardriley.net


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling emacs 24 under Debian
  2011-01-04 10:51   ` Richard Riley
@ 2011-01-04 22:53     ` Tim X
  0 siblings, 0 replies; 4+ messages in thread
From: Tim X @ 2011-01-04 22:53 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley <rileyrg@googlemail.com> writes:

> Hi Tim,
>
> Thanks for the reply. Some Qs below.
>
> Tim X <timx@nospam.dev.null> writes:
>
>> Richard Riley <rileyrg@googlemail.com> writes:
>>
>>> Could someone please share the secret for making emacs 24 under Debian
>>> (testing) so that it can still see the system installed libraries that
>>> are not part of emacs proper?
>>>
>>> I have this but I'm not altogether sure its good enough:-
>>>
>>> (setq load-path (append load-path '("/usr/local/emacs/site-lisp"
>>> "/usr/share/emacs/site-lisp")))
>>> (load-library "debian-startup")
>>> (debian-startup 'emacs23)
>>> (load-library "/etc/emacs/site-start")
>>>
>>
>> The most reliable way I've found is to edit lisp/startuo.el and add the
>> debian-emacs-flavor variable and modify the code further down where the
>> site-start library is loaded. If you do a diff on the startup.el file
>> from debian's emacs and the one from emacs bzr, you will quickly see the
>> necessary changes. 
>
> I just compiled and use only the above as the init : how do you feel
> that compares? Certainly Emacs 24 loads and runs  (it compiled and
> installed to /usr/local/bin). What would it lack do you think? It uses
> the latest emacs installed as its "site lisp" after using the bzr one.
>

Not sure if I follow 100%. However, keep in mind that part of the build
process also involves generating a 'dumped' version of emacs to help
speed up startup. This means there can be some values, loaded in the
dumped image, that cannot be easily overridden later. This is why I
modify the startup.el file rather than just run additional init code to
set various things. I use to just use additional init code at startup,
but found I sometimes got inconsistent load-path outcomes and difficult
to track down bugs. 

The nice thing about how I have things setup now is that updating from
bzr to get the latest emacs sources is a simple as 

cd bzr/emacs/trunk
sudo make distclean
bzr pull
./configure
make bootstrap
sudo make install
sudo lib-src/blessmail ....
cd ~/bin
sudo ./setup-emacs.sh

and I'm done. If the emacs version number changes i.e. 24.0.50 to
24.0.51, I have to do the symlink thing with site-lisp, but that is very
infrequent. 

>>
>> There are some other differences, but I've found these to be cosmetic.
>> The startup.el file rarely changes and bzr will auto merge if possible
>> when you do a bzr pull to update. 
>
> Thats cool.
>
>>
>> As there can be byte code issues between versions of emacs, I also tend
>> to install the emacs-snapshot and set the debian-emacs-flavor to
>> 'emacs-snapshot. I also have 2 simple bash script that I run to setup
>
> Which repos do you use for emacs-snapshot? emacs-snapshot isn't a part
> of Debian Testing, the orebokech one is gone,
> http://www.emacswiki.org/emacs/EmacsSnapshotAndDebian isnt really a
> snapshot (git head).
>

OK, I use to use Ramain's one, if thats gone, I'm not sure (I actually
switched to ubuntu a little while back an have been using a ubuntu
specific snapshot from a PPA.

>> appropriate symlinks and /etc/alternatives. Not necessary, but handy if
>> you want to easily and consistently move between different versions of
>> emacs such that running 'emacs' will give consistent version results. I
>> install emacs into the default /usr/local tree. After running make
>> install, I rm /usr/local/share/emacs/24.0.50/site-lisp and replace it
>> with a sym link to /usr/share/emacs-snapshot/site-lisp
>>
>> I use load-path-shadow to verify everything is consistent and loading
>> what I think it is after each new build of emacs. 
>
> Crikey, certainly a lot more thorough than my way. I will give this a go
> soon : certainly not what I would term simple ;)
>

Well, there is a much simpler method that works really well. However, it
has a steep learning curve. Once you get the workflow sorted though, it
is quite easy. I've used it for other packages, but have never got
around to doing it for the emacs stuff. 

There was a web page somewhere that explained this in a concise step by
step way, but I seem to have lost the link. The principal is pretty
straight-forward. 

1. Grap the deb-src package for emacs 23
2. Unpack it
3. replace the sources with the sources from emacs bzr
4. (Possibly) remove or update any patches.
5. Update the spec file 
6. build a new deb package and install it. 

The biggest hassle with this method (apart from having to get more
familiar with deb internals0 is step 4. However, if you just remove all
patches except those that update startup.el to add the
debian-emacs-flavor and debian-startup stuff, then its straight-forward
enough. Most of the hard work has been done by previous maintainers.

This approach has two main advantages. 

1. You can easily install emacs on multiple machines
2. If you are ever unlucky enough to get an updated emacs bzr version
with a nasty bug, you can quickly and reliably downgrade to the previous
version MUCH easier and faster than you can using a direct bzr method. 

The only reason I've not gone this way is that I already had my current
workflow in place before I learnt enough about deb packages to see how
easy it is to build new packages when you can leverage off existing
packages built for an earlier version.  More recently, I've also started
to seriously question using the debian/ubuntu emacs framework. While I
really liked the ability to install/remove deb versions of emacs
add-ons, there appears to be a drop off in interest in maintaining emacs
for either ubuntu or debian (ubuntu is particularly bad). The packages
are now getting to be very out of date (ubuntu is still shipping with
emacs 23.1!) and I'm finding I'm running with more and more packages
that are not from the deb repositories in order to get recent stable
versions. As my emacs environment is pretty stable and I don't tend to
install many new packages from the deb repositories, I'm seriously
considering just uninstalling the whole lot and keeping my own branches
of what I use and building manually.

Tim

-- 
tcross (at) rapttech dot com dot au


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-04 22:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04  2:56 Compiling emacs 24 under Debian Richard Riley
2011-01-04  3:23 ` Tim X
2011-01-04 10:51   ` Richard Riley
2011-01-04 22:53     ` Tim X

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.