Advertisement
Guest User

Untitled

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