Advertisement
Guest User

Firefox ESR PKGBUILD GLSL version patch

a guest
Oct 18th, 2017
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. # $Id$
  2. # Maintainer : Figue <ffigue@gmail.com>
  3. # Contributor : Ionut Biru <ibiru@archlinux.org>
  4. # Contributor: Jakub Schmidtke <sjakub@gmail.com>
  5.  
  6. pkgname=firefox-esr
  7. pkgver=52.4.1
  8. pkgrel=2
  9. pkgdesc="Standalone web browser from mozilla.org, Extended Support Release"
  10. arch=(i686 x86_64)
  11. license=(MPL GPL LGPL)
  12. url="https://www.mozilla.org/en-US/firefox/organizations/"
  13. depends=(gtk3 gtk2 mozilla-common libxt startup-notification mime-types dbus-glib alsa-lib ffmpeg
  14. libvpx libevent nss hunspell sqlite ttf-font icu)
  15. makedepends=(unzip zip diffutils python2 yasm mesa imake gconf libpulse inetutils xorg-server-xvfb
  16. autoconf2.13 rust)
  17. optdepends=('networkmanager: Location detection via available WiFi networks'
  18. 'libnotify: Notification integration'
  19. 'speech-dispatcher: Text-to-Speech')
  20. provides=(firefox)
  21. conflicts=(firefox)
  22. options=(!emptydirs !makeflags)
  23. source=(https://ftp.mozilla.org/pub/firefox/releases/${pkgver}esr/source/firefox-${pkgver}esr.source.tar.xz
  24. firefox.desktop firefox-symbolic.svg
  25. 0001-Bug-54395-remove-hardcoded-flag-lcrmf.patch
  26. firefox-install-dir.patch fix-wifi-scanner.diff
  27. glibc-2.26-fix.diff
  28. rust-i686.patch
  29. make_SystemResourceMonitor.stop_more_resilient_to_errors.patch
  30. nvidia-GLSL-version.patch)
  31. sha256sums=('96fab11b7e5bd016f80718161ee8dd8afdf989a2cd03106a148b15def2569457'
  32. 'c202e5e18da1eeddd2e1d81cb3436813f11e44585ca7357c4c5f1bddd4bec826'
  33. 'a2474b32b9b2d7e0fb53a4c89715507ad1c194bef77713d798fa39d507def9e9'
  34. '93c495526c1a1227f76dda5f3a43b433bc7cf217aaf74bd06b8fc187d285f593'
  35. 'd86e41d87363656ee62e12543e2f5181aadcff448e406ef3218e91865ae775cd'
  36. '9765bca5d63fb5525bbd0520b7ab1d27cabaed697e2fc7791400abc3fa4f13b8'
  37. 'cd7ff441da66a287f8712e60cdc9e216c30355d521051e2eaae28a66d81915e8'
  38. 'f61ea706ce6905f568b9bdafd1b044b58f20737426f0aa5019ddb9b64031a269'
  39. '7760ebe71f4057cbd2f52b715abaf0d944c14c39e2bb2a5322114ad8451e12d9'
  40. '5ae7f60b7d5bbb1a83576f513225c8d478f597d167f7601efb7e5b82cdb12f42')
  41. validpgpkeys=('2B90598A745E992F315E22C58AB132963A06537A')
  42.  
  43. # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
  44. # Note: These are for Arch Linux use ONLY. For your own distribution, please
  45. # get your own set of keys. Feel free to contact foutrelis@archlinux.org for
  46. # more information.
  47. _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
  48.  
  49. # Mozilla API keys (see https://location.services.mozilla.com/api)
  50. # Note: These are for Arch Linux use ONLY. For your own distribution, please
  51. # get your own set of keys. Feel free to contact heftig@archlinux.org for
  52. # more information.
  53. _mozilla_api_key=16674381-f021-49de-8622-3021c5942aff
  54.  
  55. prepare() {
  56. mkdir path
  57. ln -s /usr/bin/python2 path/python
  58.  
  59. cd firefox-${pkgver}esr
  60.  
  61. patch -Np1 -i ../firefox-install-dir.patch
  62.  
  63. # https://bugzilla.mozilla.org/show_bug.cgi?id=1314968
  64. patch -Np1 -i ../fix-wifi-scanner.diff
  65.  
  66. # https://bugs.archlinux.org/task/54395 // https://bugzilla.mozilla.org/show_bug.cgi?id=1371991
  67. patch -Np1 -i ../0001-Bug-54395-remove-hardcoded-flag-lcrmf.patch
  68.  
  69. # https://bugzilla.mozilla.org/show_bug.cgi?id=1385667
  70. # https://bugzilla.mozilla.org/show_bug.cgi?id=1394149
  71. patch -d toolkit/crashreporter/google-breakpad/src/client -Np4 < ../glibc-2.26-fix.diff
  72.  
  73. # https://bugzilla.mozilla.org/show_bug.cgi?id=1382358
  74. # https://hg.mozilla.org/integration/mozilla-inbound/rev/4a5185552a07
  75. patch -Np1 -i ../nvidia-GLSL-version.patch
  76.  
  77. # Build with the rust targets we actually ship
  78. patch -Np1 -i ../rust-i686.patch
  79.  
  80. # https://bugzilla.mozilla.org/show_bug.cgi?id=1384062
  81. patch -Np1 -i ../make_SystemResourceMonitor.stop_more_resilient_to_errors.patch
  82.  
  83. echo -n "$_google_api_key" >google-api-key
  84. echo -n "$_mozilla_api_key" >mozilla-api-key
  85.  
  86. cat >.mozconfig <<END
  87. ac_add_options --enable-application=browser
  88.  
  89. ac_add_options --prefix=/usr
  90. ac_add_options --enable-release
  91. ac_add_options --enable-gold
  92. ac_add_options --enable-pie
  93. ac_add_options --enable-optimize="-O2"
  94.  
  95. # Branding
  96. ac_add_options --enable-official-branding
  97. ac_add_options --enable-update-channel=release
  98. ac_add_options --with-distribution-id=org.archlinux
  99. export MOZILLA_OFFICIAL=1
  100. export MOZ_TELEMETRY_REPORTING=1
  101. export MOZ_ADDON_SIGNING=1
  102. export MOZ_REQUIRE_SIGNING=1
  103.  
  104. # Keys
  105. ac_add_options --with-google-api-keyfile=${PWD@Q}/google-api-key
  106. ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key
  107.  
  108. # System libraries
  109. ac_add_options --with-system-nspr
  110. ac_add_options --with-system-nss
  111. ac_add_options --with-system-icu
  112. ac_add_options --with-system-zlib
  113. ac_add_options --with-system-bz2
  114. ac_add_options --enable-system-hunspell
  115. ac_add_options --enable-system-sqlite
  116. ac_add_options --enable-system-ffi
  117. ac_add_options --enable-system-pixman
  118.  
  119. # Features
  120. ac_add_options --enable-startup-notification
  121. ac_add_options --enable-crashreporter
  122. ac_add_options --enable-alsa
  123. ac_add_options --disable-updater
  124. END
  125. }
  126.  
  127. build() {
  128. cd firefox-${pkgver}esr
  129.  
  130. # _FORTIFY_SOURCE causes configure failures
  131. CPPFLAGS+=" -O2"
  132.  
  133. # # Hardening
  134. # LDFLAGS+=" -Wl,-z,now"
  135.  
  136. export PATH="$srcdir/path:$PATH"
  137.  
  138. # Do PGO
  139. #xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \
  140. # MOZ_PGO=1 ./mach build
  141. ./mach build
  142. # ./mach buildsymbols
  143. }
  144.  
  145. package() {
  146. cd firefox-${pkgver}esr
  147. DESTDIR="$pkgdir" ./mach install
  148. # find . -name '*crashreporter-symbols.zip' -exec cp -fvt "$startdir" {} +
  149.  
  150. _vendorjs="$pkgdir/usr/lib/firefox/browser/defaults/preferences/vendor.js"
  151. install -Dm644 /dev/stdin "$_vendorjs" <<END
  152. // Use LANG environment variable to choose locale
  153. pref("intl.locale.matchOS", true);
  154.  
  155. // Disable default browser checking.
  156. pref("browser.shell.checkDefaultBrowser", false);
  157.  
  158. // Don't disable our bundled extensions in the application directory
  159. pref("extensions.autoDisableScopes", 11);
  160. pref("extensions.shownSelectionUI", true);
  161.  
  162. // Opt all of us into e10s, instead of just 50%
  163. pref("browser.tabs.remote.autostart", true);
  164. END
  165.  
  166. _distini="$pkgdir/usr/lib/firefox/distribution/distribution.ini"
  167. install -Dm644 /dev/stdin "$_distini" <<END
  168. [Global]
  169. id=archlinux
  170. version=1.0
  171. about=Mozilla Firefox ESR for Arch Linux
  172.  
  173. [Preferences]
  174. app.distributor=archlinux
  175. app.distributor.channel=$pkgname
  176. app.partner.archlinux=archlinux
  177. END
  178.  
  179. for i in 16 22 24 32 48 256; do
  180. install -Dm644 browser/branding/official/default$i.png \
  181. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png"
  182. done
  183. install -Dm644 browser/branding/official/content/icon64.png \
  184. "$pkgdir/usr/share/icons/hicolor/64x64/apps/firefox.png"
  185. install -Dm644 browser/branding/official/mozicon128.png \
  186. "$pkgdir/usr/share/icons/hicolor/128x128/apps/firefox.png"
  187. install -Dm644 browser/branding/official/content/about-logo.png \
  188. "$pkgdir/usr/share/icons/hicolor/192x192/apps/firefox.png"
  189. install -Dm644 browser/branding/official/content/about-logo@2x.png \
  190. "$pkgdir/usr/share/icons/hicolor/384x384/apps/firefox.png"
  191. install -Dm644 ../firefox-symbolic.svg \
  192. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/firefox-symbolic.svg"
  193.  
  194. install -Dm644 ../firefox.desktop \
  195. "$pkgdir/usr/share/applications/firefox.desktop"
  196.  
  197. # Use system-provided dictionaries
  198. rm -r "$pkgdir"/usr/lib/firefox/dictionaries
  199. ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/firefox/dictionaries"
  200. ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/firefox/hyphenation"
  201.  
  202. # Install a wrapper to avoid confusion about binary path
  203. install -Dm755 /dev/stdin "$pkgdir/usr/bin/firefox" <<END
  204. #!/bin/sh
  205. exec /usr/lib/firefox/firefox "\$@"
  206. END
  207.  
  208. # Replace duplicate binary with wrapper
  209. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  210. ln -srf "$pkgdir/usr/bin/firefox" \
  211. "$pkgdir/usr/lib/firefox/firefox-bin"
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement