[Pkg-jed-devel] byte compiling sl files

G. Milde g.milde@web.de
Mon, 25 Apr 2005 12:57:28 +0200


On 24.04.05, Rafael Laboissiere wrote:
 
> ... I am finishing now a new implementation for install-time generation
> of the slc files.  As you mentioned in a previous post, every time the
> jed-common package is updated, the .sl files of the add-on packages
> (like jed-extra) must be recompiled. Here is how the scheme works (this
> is roughly similar to emacsen-common's scheme, but much simpler):
> 
> 1) Each package needing byte-compiling must put a script in
>    /usr/share/jed/compile/.  This script must be executable and accept an
>    argument that is either "install" or "remove".
>    
> 2) This script must be called in both postinst and prerm with the
>    appropriate argument.
>    
> 3) The jed-common package will run all the scripts present in
>    /usr/share/jed/compile/ in its postinst and prerm.
>    
> I will soon commit the changes in the jed-common and jed-extra packages
> for implementing this.  Comments are welcome.

I'd suggest to use make_ini for the byte-compiling. 

> 1) Each package needing byte-compiling

     * can do this in the postinst script with:
     
         cd <dir where the file is installed, e.g. Jed_Site_Library>
         jed --batch -f 'byte_compile_file("<myfile.sl>", 0)'
       
       (this is the fast way) or 
         
         jed --batch -l make_ini.sl
         
       (this will also incorporate the tm-documentation)  
     
     * must remove <myfile.slc> when it is removed. 
     
> 2) not needed.
     
> 3) The jed-common package will run 

     cd <Jed_Site_Library>
     jed --batch -l make_ini.sl

     in its postinst script to update the slc files and the documentation
     of extra packages.

     (I can add dfa-syntax generation support to make_ini if this is
      required)
     

Packages that add a .sl file to Jed_Site_Library must make sure, that it
is "byte-compilable".

Removing jed-common will not remove files of other packages (be they *.sl
or *.slc). (But re-installing or updating jed-common will overwrite an
existing *.slc with a new byte-compiled version.)

Isn't this far easier than a directory of scripts?

Guenter


-- 
G.Milde web.de