Guest User

Untitled

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