MozillaZine

How do you add an extension to a build?

Discussion about official Mozilla Firefox builds
Magus
 
Posts: 2022
Joined: November 28th, 2002, 11:39 am
Location: that-a-way ->
May 30th, 2004, 2:32 pm

Post Posted May 30th, 2004, 2:32 pm

I would like to somehow add an extension to a build automatically when I build it, instead of installing it afterwards.

Is this possible without a ton of editing?
For every action there is an equal and opposite criticism.

Lost User 23429
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm
May 30th, 2004, 2:38 pm

Post Posted May 30th, 2004, 2:38 pm

I think this is the option(with a few choices) that you use in the .mozconfig to use the extensions. But I am not sure about all the choices that one can use while building.

Code: Select all
ac_add_options --enable-extensions=default,-irc,-venkman,-wallet


A seasoned builder might help you better. I am trying to build firefox for the first time. Wish me luck.

Magus
 
Posts: 2022
Joined: November 28th, 2002, 11:39 am
Location: that-a-way ->
May 30th, 2004, 9:01 pm

Post Posted May 30th, 2004, 9:01 pm

Nonono, not those extensions, I mean something like QuickPrefs (the one I want to add)
For every action there is an equal and opposite criticism.

Xu

User avatar
 
Posts: 1256
Joined: March 12th, 2004, 4:00 am
Location: Salt Lake City, Ut
May 31st, 2004, 4:30 pm

Post Posted May 31st, 2004, 4:30 pm

Might be able to use these somewhere in a batch script to install them?
http://www.mozilla.org/projects/firefox ... tions.html

I haven't tried any of them with the recent builds to know if they work yet or not. :-)

Magus
 
Posts: 2022
Joined: November 28th, 2002, 11:39 am
Location: that-a-way ->
May 31st, 2004, 7:23 pm

Post Posted May 31st, 2004, 7:23 pm

Those don't seem to work yet. :(
For every action there is an equal and opposite criticism.

Sephirot

User avatar
 
Posts: 239
Joined: June 15th, 2004, 7:56 am
Location: Germany
October 16th, 2004, 10:58 am

Post Posted October 16th, 2004, 10:58 am

*push*

I'll try to make it like it is done with the default firefox theme (classic skin). Let's see if it works ...
Author of Bookmarks Menu Button and other

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.8pre) Gecko/20100111 Firefox/3.5.8pre (.NET CLR 3.5.30729) (Sephiroth/SSE2) <-- build with MS VC++ 2008 Express Edition on Win 7 x64

Sephirot

User avatar
 
Posts: 239
Joined: June 15th, 2004, 7:56 am
Location: Germany
October 17th, 2004, 9:10 am

Post Posted October 17th, 2004, 9:10 am

it works :D
There is still one little problem and I hope I can fix this. When everything works fine, I'll post how I did it.
Author of Bookmarks Menu Button and other

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.8pre) Gecko/20100111 Firefox/3.5.8pre (.NET CLR 3.5.30729) (Sephiroth/SSE2) <-- build with MS VC++ 2008 Express Edition on Win 7 x64

Sephirot

User avatar
 
Posts: 239
Joined: June 15th, 2004, 7:56 am
Location: Germany
October 19th, 2004, 2:11 pm

Post Posted October 19th, 2004, 2:11 pm

here is my shell script (place it under 'browser/app/profile/extensions') which does a lot of work.
With the new build-in extensions you have to use a new clean profile or it may not work correctly.

How to do it:
1.) create a subfolder in browser/app/profile/extensions named like the EXT-ID
2.) copy the extensions install.rdf into this folder
3.) extract the extsions jar package into this directory
4.) move all files and folders which are in a folder named like the ext shortname into the next upper directory
examples: move EXT-ID/content/ieview/*.* to EXT-ID/content/*.*
move EXT-ID/locale/en-US/ieview/*.* to EXT-ID/locale/*.*
move EXT-ID/skin/SKINNAME/ieview/*.* to EXT-ID/skin/SKINNAME/*.*
5.) delete the last empty folders
6.) now run this script
usage: script.sh /EXT_ID EXT_SHORTNAME
example: sh script.sh \{AE37D527-6604-461c-8102-975CF8053A2F} bbcode



Code: Select all
# This script will create a jar.mn, install.rdf.in from of install.rdf and a makefile for a given firefox extension
# place it under browser/app/profile/extensions
# two arguments are needed: 1st ist the ext-path (usually '/EXT-ID' NO '/' at the end plz!) and the 2nd is the shortname of the extensions (e.g. 'bbcode')
# But you have to do some work before using this script:
# 1.) create a subfolder in browser/app/profile/extensions named like the EXT-ID
# 2.) copy the extensions install.rdf into this folder
# 3.) extract the extsions jar package into this directory
# 4.) move all files and folders which are in a folder named like the ext shortname into the next upper directory
# examples:    move EXT-ID/content/ieview/*.* to EXT-ID/content/*.*
#      move EXT-ID/locale/en-US/ieview/*.* to EXT-ID/locale/*.*
#      move EXT-ID/skin/SKINNAME/ieview/*.* to EXT-ID/skin/SKINNAME/*.*
# 5.) delete the last empty folders (named like the extension, e.g. ieview)
# 6.) now run this script
#
# USE IT IS ONLY FOR EXTENSTIONS AND NOT FOR THEMES!

if [ ! $# -eq 2 ]
then
   echo "usage:      $0 EXT-PATH(usually '\EXT-ID') EXT-SHORTNAME"
   echo "example:   $0 \{AE37D527-6604-461c-8102-975CF8053A2F}   bbcode"
   exit 1
fi

cd $1   #goto extension dir
#rename install.rdf but first check if it exists and not already renamed
if [ -f install.rdf ]
then
   mv install.rdf install.rdf.in
else
   if [ ! -f install.rdf.in ]
   then
      echo "$1/install.rdf is missing"
   else
      echo "$1/install.rdf already renamed"
   fi
fi

if ! [ -f jar.mn ]
then
   if [ -f content/contents.rdf ]
   then
      sed -i -e 's/:extension="true"/:extension="false"/' content/contents.rdf   #find the obsolete extension=true entry and make it to false
   else
      echo "No content/contents.rdf found. Please check your Extension."
      exit 2
   fi
   echo "$2.jar:" > jar.mn   #1st line of jar.mn
   find content -type f -printf +%H/$2/%P\(%p\)\\n >> jar.mn   #a special search cmd only for the content-folder
   #first I used one find command to create jar.mn but there where problems with subfolders inside the content folder and the old cmd messed up the final jar
   find -ipath './skin/*' -type f -mindepth 2 -printf +%h/$2/%f\(%P\)\\n >> jar.mn      #locale files
   find -ipath './locale/*' -type f -mindepth 2 -printf +%h/$2/%f\(%P\)\\n >> jar.mn   #skin files
   sed -i -e 's/\.\///' -e 's/+/+ /' -e 's/(/\t\t\t (/' jar.mn      #some corrections
else
   echo "jar.mn already present"
fi

#now let's make the makefile.in
if [ ! -f Makefile.in ]
then
   echo "#" > Makefile.in
   echo "# The contents of this file are subject to the Mozilla Public" >> Makefile.in
   echo "# License Version 1.1 (the "License"); you may not use this file" >> Makefile.in
   echo "# except in compliance with the License. You may obtain a copy of" >> Makefile.in
   echo "# the License at http://www.mozilla.org/MPL/" >> Makefile.in
   echo "#" >> Makefile.in
   echo "# Software distributed under the License is distributed on an \"AS" >> Makefile.in
   echo "# IS\" basis, WITHOUT WARRANTY OF ANY KIND, either express or" >> Makefile.in
   echo "# implied. See the License for the specific language governing" >> Makefile.in
   echo "# rights and limitations under the License." >> Makefile.in
   echo "#" >> Makefile.in
   echo "# The Original Code is mozilla.org code." >> Makefile.in
   echo "#" >> Makefile.in
   echo "# Contributor(s): " >> Makefile.in
   echo "#" >> Makefile.in
   echo "" >> Makefile.in
   echo "DEPTH      = ../../../../.." >> Makefile.in
   echo "topsrcdir   = @top_srcdir@" >> Makefile.in
   echo "srcdir      = @srcdir@" >> Makefile.in
   echo "VPATH      = @srcdir@" >> Makefile.in
   echo "" >> Makefile.in
   echo "include \$(DEPTH)/config/autoconf.mk" >> Makefile.in
   echo "include \$(topsrcdir)/config/rules.mk" >> Makefile.in
   echo "" >> Makefile.in
   echo "FILES := \\" >> Makefile.in
   echo "   install.rdf \\" >> Makefile.in
   echo "   \$(NULL)" >> Makefile.in
   echo "" >> Makefile.in
   echo "libs::" >> Makefile.in
   echo "   \$(PERL) \$(MOZILLA_DIR)/config/preprocessor.pl \$(DEFINES) \$(ACDEFINES) \$(srcdir)/install.rdf.in > install.rdf" >> Makefile.in
   echo "   \$(INSTALL) \$(FILES) \$(DIST)/bin/defaults/profile/extensions/$1" >> Makefile.in
   echo "" >> Makefile.in
   echo "install::" >> Makefile.in
   echo "   \$(SYSINSTALL) \$(IFLAGS1) \$(FILES) \$(DESTDIR)\$(mozappdir)/defaults/profile/extensions/$1" >> Makefile.in
   echo "" >> Makefile.in
else
   echo "Makefile.in already exists"
fi
#End Of Creating Makefile.in (hm, is there a better way?)
cd ..

if ! grep -q $1 installed-extensions.txt   #check if the extension is already listet in installed-extensions.txt
then
   echo "extension,$1" >> installed-extensions.txt   #now append this extension to installed-extensions.txt
   sed -i -e 's/\///' installed-extensions.txt      #just to be shure that there is no / at the end of the line
else
   echo "Extension $1 already added to installed-extensions.txt"
fi

if ! grep -q $1 Makefile.in         #check if the extension is already listet in makefile.in
then
   sed -i -e "s/\(DIRS = .*\\\\\)$/\1\n\t$1 \\\\/" Makefile.txt   #will add the extension, if there are already other exts before
   sed -i -e "s/\(DIRS = .*\}\)$/\1 \\\\\n\t$1/" Makefile.txt   #will add the extension, if it's the first (beside the default theme)
else
   echo "Extension $1 already added to Makefile.in"
fi


edit:
04.11.04: fixed two problems with the script
Last edited by Sephirot on November 3rd, 2004, 4:21 pm, edited 3 times in total.
Author of Bookmarks Menu Button and other

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.8pre) Gecko/20100111 Firefox/3.5.8pre (.NET CLR 3.5.30729) (Sephiroth/SSE2) <-- build with MS VC++ 2008 Express Edition on Win 7 x64

green13
 
Posts: 82
Joined: February 28th, 2004, 9:59 am
October 31st, 2004, 9:57 am

Post Posted October 31st, 2004, 9:57 am

Sephirot wrote:here is my shell script (place it under 'browser/app/profile/extensions') which does a lot of work.
With the new build-in extensions you have to use a new clean profile or it may not work correctly.

How to do it:
1.) create a subfolder in browser/app/profile/extensions named like the EXT-ID
2.) copy the extensions install.rdf into this folder
3.) extract the extsions jar package into this directory
4.) move all files and folders which are in a folder named like the ext shortname into the next upper directory
examples: move EXT-ID/content/ieview/*.* to EXT-ID/content/*.*
move EXT-ID/locale/en-US/ieview/*.* to EXT-ID/locale/*.*
move EXT-ID/skin/SKINNAME/ieview/*.* to EXT-ID/skin/SKINNAME/*.*
5.) delete the last empty folders
6.) now run this script
usage: script.sh /EXT_ID EXT_SHORTNAME
example: sh script.sh \{AE37D527-6604-461c-8102-975CF8053A2F} bbcode


At what point would one insert this into their build script? Mine, for example goes like this:

1) pull source
2) patch source
3) make source
4) package source
5) distribute build (ftp)

Could it be called and run during the patch session?

Also, is it possible to use this for multiple extensions, i.e make a new subfolder under browser/app/profile/extensions for each extension and then call each one separately - something like
sh script.sh \{AE37D527-6604-461c-8602-975CF8053A2F} ext 1
sh script.sh \{AE37D527-6604-461c-8109-975CF8053A2F} ext 2
sh script.sh \{AE37D527-6604-461c-8102-975CF8653A2F} ext 3

GrailKnight

User avatar
 
Posts: 2350
Joined: January 5th, 2004, 5:40 am
Location: Pennsylvania, USA
October 31st, 2004, 10:37 am

Post Posted October 31st, 2004, 10:37 am

Seems quicker just to use the extension manager or I could be wrong.
"There is nothing more deceptive than an obvious fact". - Sherlock Holmes

Sephirot

User avatar
 
Posts: 239
Joined: June 15th, 2004, 7:56 am
Location: Germany
October 31st, 2004, 10:38 am

Post Posted October 31st, 2004, 10:38 am

green13 wrote:At what point would one insert this into their build script? Mine, for example goes like this:

1) pull source
2) patch source
3) make source
4) package source
5) distribute build (ftp)

Could it be called and run during the patch session?

If you do the things which should be done before running the script, yes. But I think you only need to do this once, except the \extensions\makefile.in gets lost or there are files added or removed from the extension.



green13 wrote:Also, is it possible to use this for multiple extensions, i.e make a new subfolder under browser/app/profile/extensions for each extension and then call each one separately - something like
sh script.sh \{AE37D527-6604-461c-8602-975CF8053A2F} ext 1
sh script.sh \{AE37D527-6604-461c-8109-975CF8053A2F} ext 2
sh script.sh \{AE37D527-6604-461c-8102-975CF8653A2F} ext 3

I think it wouldn't work, at least not with my script because you would need an other jar package and a install.rdf containg the stuff for all three extenesions. And I guess there will be problems with the extensions itself and the relative paths that are used.

One folder for each extension and doing the work only once should be no big deal. :)
Author of Bookmarks Menu Button and other

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.8pre) Gecko/20100111 Firefox/3.5.8pre (.NET CLR 3.5.30729) (Sephiroth/SSE2) <-- build with MS VC++ 2008 Express Edition on Win 7 x64

Sephirot

User avatar
 
Posts: 239
Joined: June 15th, 2004, 7:56 am
Location: Germany
October 31st, 2004, 10:43 am

Post Posted October 31st, 2004, 10:43 am

GrailKnight wrote:Seems quicker just to use the extension manager or I could be wrong.

Would you share your wisdom with me? ;)
It looks like a lot of work, but it isn't. It took me more time to wrote this script than doing the stuff manually. :lol:
Author of Bookmarks Menu Button and other

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.8pre) Gecko/20100111 Firefox/3.5.8pre (.NET CLR 3.5.30729) (Sephiroth/SSE2) <-- build with MS VC++ 2008 Express Edition on Win 7 x64

varun21

User avatar
 
Posts: 62
Joined: October 31st, 2004, 9:50 am
April 7th, 2006, 7:24 pm

Post Posted April 7th, 2006, 7:24 pm

seems like all these extensions you build would go into the firefox profile. I want to build them for the global extensions directory. any way out?
Cheers!
Editor: Binary Turf

Return to Firefox Builds


Who is online

Users browsing this forum: chaat, supergirl260 and 20 guests