diff options
author | Ruben Rodriguez <ruben@gnu.org> | 2015-03-08 15:20:27 +0000 |
---|---|---|
committer | Ruben Rodriguez <ruben@gnu.org> | 2015-03-08 15:20:27 +0000 |
commit | 8e41348edab95d3ddad0cce56be3876443c55275 (patch) | |
tree | ccff7f79430a998a8025fd4028c8be4215e73096 | |
parent | 49f69726e55a719163f1c4483932cb82c2bea901 (diff) |
Added buildscripts and needed changes to crosscompile packages for MacOS, Windows and Android
-rw-r--r-- | data/buildscripts/build-android.sh | 33 | ||||
-rw-r--r-- | data/buildscripts/build-mac.sh | 15 | ||||
-rw-r--r-- | data/buildscripts/build-windows.sh | 13 | ||||
-rw-r--r-- | data/buildscripts/mozconfig-android | 31 | ||||
-rw-r--r-- | data/buildscripts/mozconfig-mac | 54 | ||||
-rw-r--r-- | data/buildscripts/mozconfig-windows | 23 | ||||
-rw-r--r-- | data/buildscripts/toolchain-android.sh | 27 | ||||
-rw-r--r-- | data/buildscripts/toolchain-macos.sh | 41 | ||||
-rw-r--r-- | data/buildscripts/toolchain-windows.sh | 79 | ||||
-rw-r--r-- | data/preferences_vendor.xml | 69 | ||||
-rw-r--r-- | data/settings.js | 13 | ||||
-rw-r--r-- | makeicecat | 132 |
12 files changed, 514 insertions, 16 deletions
diff --git a/data/buildscripts/build-android.sh b/data/buildscripts/build-android.sh new file mode 100644 index 0000000..6fc08ec --- /dev/null +++ b/data/buildscripts/build-android.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e + +apt-get -q -y --force-yes install openjdk-7-jdk ant mercurial ccache +apt-get -q -y --force-yes build-dep firefox + +export PATH=$PATH:$PWD/android-sdk-linux/tools:$PWD/android-sdk-linux/build-tools:$PWD/android-sdk-linux/platform-tools:/usr/local/bin + +pushd ./python/compare-locales/ +python setup.py build +python setup.py install +install -m 755 scripts/* /usr/local/bin +popd + +apt-get -q -y --force-yes install zip unzip yasm + +rm -rf obj-android + +cp ../../data/buildscripts/mozconfig-android .mozconfig + +rm extensions/gnu/abouticecat* -rf + +./mach build + +pushd obj-android/mobile/android/locales +#for loc in $(cat ../../../../mobile/android/locales/maemo-locales); do +for loc in es-ES ; do + LOCALE_MERGEDIR=$PWD/merge-$loc make merge-$loc LOCALE_MERGEDIR=$PWD/merge-$loc + make LOCALE_MERGEDIR=$PWD/merge-$loc chrome-$loc LOCALE_MERGEDIR=$PWD/merge-$loc +done +popd + +./mach package diff --git a/data/buildscripts/build-mac.sh b/data/buildscripts/build-mac.sh new file mode 100644 index 0000000..fa467d5 --- /dev/null +++ b/data/buildscripts/build-mac.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +apt-get -q -y --force-yes install zip unzip yasm + +rm -rf obj-macos + +cp ../../data/buildscripts/mozconfig-macos .mozconfig + +./mach build 2>&1 |tee mach-macos-build.log + +./mach package 2>&1 |tee mach-macos-package.log + diff --git a/data/buildscripts/build-windows.sh b/data/buildscripts/build-windows.sh new file mode 100644 index 0000000..723ce26 --- /dev/null +++ b/data/buildscripts/build-windows.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +apt-get -q -y --force-yes install zip unzip yasm + +rm -rf obj-windows + +cp ../../data/buildscripts/mozconfig-windows .mozconfig + +./mach build +./mach package diff --git a/data/buildscripts/mozconfig-android b/data/buildscripts/mozconfig-android new file mode 100644 index 0000000..82bd17f --- /dev/null +++ b/data/buildscripts/mozconfig-android @@ -0,0 +1,31 @@ +# Build Firefox for Android: +ac_add_options --enable-application=mobile/android +ac_add_options --target=arm-linux-androideabi +mk_add_options MOZ_OBJDIR=./obj-android +ac_add_options --with-android-version=9 + +ac_add_options --enable-update-channel=gnuzilla + +ac_add_options --disable-updater +ac_add_options --disable-crashreporter +ac_add_options --disable-maintenance-service +ac_add_options --disable-tests + +#ac_add_options --enable-elf-hack +#ac_add_options --enable-stdcxx-compat +#ac_add_options --with-system-zlib +#ac_add_options --with-android-gnu-compiler-version=4.7 + +#mk_add_options 'export MOZ_CHROME_MULTILOCALE=en-US cs da de es-ES fi fr ja ko it nb-NO nl pl pt-BR pt-PT ru sk sv-SE zh-CN zh-TW' +mk_add_options 'export MOZ_CHROME_MULTILOCALE=es-ES' + +mk_add_options 'export L10NBASEDIR=/home/ruben/git/gnuzilla/output/icecat-31.5.0/l10n' +ac_add_options --with-l10n-base=/home/ruben/git/gnuzilla/output/icecat-31.5.0/l10n + +#ac_add_options --with-android-sdk="$HOME/android-build/android-sdk-linux/platforms/android-21/" +ac_add_options --with-android-sdk="$HOME/android-build/android-sdk-linux/platforms/android-16/" +ac_add_options --with-android-ndk="$HOME/android-build/android-ndk-r8e" + +mk_add_options MOZ_MAKE_FLAGS=-j8 +ac_add_options --with-ccache + diff --git a/data/buildscripts/mozconfig-mac b/data/buildscripts/mozconfig-mac new file mode 100644 index 0000000..a6be1b0 --- /dev/null +++ b/data/buildscripts/mozconfig-mac @@ -0,0 +1,54 @@ +export CROSS_COMPILE=1 + +SYSROOTDIR=/usr/lib/apple/SDKs/MacOSX10.6.sdk +ROOTDIR="/usr/local/bin" +FLAGS="-arch i386 -isysroot $SYSROOTDIR" + +# Ideally we use the patch provided in +# https://bugzilla.mozilla.org/show_bug.cgi?id=933071 to get rid of our path +# symlinks but for some reason that does not work. While Firefox is not +# complaining with this patch on compile time anymore it won't start... +# CROSS_PRIVATE_FRAMEWORKS=$SYSROOTDIR/System/Library/PrivateFrameworks + +# Needed for our otool patch +TOOLCHAIN_PREFIX=x86_64-apple-darwin10- + +CC="$ROOTDIR/x86_64-apple-darwin10-clang $FLAGS" +CXX="$ROOTDIR/x86_64-apple-darwin10-clang++ $FLAGS" + +# We need them as configure is looking for i386-apple-darwin10-* which is not +# existing. +RANLIB=$ROOTDIR/x86_64-apple-darwin10-ranlib +AR=$ROOTDIR/x86_64-apple-darwin10-ar +AS=$ROOTDIR/x86_64-apple-darwin10-as +LD=$ROOTDIR/x86_64-apple-darwin10-ld +STRIP=$ROOTDIR/x86_64-apple-darwin10-strip + +mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-macos +mk_add_options MOZ_APP_DISPLAYNAME="IceCat" +mk_add_options MOZILLA_OFFICIAL=1 +mk_add_options BUILD_OFFICIAL=1 + +ac_add_options --target=i386-apple-darwin10 +ac_add_options --enable-application=browser +ac_add_options --enable-strip +ac_add_options --enable-official-branding +ac_add_options --enable-optimize +ac_add_options --disable-debug + +# See above for a reason why this is currently disabled +# ac_add_options --with-macos-private-frameworks=$CROSS_PRIVATE_FRAMEWORKS +#ac_add_options --disable-updater +ac_add_options --enable-update-packaging +# We do not use signed MAR files yet (Mozilla uses them on Windows only). +ac_add_options --disable-verify-mar +ac_add_options --disable-crashreporter +ac_add_options --disable-maintenance-service +ac_add_options --disable-webrtc +ac_add_options --disable-tests +# ac_add_options --disable-ctypes + +ac_add_options --without-intl-api + +mk_add_options MOZ_MAKE_FLAGS=-j8 +ac_add_options --with-ccache diff --git a/data/buildscripts/mozconfig-windows b/data/buildscripts/mozconfig-windows new file mode 100644 index 0000000..4b7193c --- /dev/null +++ b/data/buildscripts/mozconfig-windows @@ -0,0 +1,23 @@ +#Specify the cross compile +export CROSS_COMPILE=1 +ac_add_options --enable-application=browser +ac_add_options --target=i686-w64-mingw32 +ac_add_options --enable-default-toolkit=cairo-windows +mk_add_options MOZ_OBJDIR=./obj-windows + +ac_add_options --disable-debug +ac_add_options --disable-optimize +ac_add_options --disable-tests + +ac_add_options --disable-updater +ac_add_options --disable-crashreporter +ac_add_options --disable-maintenance-service +ac_add_options --disable-webrtc +ac_add_options --without-intl-api + +# ac_add_options --disable-accessibility # uncomment if you don't have widl installed + +# Use parallel build. Adjust number of processes for your setup. +mk_add_options MOZ_MAKE_FLAGS=-j8 +ac_add_options --with-ccache + diff --git a/data/buildscripts/toolchain-android.sh b/data/buildscripts/toolchain-android.sh new file mode 100644 index 0000000..f50cbc4 --- /dev/null +++ b/data/buildscripts/toolchain-android.sh @@ -0,0 +1,27 @@ +#!/bin/bash +#https://wiki.mozilla.org/Mobile/Fennec/Android/Detailed_build_instructions#Linux +set -e + +apt-get -q -y --force-yes install openjdk-7-jdk ant mercurial ccache +apt-get -q -y --force-yes build-dep firefox + +WD=android-build +rm -rf $WD +mkdir $WD +cd $WD + +wget https://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2 +tar -xjf android-ndk-r8e-linux-x86.tar.bz2 + +wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz +tar -xzf android-sdk_r24.0.2-linux.tgz + +while true; do echo y; sleep 1; done |./android-sdk-linux/tools/android update sdk -u +while true; do echo y; sleep 1; done |./android-sdk-linux/tools/android update adb + +echo export PATH=$PATH:$PWD/android-sdk-linux/tools:$PWD/android-sdk-linux/build-tools:$PWD/android-sdk-linux/platform-tools +export PATH=$PATH:$PWD/android-sdk-linux/tools:$PWD/android-sdk-linux/build-tools:$PWD/android-sdk-linux/platform-tools + +pkill adb + +echo DONE diff --git a/data/buildscripts/toolchain-macos.sh b/data/buildscripts/toolchain-macos.sh new file mode 100644 index 0000000..20cb31c --- /dev/null +++ b/data/buildscripts/toolchain-macos.sh @@ -0,0 +1,41 @@ +set -e + +WD=macos-build +apt-get -q -y --force-yes install cmake rsync zlib1g-dev libssl-dev mkisofs + +rm -rf $WD +mkdir $WD +cd $WD +#wget http://ppa.launchpad.net/flosoft/cross-apple/ubuntu/pool/main/a/apple-uni-sdk-10.6/apple-uni-sdk-10.6_20110407-0.flosoft1_i386.deb +wget http://ppa.launchpad.net/flosoft/cross-apple/ubuntu/pool/main/a/apple-uni-sdk-10.6/apple-uni-sdk-10.6_20110407-0.flosoft1_amd64.deb +dpkg -i *.deb + +wget https://mingw-and-ndk.googlecode.com/files/multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz +unp multiarch-darwin* +rm apple-osx/man -rf +cp apple-osx/* /usr/local/ -a +# For OpenSSL +ln -sf /usr/local/bin/apple-osx-gcc /usr/local/bin/i686-apple-darwin11-cc +#For gmp, need to trick it so it knows we're doing a 64 bit build +for i in /usr/local/bin/i686-apple-darwin11-*; do j=`echo $i | sed 's/i686/x86_64/'`; ln -fs $i $j; done; + +wget https://people.torproject.org/~mikeperry/mirrors/sources/x86_64-apple-darwin10.tar.xz +unp x86_64-apple-darwin10.tar.xz +cp x-tools/x86_64-apple-darwin10/* /usr/local/ -a +# FIXME: path hacks: +mkdir -p /System/Library/ || true +ln -fs /usr/lib/apple/SDKs/MacOSX10.6.sdk /usr/lib/apple/SDKs/MacOSX10.5.sdk +ln -fs /usr/lib/apple/SDKs/MacOSX10.6.sdk /usr/lib/apple/SDKs/MacOSX10.5.sdk +ln -fs /usr/lib/apple/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/ /System/Library/ +ln -fs /usr/lib/apple/SDKs/MacOSX10.6.sdk/System/Library/PrivateFrameworks/ /System/Library/ +ln -fs /usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/libstdc++.6.dylib /usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/libstdc++.dylib + +git clone https://git.torproject.org/builders/tor-browser-bundle.git +git clone https://github.com/vasi/libdmg-hfsplus.git +cd libdmg-hfsplus +git checkout dfd5e5cc3dc1191e37d3c3a6118975afdd1d7014 +git am ../tor-browser-bundle/gitian/patches/libdmg.patch +cmake CMakeLists.txt +cd dmg +make + diff --git a/data/buildscripts/toolchain-windows.sh b/data/buildscripts/toolchain-windows.sh new file mode 100644 index 0000000..d885831 --- /dev/null +++ b/data/buildscripts/toolchain-windows.sh @@ -0,0 +1,79 @@ +#!/bin/bash +set -e +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +apt-get -q -y --yes --force-yes install libmpfrc++-dev libmpc-dev zlib1g-dev + +WD=$HOME/mingw-w64-build +rm -rf $WD +mkdir $WD +cp spec $WD/msvcr100.spec + +cd $WD +wget http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.bz2 +tar -jxf binutils-2.24.tar.bz2 +wget http://gcc.fyxm.net/releases/gcc-4.9.1/gcc-4.9.1.tar.bz2 +tar -jxf gcc-4.9.1.tar.bz2 +git clone git://git.code.sf.net/p/mingw-w64/mingw-w64 +cd mingw-w64 +git checkout 469ed5d227202b373409c8a3b4c1358be39b9983 +cd .. +git clone https://git.torproject.org/builders/tor-browser-bundle.git +PATCHES=$WD/tor-browser-bundle/gitian/patches + +# Building binutils +cd $WD +cd binutils-2.24 +sed 's/= extern_rt_rel_d;/= extern_rt_rel_d;\n memset (extern_rt_rel_d, 0, PE_IDATA5_SIZE);/' -i ld/pe-dll.c +patch -p1 < $PATCHES/enable-reloc-section-ld.patch +patch -p1 < $PATCHES/peXXigen.patch +cd .. +mkdir binutils-2.24-build32 && cd binutils-2.24-build32 +../binutils-2.24/configure --prefix=/usr/local/ --target=i686-w64-mingw32 --disable-multilib +make -j7 +make install + +# Building mingw-w64 +cd $WD +mkdir mingw-w64-headers32 && cd mingw-w64-headers32 +../mingw-w64/mingw-w64-headers/configure --host=i686-w64-mingw32 --prefix=/usr/local/i686-w64-mingw32/ --enable-sdk=all --enable-secure-api --enable-idl +make install + +# First stage of gcc compilation +cd $WD +# We don't want to link against msvcrt.dll due to bug 9084. +sed 's/msvcrt/msvcr100/' -i $WD/msvcr100.spec +# Linking libgcc against msvcrt is hard-coded... +sed 's/msvcrt/msvcr100/' -i $WD/gcc-4.9.1/gcc/config/i386/t-mingw-w32 $WD/gcc-4.9.1/libgcc/config/i386/t-mingw32 +mkdir gcc-4.9.1-mingw32 && cd gcc-4.9.1-mingw32 +# LDFLAGS_FOR_TARGET does not work for some reason. Thus, we take +# CFLAGS_FOR_TARGET. +export CFLAGS_FOR_TARGET="-specs=$WD/msvcr100.spec -Wl,--nxcompat -Wl,--dynamicbase" +../gcc-4.9.1/configure --prefix=/usr/local/ --target=i686-w64-mingw32 --with-gnu-ld --with-gnu-as --enable-languages=c,c++ --disable-multilib +make all-gcc -j7 +make install-gcc + +# Building mingw-w64-crt32 +cd $WD +mkdir mingw-w64-crt32 && cd mingw-w64-crt32 +../mingw-w64/mingw-w64-crt/configure --host=i686-w64-mingw32 --prefix=/usr/local/i686-w64-mingw32/ +make -j7 +make install + +# Building widl32 +cd $WD +mkdir widl32 && cd widl32 +../mingw-w64/mingw-w64-tools/widl/configure --prefix=/usr/local --target=i686-w64-mingw32 +make -j7 +make install + +# Second stage of gcc compilation +cd $WD +cd gcc-4.9.1-mingw32 +make -j7 +make install +mkdir -p /usr/local/gcclibs +cp i686-w64-mingw32/libssp/.libs/libssp-0.dll /usr/local/gcclibs +cp i686-w64-mingw32/libgcc/shlib/libgcc_s_sjlj-1.dll /usr/local/gcclibs + +echo DONE diff --git a/data/preferences_vendor.xml b/data/preferences_vendor.xml new file mode 100644 index 0000000..3c0da56 --- /dev/null +++ b/data/preferences_vendor.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> + +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:gecko="http://schemas.android.com/apk/res-auto" + android:title="@string/pref_category_vendor" + android:enabled="false"> + + <org.mozilla.gecko.preferences.LinkPreference android:title="@string/pref_about_icecat" + url="about:" /> + + <org.mozilla.gecko.preferences.LinkPreference android:title="@string/pref_vendor_faqs" + url="http://libreplanet.org/wiki/Group:IceCat/FAQ"/> + + <org.mozilla.gecko.preferences.LinkPreference android:title="@string/pref_vendor_feedback" + url="https://lists.gnu.org/mailman/listinfo/bug-gnuzilla" /> + + <CheckBoxPreference android:key="android.not_a_preference.javascript.enabled" + android:defaultValue="true" + android:persistent="true" + android:title="Enable JavaScript"/> + + <CheckBoxPreference android:key="android.not_a_preference.browser.display.use_document_fonts" + android:defaultValue="false" + android:persistent="true" + android:title="Use system fonts"/> + + + <!-- <CheckBoxPreference android:key="android.not_a_preference.privacy.announcements.enabled" + android:title="@string/pref_show_product_announcements" + android:defaultValue="false" + android:persistent="true" /> + + <PreferenceCategory android:key="android.not_a_preference.datareporting.preferences" + android:title="@string/pref_category_datareporting"> + + <CheckBoxPreference android:key="toolkit.telemetry.enabled" + android:defaultValue="false" + android:title="@string/datareporting_telemetry_title" + android:summary="@string/datareporting_telemetry_summary" /> + + <CheckBoxPreference android:key="datareporting.crashreporter.submitEnabled" + android:title="@string/datareporting_crashreporter_title_short" + android:summary="@string/datareporting_crashreporter_summary" + android:defaultValue="false" /> + + <CheckBoxPreference android:key="app.geo.reportdata" + android:title="@string/datareporting_wifi_title" + android:summary="@string/datareporting_wifi_geolocation_summary" /> + + <org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.geo.learn_more" + android:title="@string/pref_learn_more" + url="https://location.services.mozilla.com/" /> + + <CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled" + android:title="@string/datareporting_fhr_title" + android:summary="@string/datareporting_fhr_summary2" + android:defaultValue="false" /> + + <org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.healthreport.link" + android:title="@string/datareporting_abouthr_title" + url="about:healthreport" /> + + </PreferenceCategory> +--> + +</PreferenceScreen> diff --git a/data/settings.js b/data/settings.js index 9fa663e..420defd 100644 --- a/data/settings.js +++ b/data/settings.js @@ -157,6 +157,19 @@ pref("font.default.x-western", "sans-serif"); pref ("extensions.webservice.discoverURL", "https://directory.fsf.org/wiki/GNU_IceCat"); pref ("extensions.getAddons.search.url", "https://directory.fsf.org/wiki/GNU_IceCat"); +// Mobile +pref("privacy.announcements.enabled", false); +pref("browser.snippets.enabled", false); +pref("browser.snippets.syncPromo.enabled", false); +pref("browser.snippets.geoUrl", "http://127.0.0.1/"); +pref("browser.snippets.updateUrl", "http://127.0.0.1/"); +pref("browser.snippets.statsUrl", "http://127.0.0.1/"); +pref("datareporting.policy.firstRunTime", 0); +pref("datareporting.policy.dataSubmissionPolicyVersion", 2); +pref("browser.webapps.checkForUpdates", 0); +pref("browser.webapps.updateCheckUrl", "http://127.0.0.1/"); +pref("app.faqURL", "http://libreplanet.org/wiki/Group:IceCat/FAQ"); + // PFS url pref("pfs.datasource.url", "http://gnuzilla.gnu.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%"); pref("pfs.filehint.url", "http://gnuzilla.gnu.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%"); @@ -251,9 +251,12 @@ sed "s/^MOZ_PKG_NAME\t.*/MOZ_PKG_NAME\t\t:= icecat/;" debian/build/config.mk -i ############################################################################### # Branding files -rm browser/branding/* -rf -cp -a $DATA/branding/ browser/branding/official -cp -a $DATA/branding/ browser/branding/nightly +rm browser/branding/* mobile/android/branding/* -rf +cp -a $DATA/branding/icecat/ browser/branding/official +cp -a $DATA/branding/icecat/ browser/branding/nightly +cp -a $DATA/branding/icecatmobile/ mobile/android/branding/official +cp -a $DATA/branding/icecatmobile/ mobile/android/branding/unofficial +cp -a $DATA/branding/icecatmobile/ mobile/android/branding/nightly cat << EOF > debian/config/branch.mk CHANNEL = release MOZ_WANT_UNIT_TESTS = 0 @@ -270,7 +273,7 @@ cp $DATA/abouthome -a browser/base/content sed '/mozilla.*png/d' -i ./browser/base/jar.mn # Delete stuff we don't use and that may contain trademaked logos -rm -rf ./browser/metro ./mobile ./addon-sdk/source/doc/static-files/media ./browser/themes/windows ./browser/themes/osx ./b2b +rm -rf ./browser/metro ./addon-sdk/source/doc/static-files/media ./b2g # Custom bookmarks cp $DATA/bookmarks.html.in browser/locales/generic/profile/bookmarks.html.in @@ -302,32 +305,49 @@ sed -i 's/<a\ href\=\"http\:\/\/www.mozilla.org\/\">Mozilla\ Project<\/a>/<a\ hr ############################################################################### # Replace Firefox branding -find -type d | grep firefox | xargs rename s/firefox/icecat/ -find -type f | grep firefox | xargs rename s/firefox/icecat/ -find -type f | grep Firefox | xargs rename s/Firefox/IceCat/ +find -type d | grep fennec | xargs prename s/fennec/icecatmobile/ +find -type f | grep fennec | xargs prename s/fennec/icecatmobile/ +find -type f | grep Fennec | xargs prename s/Fennec/IceCatMobile/ +find -type d | grep firefox | xargs prename -f s/firefox/icecat/ +find -type f | grep firefox | xargs prename -f s/firefox/icecat/ +find -type f | grep Firefox | xargs prename -f s/Firefox/IceCat/ echo "Running batch rebranding" SEDSCRIPT=" +s|marketplace.firefox.com|f-droid.org/repository/browse|g; +s/org.mozilla.firefox/org.gnu.icecat/g; +s/Adobe Flash/Flash/g; +s|addons.mozilla.org.*/mobile|directory.fsf.org/wiki/GNU_IceCat|g; +s|addons.mozilla.org.*/android|directory.fsf.org/wiki/GNU_IceCat|g; +s|support.mozilla.org.*/mobile|libreplanet.org/wiki/Group:IceCat/icecat-help|g; +s|fhr.cdn.mozilla.net.*mobile|127.0.0.1|g; +s/run-mozilla.sh/run-icecat.sh/g; +s/Firefox Marketplace/F-droid free software repository/g; +s|mozilla.com/plugincheck|$ADDONSURL|g; +s|www.mozilla.com/firefox/central|$INFOURL|g; +s|www.mozilla.*/legal/privacy.*html|$LEGALINFOURL|g; +s|www.mozilla.*/legal/privacy|$LEGALINFOURL|g; + s/Mozilla Firefox/GNU IceCat/g; s/firefox/icecat/g; +s/fennec/icecatmobile/g; s/Firefox/IceCat/g; +s/Fennec/IceCatMobile/g; s/FIREFOX/ICECAT/g; +s/FENNEC/ICECATMOBILE/g; s/ Mozilla / GNU /g; -s_PACKAGES/icecat_PACKAGES/firefox_g; -s/Adobe Flash/Flash/g; -s/run-mozilla.sh/run-icecat.sh/g; - -s^mozilla.com/plugincheck^$ADDONSURL^g; -s^www.mozilla.com/icecat/central^$INFOURL^g; -s^www.mozilla.com/legal/privacy^$LEGALINFOURL^g; +s|PACKAGES/icecat|PACKAGES/firefox|g; s/GNU Public/Mozilla Public/g; s/GNU Foundation/Mozilla Foundation/g; s/GNU Corporation/Mozilla Corporation/g; s/icecat.com/firefox.com/g; s/IceCat-Spdy/Firefox-Spdy/g; +s/icecat-accounts/firefox-accounts/g; +s/IceCatAccountsCommand/FirefoxAccountsCommand/g; +s|https://www.mozilla.org/icecat/?utm_source=synceol|https://www.mozilla.org/firefox/?utm_source=synceol|g; -s_www.gnu.org/software/gnuzilla/icecat-help_libreplanet.org/wiki/Group:IceCat/Help_g; +s|www.gnu.org/software/gnuzilla/icecat-help|libreplanet.org/wiki/Group:IceCat/Help|g; " find . -type f -not -iregex '.*changelog.*' -not -iregex '.*copyright.*' -execdir /bin/sed --follow-symlinks -i "$SEDSCRIPT" '{}' ';' @@ -363,6 +383,80 @@ sed 's/IceCat/Firefox/g; s/icecat/firefox/g' -i browser/components/migration/src # Copy js settings cat $DATA/settings.js >> browser/app/profile/icecat.js +sed "s/MOZ_PAY=1/MOZ_PAY=0/" -i browser/confvars.sh +sed "s/MOZ_APP_VENDOR=.*/MOZ_APP_VENDOR=GNU/" -i browser/confvars.sh +sed "s/MOZ_SERVICES_HEALTHREPORT=1/MOZ_SERVICES_HEALTHREPORT=0/" -i browser/confvars.sh +sed "s/MOZ_SERVICES_FXACCOUNTS=1/MOZ_SERVICES_FXACCOUNTS=0/" -i browser/confvars.sh +sed "s/MOZ_SERVICES_METRICS=1/MOZ_SERVICES_METRICS=0/" -i browser/confvars.sh +sed "s/MOZ_SERVICES_SYNC=1/MOZ_SERVICES_SYNC=0/" -i browser/confvars.sh +echo "MOZ_DATA_REPORTING=0" >> browser/confvars.sh +sed 's/mozilla-esr/gnu-esr/' -i browser/confvars.sh + +############################################################################### +# Mobile +############################################################################### + +sed "s/MOZ_APP_VERSION=.*/MOZ_APP_VERSION=$FFVERSION/" -i mobile/android/confvars.sh +sed "s/MOZ_APP_VENDOR=.*/MOZ_APP_VENDOR=GNU/" -i mobile/android/confvars.sh +sed "s/MOZ_PAY=1/MOZ_PAY=0/" -i mobile/android/confvars.sh +sed "s/MOZ_SERVICES_HEALTHREPORT=1/MOZ_SERVICES_HEALTHREPORT=0/" -i mobile/android/confvars.sh +sed "s/MOZ_SERVICES_FXACCOUNTS=1/MOZ_SERVICES_FXACCOUNTS=0/" -i mobile/android/confvars.sh +sed "s/MOZ_DATA_REPORTING=1/MOZ_DATA_REPORTING=0/" -i mobile/android/confvars.sh +cat << EOF >> mobile/android/confvars.sh + +MOZ_SERVICES_SYNC=0 +MOZ_SERVICES_METRICS=0 +MOZ_DEVICES=0 +MOZ_NATIVE_DEVICES=0 +MOZ_ANDROID_GOOGLE_PLAY_SERVICES=0 +EOF + +cat $DATA/settings.js >> mobile/android/app/mobile.js + +cat << EOF > mobile/locales/en-US/chrome/region.properties +browser.search.defaultenginename=DuckDuckGo +browser.search.order.1=DuckDuckGo +browser.search.order.2=Google +browser.search.order.3=Yahoo +EOF + +cp $DATA/preferences_vendor.xml mobile/android/base/resources/xml/preferences_vendor.xml + +sed '/public static void checkAndNotifyPolicy/ s/{/{ if(true) return;/; /private static void notifyDataPolicy/ s/{/{ if(true) return;/ ' mobile/android/base/DataReportingNotification.java -i + +cp -a $DATA/android-images/core/* mobile/android/themes/core/images/ +cp -a $DATA/android-images/resources mobile/android/base + +sed '/DISABLED/s/false/true/' -i mobile/android/base/background/announcements/AnnouncementsConstants.java.in + +############################################################################### +# Macos packaging +############################################################################### + +cat << EOF > ./build/package/mac_osx/pkg-dmg +#!/bin/sh +set -e +export LC_ALL=C + +cd \$2 +DMGFILE=\$4 + +# We need group readability for some Macs to be able to handle /Applications +# installation. Still unclear exactly why this is -- it is not dependent on +# OSX version... +find . -executable -exec chmod 750 {} \; +find . ! -executable -exec chmod 640 {} \; + +find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > /tmp/filelist.txt +find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> /tmp/filelist.txt + +mkisofs -D -V "\$6" -no-pad -R -apple -o /tmp/icecat-uncompressed.dmg -path-list /tmp/filelist.txt -graft-points -gid 20 -dir-mode 0750 -new-dir-mode 0750 + + +dmg dmg /tmp/icecat-uncompressed.dmg \$4 +rm /tmp/icecat-uncompressed.dmg +EOF + ############################################################################### # Extensions ############################################################################### @@ -377,7 +471,7 @@ EOF # Add extensions to manifest for EXTENSION in $(ls $DATA/extensions/); do -sed "/Browser Chrome Files/s%$%\n@BINPATH@/browser/extensions/$EXTENSION/*%" -i browser/installer/package-manifest.in +sed "/Browser Chrome Files/s%$%\n@BINPATH@/browser/extensions/$EXTENSION/*%" -i browser/installer/package-manifest.in mobile/android/installer/package-manifest.in #echo "DIRS += ['$EXTENSION']" >> browser/app/profile/extensions/moz.build #touch browser/app/profile/extensions/$EXTENSION/moz.build done @@ -391,6 +485,12 @@ libs:: cp -a \$(topsrcdir)/extensions/gnu/* \$(DIST)/icecat/browser/extensions/ EOF +cat << EOF >> mobile/android/app/Makefile.in +libs:: + mkdir -p \$(DIST)/bin/distribution + cp -a \$(topsrcdir)/extensions/gnu/ \$(DIST)/bin/distribution/extensions +EOF + #sed '/^make-package-internal:/ s%$%\n\tcp $(topsrcdir)/extensions.gnu/* $(DIST)/icecat/browser/extensions -a%' -i toolkit/mozapps/installer/packager.mk #sed '/972ce4c6/ s%$%\n/extensions.gnu/* @MOZ_ADDONDIR@/extensions%' -i debian/icecat.install.in |