build (3868B)
1 #!/bin/sh -e 2 3 for p in *.patch 4 do 5 patch -p1 < "$p" 6 done 7 8 rm -f common/source_files/mozconfig 9 cp -r common/source_files/* ./ 10 11 # Remove libc header which conflicts with 7 or so Linux 12 # kernel headers. See: https://github.com/kisslinux/repo/issues/207 13 sed -i '/net\/if/d' \ 14 dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c 15 16 # Disabling Pocket 17 sed -i "s/'pocket'/#'pocket'/g" browser/components/moz.build 18 sed -i 's#SaveToPocket.init();#// SaveToPocket.init();#g' browser/components/BrowserGlue.jsm 19 20 # Remove Internal Plugin Certificates 21 sed "/if (aCert.organizationalUnit/,+3d" -i toolkit/mozapps/extensions/internal/XPIInstall.jsm 22 23 # allow SearchEngines option in non-ESR builds 24 sed -i 's#"enterprise_only": true,#"enterprise_only": false,#g' browser/components/enterprisepolicies/schemas/policies-schema.json 25 26 _settings_services_sed='s#firefox.settings.services.mozilla.com#f.s.s.m.c.qjz9zk#g' 27 28 # stop some undesired requests (https://gitlab.com/librewolf-community/browser/common/-/issues/10) 29 sed "$_settings_services_sed" -i browser/components/newtab/data/content/activity-stream.bundle.js 30 sed "$_settings_services_sed" -i modules/libpref/init/all.js 31 sed "$_settings_services_sed" -i services/settings/Utils.jsm 32 sed "$_settings_services_sed" -i toolkit/components/search/SearchUtils.jsm 33 34 # Build autoconf 2.13 for Firefox's sole use. 35 # See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642 36 ( 37 cd autoconf2.13 38 39 ./configure \ 40 --prefix="$PWD/../junk" \ 41 --program-suffix=-2.13 42 43 make 44 make install 45 ) 46 47 # Build yasm for Firefox's sole use. 48 # Firefox is the only package which needs it 49 # and upstream is kinda dead. 50 ( 51 cd yasm 52 53 ./configure \ 54 --prefix="$PWD/../junk" 55 56 make 57 make install 58 ) 59 export PATH="$PWD/junk/bin:$PATH" 60 61 # Bypass 'ccache' as it's totally useless when building 62 # Firefox and only slows things down. 63 export CC="${CC:-/usr/bin/cc}" 64 export CXX="${CXX:-/usr/bin/c++}" 65 66 export LDFLAGS="$LDFLAGS -Wl,-rpath=/usr/lib/librewolf" 67 export RUSTFLAGS="$RUSTFLAGS -Cdebuginfo=0" 68 69 export MACH_USE_SYSTEM_PYTHON=1 70 export MOZ_DEBUG_FLAGS=-g0 71 export MOZ_NOSPAM=1 72 73 ./mach configure \ 74 --prefix=/usr \ 75 --libdir=/usr/lib \ 76 --enable-optimize="$CFLAGS -w" \ 77 --enable-install-strip \ 78 --enable-strip \ 79 --enable-rust-simd \ 80 --enable-application=browser \ 81 --enable-release \ 82 --enable-alsa \ 83 --enable-default-toolkit=cairo-gtk3-wayland \ 84 --with-app-name=librewolf \ 85 --with-app-basename=Librewolf \ 86 --with-branding=browser/branding/librewolf \ 87 --without-system-nspr \ 88 --without-system-nss \ 89 --with-system-jpeg \ 90 --with-system-zlib \ 91 --with-system-png \ 92 --without-system-libvpx \ 93 --with-system-pixman \ 94 --with-system-ffi \ 95 --disable-profiling \ 96 --disable-accessibility \ 97 --disable-tests \ 98 --disable-system-extension-dirs \ 99 --disable-parental-controls \ 100 --disable-debug-symbols \ 101 --disable-callgrind \ 102 --disable-vtune \ 103 --disable-elf-hack \ 104 --disable-gold \ 105 --disable-jemalloc \ 106 --disable-pulseaudio \ 107 --disable-crashreporter \ 108 --disable-updater \ 109 --disable-dbus \ 110 --disable-eme \ 111 --disable-necko-wifi 112 113 ./mach build 114 DESTDIR="$1" ./mach install 115 116 cp -r settings/* "$1/usr/lib/librewolf/" 117 118 # Remove a lot of uneeded "stuff". 119 rm -rf "$1/usr/include" 120 rm -rf "$1/usr/lib/librewolf-devel" 121 rm -rf "$1/usr/share/idl" 122 rm -rf "$1/usr/lib/librewolf/gtk2" # Drop GTK+2 runtime dependency. 123 rm -f "$1/usr/lib/librewolf/browser/features/fxmonitor@mozilla.org.xpi" 124 rm -f "$1/usr/lib/librewolf/browser/features/screenshots@mozilla.org.xpi" 125 rm -f "$1/usr/lib/librewolf/browser/features/webcompat-reporter@mozilla.org.xpi" 126 rm -f "$1/usr/lib/librewolf/browser/features/webcompat@mozilla.org.xpi" 127 rm -f "$1/usr/lib/librewolf/browser/features/doh-rollout@mozilla.org.xpi"