source: devtools/firefox_customizer/firefox_customizer.sh

Last change on this file was 7703, checked in by Juanma, 15 months ago

update instructions

  • Property svn:executable set to *
File size: 4.1 KB
Line 
1###
2#This shell must be executed on a valid firefox src dir
3#Shell designed by "The other side"
4###
5
6APPNAME=firefoxESR
7BASEDIR=$PWD
8
9function run_tests()
10{
11        cd $BASEDIR
12        if [[ -f mozconfig || -f .mozconfig ]]
13        then
14                MOZCONFIG=1
15        fi
16
17        if [ -d browser/branding/unofficial ]
18        then
19                cd browser/branding/unofficial/locales
20                if [ -d ca ]
21                then
22                        CA=1
23                fi
24       
25                if [ -d es-ES ]
26                then
27                        ES=1
28                fi
29        else
30                UNOFFICIAL=1
31        fi
32        cd $BASEDIR
33
34}
35
36
37function generate_mozconfig()
38{
39        cd $BASEDIR
40        echo "#autogenerated mozconfig for Lliurex
41ac_add_options --with-pthreads
42ac_add_options --with-ccache
43ac_add_options \"--enable-optimize=-O3 -msse2 -mfpmath=sse\"
44ac_add_options --enable-application=browser
45ac_add_options --with-branding=browser/branding/unofficial
46##
47ac_add_options --enable-startup-notification
48ac_add_options --enable-official-branding
49ac_add_options --enable-strip
50ac_add_options --enable-js-shell
51ac_add_options --enable-profiling
52ac_add_options --enable-default-toolkit=cairo-gtk3
53##
54ac_add_options --disable-debug-symbols
55ac_add_options --disable-tests
56ac_add_options --disable-ipdl-tests
57ac_add_options --disable-maintenance-service
58ac_add_options --disable-updater
59ac_add_options --disable-tests
60ac_add_options --disable-debug
61ac_add_options --disable-crashreporter
62ac_add_options --disable-calendar
63export MOZ_APP_NAME=${APPNAME}
64export MOZ_APP_DISPLAYNAME=${APPNAME}
65
66mk_add_options MOZ_CO_PROJECT=browser
67#mk_add_options MOZILLA_OFFICIAL=1
68mk_add_options MOZ_MAKE_FLAGS=-j5
69mk_add_options AUTOCLOBBER=1
70mk_add_options MOZ_APP_NAME=${APPNAME}
71mk_add_options MOZ_APP_DISPLAYNAME=${APPNAME}
72        " > mozconfig
73        if [[ $BUILD_686 == 1 ]]
74        then
75                echo "##i686 build###
76export PKG_CONFIG_PATH="/var/chroot/linux32/usr/lib/i386-linux-gnu/pkgconfig:/var/chroot/linux32/usr/share/pkgconfig"
77export MOZ_LINUX_32_SSE2_STARTUP_ERROR=1
78CFLAGS=\"$CFLAGS -msse -msse2 -mfpmath=sse\"
79CXXFLAGS=\"$CXXFLAGS -msse -msse2 -mfpmath=sse\"
80#LDFLAGS='-L/var/chroot/linux32/usr/lib/i386-linux-gnu/ -L/var/chroot/linux32/lib/i386-linux-gnu/'
81if test `uname -m` = \"x86_64\"; then
82  CFLAGS=\"$CFLAGS -m32 -march=pentium-m\"
83  CXXFLAGS=\"$CXXFLAGS -m32 -march=pentium-m\"
84  ac_add_options --target=i686-pc-linux
85  ac_add_options --host=i686-pc-linux
86  ac_add_options --x-libraries=/usr/lib
87fi
88" >> mozconfig
89        fi
90}
91
92function modify_confvars()
93{
94        cd ${BASEDIR}/browser
95        sed -i "s/MOZ_APP_BASENAME=.*/MOZ_APP_BASENAME=$APPNAME/" confvars.sh
96        cd $BASEDIR
97}
98
99function set_branding()
100{
101        cd ${BASEDIR}/browser/branding/unofficial
102        cp ../aurora/*png .
103        cp ../aurora/*bmp .
104        cp ../aurora/*ico .
105        echo "# This Source Code Form is subject to the terms of the Mozilla Public
106        # License, v. 2.0. If a copy of the MPL was not distributed with this
107        # file, You can obtain one at http://mozilla.org/MPL/2.0/.
108        MOZ_APP_BASENAME=\"${APPNAME}\"
109        MOZ_APP_VENDOR=\"Mozilla\"
110        MOZ_APP_PROFILE=mozilla/${APPNAME,,}
111        MOZ_APP_NAME=firefoxESR" > configure.sh
112        cd locales/en-US
113        sed -i "s/Nightly/${APPNAME}/" brand.*
114        cd ..
115        rm -fr ca es-ES
116        cp en-US ca -R
117        cp en-US es-ES -R
118        cd $BASEDIR
119}
120
121function help()
122{
123        printf "Usage: $0 [OPTION]\n\n"
124        echo "  amd64"
125        printf "\tGenerates amd64 build\n"
126        echo "  i686"
127        printf "\tGenerates i686 build\n"
128        exit 0
129}
130
131#### MAIN ####
132
133[ $# -eq 0 ] && help
134
135if [[ $1 == "i686" ]]
136then
137        BUILD_686=1
138elif [[ $1 != "amd64" ]]
139then
140        help
141fi
142
143run_tests
144if [ $MOZCONFIG$CA$ES$UNOFFICIAL ]
145then
146        echo "Seems that this sources are modified."
147        echo "Report:"
148        echo "A mozconfig or .mozconfig is present:" $([ -z $MOZCONFIG ] &&  echo False ||  echo True)
149        echo "There's a ca dir in browser/branding/unofficial/locales:" $([ -z $CA ] &&  echo False ||  echo True)
150        echo "There's an es-ES dir in browser/branding/unofficial/locales:" $([ -z $ES ] &&  echo False ||  echo True)
151        echo "There's not an unofficial dir:" $([ -z $UNOFFICIAL ] &&  echo False ||  echo True)
152
153        exit 1
154fi
155
156generate_mozconfig
157modify_confvars
158set_branding
159echo "Firefox sources are now configured"
160echo "You could start the build by typing"
161echo "./mach build &6 ./mach-package"
162arch='x86_64'
163if [[ $1 == 'i686' ]]
164then
165        arch='i686'
166fi
167echo "When finished you must copy the content of \$BUILDDIR/obj-${arch}-pc-linux-gnu/dist/firefoxESR to the firefox-esr-${arch} folder of the svn"
Note: See TracBrowser for help on using the repository browser.