Advertisement
Guest User

Untitled

a guest
Mar 16th, 2023
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  1. # Maintainer: Yurii Kolesnykov <[email protected]>
  2. # Based on community/firefox-developer-edition by Andrew Crerar <[email protected]>
  3. # Based on extra/thunderbird by Levente Polyak <anthraxx[at]archlinux[dot]org>
  4.  
  5. pkgname=thunderbird-beta
  6. _pkgname=thunderbird
  7. pkgver=112.0b1
  8. pkgrel=1
  9. pkgdesc='Beta version of standalone mail and news reader from mozilla.org'
  10. arch=('x86_64')
  11. license=('MPL' 'GPL' 'LGPL')
  12. url="https://www.thunderbird.net/channel/#beta"
  13. depends=('dbus-glib'
  14. 'ffmpeg'
  15. 'gtk3'
  16. 'libpulse'
  17. 'libxt'
  18. 'mime-types'
  19. 'nss'
  20. 'ttf-font')
  21. makedepends=('cbindgen'
  22. 'clang'
  23. 'diffutils'
  24. 'dump_syms'
  25. 'imake'
  26. 'inetutils'
  27. 'jack'
  28. 'lld'
  29. 'llvm'
  30. 'mesa'
  31. 'nasm'
  32. 'nodejs'
  33. 'python'
  34. 'rust'
  35. 'unzip'
  36. 'wasi-compiler-rt'
  37. 'wasi-libc'
  38. 'wasi-libc++'
  39. 'wasi-libc++abi'
  40. 'xorg-server-xvfb'
  41. 'yasm'
  42. 'zip')
  43. makedepends+=('libotr')
  44. optdepends=('networkmanager: Location detection via available WiFi networks'
  45. 'libnotify: Notification integration'
  46. 'pulseaudio: Audio support'
  47. 'speech-dispatcher: Text-to-Speech'
  48. 'hunspell-en_US: Spell checking, American English'
  49. 'xdg-desktop-portal: Screensharing with Wayland')
  50. optdepends+=('libotr: OTR support for active one-to-one chats')
  51. options=(!emptydirs !makeflags !strip !lto !debug)
  52. provides=("thunderbird=$pkgver")
  53. source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
  54. install-dir.patch
  55. "$pkgname".desktop
  56. )
  57. b2sums=('903cf9a584f6f84a1c43d5dbf4a5aa5be99af897f213235743063463ce820ccd7276b82dc5500be931ed44092c7191716bc2a7023c232eece645d8fe892f2277'
  58. 'SKIP'
  59. 'ba188a0c1359f49390a789621b2c0bec67f4152f62c0dced26b31ec291abccfb5636dba0f8ed1f879e1a2a237e183b96b092d760e04e148a64da18660b87dcfb'
  60. '3518012290b5b358d882d7d12bc2455345b89cef4abfbccaca025dfb935fcefe49806dd534e75b10c0c6a3495b7133a7feb3f11d7773a0ce252f8d68e15b5a24')
  61. validpgpkeys=(
  62. 14F26682D0916CDD81E37B6D61B7B526D98F0353 # Mozilla Software Releases <[email protected]>
  63. 4360FE2109C49763186F8E21EBE41E90F6F12F6D # Mozilla Software Releases <[email protected]>
  64. )
  65. # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
  66. # Note: These are for Arch Linux use ONLY. For your own distribution, please
  67. # get your own set of keys. Feel free to contact [email protected] for
  68. # more information.
  69. _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
  70.  
  71. # Mozilla API keys (see https://location.services.mozilla.com/api)
  72. # Note: These are for Arch Linux use ONLY. For your own distribution, please
  73. # get your own set of keys. Feel free to contact [email protected] for
  74. # more information.
  75. _mozilla_api_key=16674381-f021-49de-8622-3021c5942aff
  76.  
  77. prepare() {
  78. mkdir -p mozbuild
  79. cd "${_pkgname}-${pkgver%b*}"
  80.  
  81. local src
  82. for src in "${source[@]}"; do
  83. src="${src%%::*}"
  84. src="${src##*/}"
  85. [[ $src = *.patch ]] || continue
  86. msg2 "Applying patch $src..."
  87. patch -Np1 < "../$src"
  88. done
  89.  
  90. echo -n "$_google_api_key" > google-api-key
  91. echo -n "$_mozilla_api_key" > mozilla-api-key
  92. cat > .mozconfig << END
  93. ac_add_options --enable-application=comm/mail
  94. mk_add_options MOZ_OBJDIR=${PWD@Q}/obj
  95.  
  96. ac_add_options --prefix=/usr
  97. ac_add_options --enable-release
  98. ac_add_options --enable-hardening
  99. ac_add_options --enable-optimize
  100. ac_add_options --enable-rust-simd
  101. ac_add_options --enable-linker=lld
  102. ac_add_options --disable-elf-hack
  103. ac_add_options --disable-bootstrap
  104. ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot
  105.  
  106. # Branding
  107. ac_add_options --enable-official-branding
  108. ac_add_options --enable-update-channel=aurora
  109. ac_add_options --with-distribution-id=org.archlinux
  110. ac_add_options --with-unsigned-addon-scopes=app,system
  111. ac_add_options --allow-addon-sideload
  112. export MOZILLA_OFFICIAL=1
  113. export MOZ_APP_REMOTINGNAME=${pkgname//-/}
  114. export MOZ_REQUIRE_SIGNING=
  115.  
  116. # Keys
  117. ac_add_options --with-google-location-service-api-keyfile=${PWD@Q}/google-api-key
  118. ac_add_options --with-google-safebrowsing-api-keyfile=${PWD@Q}/google-api-key
  119. ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key
  120.  
  121. # System libraries
  122. ac_add_options --with-system-nspr
  123. ac_add_options --with-system-nss
  124.  
  125. # Features
  126. ac_add_options --enable-alsa
  127. ac_add_options --enable-jack
  128. ac_add_options --enable-crashreporter
  129. ac_add_options --disable-updater
  130. ac_add_options --disable-tests
  131.  
  132. # System addons
  133. ac_add_options --with-unsigned-addon-scopes=app,system
  134. ac_add_options --allow-addon-sideload
  135. END
  136. }
  137.  
  138. build() {
  139. cd "${_pkgname}-${pkgver%b*}"
  140.  
  141. export MOZ_NOSPAM=1
  142. export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
  143. export MOZ_ENABLE_FULL_SYMBOLS=1
  144. export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE="pip"
  145.  
  146. echo "Building thunderbird..."
  147. ./mach build
  148.  
  149. echo "Building symbol archive..."
  150. ./mach buildsymbols
  151. }
  152.  
  153. package() {
  154. cd "${_pkgname}-${pkgver%b*}"
  155. DESTDIR="$pkgdir" ./mach install
  156.  
  157. local vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js"
  158. install -Dvm644 /dev/stdin "$vendorjs" << END
  159. // Use LANG environment variable to choose locale.
  160. pref("intl.locale.requested", "");
  161.  
  162. // Use system-provided dictionaries.
  163. pref("spellchecker.dictionary_path", "/usr/share/hunspell");
  164.  
  165. // Disable default mailer checking.
  166. pref("mail.shell.checkDefaultMail", false);
  167.  
  168. // Don't disable our bundled extensions in the application directory.
  169. pref("extensions.autoDisableScopes", 11);
  170. pref("extensions.shownSelectionUI", true);
  171.  
  172. // Disable telemetry.
  173. pref("datareporting.healthreport.uploadEnabled", false);
  174. pref("datareporting.policy.dataSubmissionEnabled", false);
  175. pref("toolkit.telemetry.archive.enabled", false);
  176. END
  177.  
  178. local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  179. install -Dvm644 /dev/stdin "$distini" << END
  180. [Global]
  181. id=archlinux
  182. version=1.0
  183. about=Mozilla Thunderbird Beta for Arch Linux
  184.  
  185. [Preferences]
  186. app.distributor=archlinux
  187. app.distributor.channel=$pkgname
  188. app.partner.archlinux=archlinux
  189. END
  190.  
  191. for i in 16 22 24 32 48 64 128 256; do
  192. install -Dvm644 comm/mail/branding/thunderbird/default${i}.png \
  193. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  194. done
  195.  
  196. install -Dvm644 comm/mail/branding/thunderbird/content/about-logo.svg \
  197. "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg"
  198. install -Dvm644 comm/mail/branding/thunderbird/TB-symbolic.svg \
  199. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg"
  200.  
  201. install -Dvm644 ../$pkgname.desktop \
  202. "$pkgdir/usr/share/applications/$pkgname.desktop"
  203.  
  204. # Use system-provided dictionaries
  205. ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
  206. ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
  207.  
  208. # Install a wrapper to avoid confusion about binary path
  209. install -Dvm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" << END
  210. #!/bin/sh
  211. exec /usr/lib/$pkgname/$_pkgname "\$@"
  212. END
  213.  
  214. # Replace duplicate binary with wrapper
  215. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  216. ln -srfv "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/lib/$pkgname/$_pkgname-bin"
  217.  
  218. # Use system certificates
  219. local nssckbi="$pkgdir/usr/lib/$pkgname/libnssckbi.so"
  220. if [[ -e $nssckbi ]]; then
  221. ln -srfv "$pkgdir/usr/lib/libnssckbi.so" "$nssckbi"
  222. fi
  223.  
  224. export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE="$startdir/.crash-stats-api.token"
  225. if [[ -f $SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE ]]; then
  226. make -C obj uploadsymbols
  227. else
  228. cp -fvt "$startdir" obj/dist/*crashreporter-symbols-full.tar.zst
  229. fi
  230. }
  231.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement