PKGBUILD 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. # Maintainer (Arch): Levente Polyak <anthraxx[at]archlinux[dot]org>
  2. # Contributor (Arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  3. # Contributor (Arch): Ionut Biru <ibiru@archlinux.org>
  4. # Contributor (Arch): Alexander Baldeck <alexander@archlinux.org>
  5. # Contributor (Arch): Dale Blount <dale@archlinux.org>
  6. # Contributor (Arch): Anders Bostrom <anders.bostrom@home.se>
  7. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  8. # Contributor: André Silva <emulatorman@hyperbola.info>
  9. # Contributor: Márcio Silva <coadde@hyperbola.info>
  10. # Contributor: Luke R. <g4jc@openmailbox.org>
  11. # Contributor: Isaac David <isacdaavid@isacdaavid.info>
  12. # Contributor: bill-auger <bill-auger@programmer.net>
  13. # parabola changes and rationale:
  14. # - rebranded to icedove
  15. # - added makedepends: quilt mozilla-searchplugins python2-blessings
  16. # - added replaces, conflicts: thunderbird
  17. # - disabled tests, they break in an environment without network access.
  18. # - disabled geo-location
  19. # - removed nonfree search engines
  20. # - removed support for insecure chat protocols
  21. _pkgname=thunderbird
  22. pkgname=icedove
  23. replaces=("$_pkgname")
  24. epoch=1
  25. pkgver=68.9.0
  26. pkgrel=1
  27. pkgrel+=.parabola1.nonprism1
  28. _brandingver=68.6
  29. _brandingrel=1
  30. pkgdesc='Standalone mail and news reader based on Mozilla Thunderbird'
  31. pkgdesc+=', without support for unsafe and dangerous for privacy protocols'
  32. url="https://wiki.parabola.nu/$pkgname"
  33. arch=(x86_64)
  34. arch+=(i686 armv7h)
  35. license=(MPL GPL LGPL)
  36. depends=(gtk3 libxt startup-notification mime-types dbus-glib alsa-lib
  37. nss hunspell sqlite ttf-font) # libvpx
  38. # TODO: depends+=(libicui18n.so libicuuc.so)
  39. depends_armv7h=(icu=65)
  40. depends_i686+=(libicui18n.so libicuuc.so)
  41. depends_x86_64+=(libicui18n.so libicuuc.so)
  42. makedepends=(unzip zip diffutils python python2 yasm nasm mesa imake libpulse inetutils xorg-server-xvfb
  43. autoconf2.13 rust clang llvm gtk2 cbindgen nodejs)
  44. makedepends+=(quilt mozilla-searchplugins imagemagick)
  45. optdepends=('libcanberra: sound support')
  46. options=(!emptydirs !makeflags)
  47. source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
  48. $pkgname.desktop)
  49. source+=(https://repo.parabola.nu/other/icedove/${pkgname}_$_brandingver-$_brandingrel.branding.tar.xz{,.sig}
  50. libre-searchengines.patch
  51. mozilla-1338795-regression.patch)
  52. source_armv7h=(arm-wasm-vfp.patch)
  53. sha512sums=('891472c95ba6ff46061131504e89010da512a84b0e1dea0482e603fd4c87f11e099280a245c7dd9fc9320c48229c26602565c089d86f1a1f4271b29b6fc606f0'
  54. 'SKIP'
  55. 'a3c9815491d9bed0440c60f35867a5b8a2a1343521f288035fcc46e651a11b926c75a9eca2d262b43d510a7a7119709b53637f1b00ddbbee8e5b0a4b33d7b8fd'
  56. '5784493253f9b2b231a7f18d7c3c4a4bb9aec7ac4fa801772ac223342676e388ae0c094b95d89d92c1bd38c2f19feb6f51e074d0ea20228a256b6240ecf34832'
  57. 'SKIP'
  58. '3f3160441aa17a50b8bf9f95a0fed8e3428864901d7368409903289f069f51fa94e24b6140bf17981b91b55df77c7c29adb870dda9f1596a77ce1a54a62cac00'
  59. 'f4e892fc7af85877ef6cedd82313f6c0f335cb676cfb30badaa127c51aed00773212b99f1598f5709d6f481f12264463d6334bcde8e8da38ec1ea666622d28a1')
  60. sha512sums_armv7h=('c25883c4860e511a99d9fbfba5b824145c0862729101721605725f609ca2a41848b741dd100eff390f57031dc5f14af3ea30133de30f75cb20197c420ae20972')
  61. validpgpkeys=(14F26682D0916CDD81E37B6D61B7B526D98F0353) # Mozilla Software Releases <release@mozilla.com>
  62. validpgpkeys+=(BFA8008A8265677063B11BF47171986E4B745536) # Andreas Grapentin
  63. prepare() {
  64. cd $_pkgname-$pkgver
  65. # see: https://labs.parabola.nu/issues/2267
  66. # upstream BR: https://bugzilla.mozilla.org/show_bug.cgi?id=1628296
  67. patch -Np1 -i "$srcdir"/mozilla-1338795-regression.patch
  68. cat >.mozconfig <<END
  69. ac_add_options --enable-application=comm/mail
  70. ac_add_options --enable-calendar
  71. ac_add_options --prefix=/usr
  72. ac_add_options --enable-release
  73. ac_add_options --enable-linker=gold
  74. ac_add_options --enable-hardening
  75. ac_add_options --enable-optimize
  76. # https://bugzilla.mozilla.org/show_bug.cgi?id=1521249
  77. #ac_add_options --enable-rust-simd
  78. # https://bugzilla.mozilla.org/show_bug.cgi?id=1423822
  79. ac_add_options --disable-elf-hack
  80. # Branding
  81. ac_add_options --disable-official-branding
  82. ac_add_options --with-branding=comm/mail/branding/icedove
  83. ac_add_options --enable-update-channel=release
  84. ac_add_options --with-distribution-id=nu.parabola
  85. # System libraries
  86. ac_add_options --with-system-zlib
  87. ac_add_options --with-system-bz2
  88. ac_add_options --with-system-icu
  89. ac_add_options --with-system-jpeg
  90. # ac_add_options --with-system-libvpx
  91. ac_add_options --with-system-nspr
  92. ac_add_options --with-system-nss
  93. ac_add_options --enable-system-sqlite
  94. ac_add_options --enable-system-ffi
  95. # Features
  96. ac_add_options --enable-alsa
  97. ac_add_options --disable-jack
  98. ac_add_options --enable-startup-notification
  99. ac_add_options --disable-crashreporter
  100. ac_add_options --disable-updater
  101. ac_add_options --disable-gconf
  102. # tests require network access.
  103. ac_add_options --disable-tests
  104. END
  105. if [[ $CARCH = arm* ]]; then
  106. patch -Np1 -i "$srcdir"/arm-wasm-vfp.patch
  107. sed -i '/--enable-linker=gold/d' .mozconfig
  108. sed -i '/--enable-hardening/d' .mozconfig
  109. sed -i '/--enable-optimize/d' .mozconfig
  110. export MOZ_DEBUG_FLAGS=" "
  111. export CFLAGS+=" -g0"
  112. export CXXFLAGS+=" -g0"
  113. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  114. export RUSTFLAGS="-Cdebuginfo=0"
  115. cat >> .mozconfig <<END
  116. ac_add_options --disable-webrtc
  117. ac_add_options --disable-elf-hack
  118. ac_add_options --enable-optimize="-g0 -O2"
  119. END
  120. fi
  121. if [[ $CARCH = i686 ]]; then
  122. sed -i 's/--enable-linker=gold/--enable-linker=bfd/' .mozconfig
  123. LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  124. export LDFLAGS
  125. fi
  126. # perform rebranding
  127. local brandingdir="$srcdir/$pkgname-$_brandingver"
  128. rm -rf -- comm/mail/branding/$pkgname
  129. cp -aT -- $brandingdir/$pkgname-branding/ comm/mail/branding/$pkgname
  130. export QUILT_PATCHES=$brandingdir/patches
  131. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  132. export QUILT_DIFF_ARGS='--no-timestamps'
  133. quilt push -av
  134. # produce icons
  135. for i in 16 22 24 32; do
  136. rsvg-convert -w $i -h $i "$brandingdir/app-icons/${pkgname}_small.svg" \
  137. -o "comm/mail/branding/$pkgname/default$i.png"
  138. done
  139. for i in 48 64 128 256; do
  140. rsvg-convert -w $i -h $i "$brandingdir/app-icons/${pkgname}_big.svg" \
  141. -o "comm/mail/branding/$pkgname/default$i.png"
  142. done
  143. cp "$brandingdir/logo/icedove_icon.svg" "comm/mail/branding/$pkgname/"
  144. # Patch and remove anything that's left
  145. patch -Np1 -i "$srcdir/libre-searchengines.patch"
  146. sed -i '\|Phishing Protection|d
  147. \|UrlClassifier|d
  148. \|URLClassifier|d
  149. \|url-classifier|d
  150. ' comm/mail/installer/package-manifest.in
  151. sed -i '\|extensions[.]getAddons[.]get[.]url| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  152. \|extensions[.]getAddons[.]search[.]browseURL| s|https://addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  153. \|extensions[.]getAddons[.]search[.]url| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  154. \|extensions[.]webservice[.]discoverURL| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  155. ' comm/mail/app/profile/all-thunderbird.js
  156. sed -i '\|facebook|d
  157. \|gtalk|d
  158. \|odnoklassniki|d
  159. \|skype|d
  160. \|twitter|d
  161. \|yahoo|d
  162. ' comm/chat/moz.build
  163. sed -i '\|facebook[.]js|d
  164. \|facebook[.]manifest|d
  165. \|gtalk[.]js|d
  166. \|gtalk[.]manifest|d
  167. \|odnoklassniki[.]js|d
  168. \|odnoklassniki[.]manifest|d
  169. \|skype[.]js|d
  170. \|skype[.]manifest|d
  171. \|twitter[.]js|d
  172. \|twitter[.]manifest|d
  173. \|yahoo[.]js|d
  174. \|yahoo[.]manifest|d
  175. ' comm/mail/installer/package-manifest.in
  176. rm -rv comm/chat/protocols/{facebook,gtalk,odnoklassniki,skype,twitter,yahoo}
  177. cp -av $srcdir/$pkgname-$_brandingver/preview.png \
  178. comm/mail/themes/linux/mail/preview.png
  179. # Load our searchplugins
  180. rm -rv comm/suite/locales/en-US/searchplugins
  181. cp -av /usr/lib/mozilla/searchplugins comm/suite/locales/en-US/
  182. }
  183. build() {
  184. cd $_pkgname-$pkgver
  185. # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments'
  186. CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
  187. CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
  188. case "${CARCH}" in
  189. armv*)
  190. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  191. sed -i "s/\(cargo_rustc_flags += -C lto\)/#\1/" config/rules.mk
  192. sed -i "s/debug_info = '2'/debug_info = '1'/" build/moz.configure/toolchain.configure
  193. export MOZ_MAKE_FLAGS=-j1
  194. ;;
  195. i686)
  196. sed -i "s/\(cargo_rustc_flags += -C lto\)/#\1/" config/rules.mk
  197. sed -i "s/debug_info = '2'/debug_info = '1'/" build/moz.configure/toolchain.configure
  198. export MOZ_MAKE_FLAGS=-j1
  199. ;;
  200. esac
  201. ./mach configure
  202. ./mach build
  203. ./mach buildsymbols
  204. }
  205. package() {
  206. cd $_pkgname-$pkgver
  207. DESTDIR="$pkgdir" ./mach install
  208. _vendorjs="$pkgdir/usr/lib/$pkgname/defaults/preferences/vendor.js"
  209. install -Dm644 /dev/stdin "$_vendorjs" <<END
  210. // Use LANG environment variable to choose locale
  211. pref("intl.locale.requested", "");
  212. // Use system-provided dictionaries
  213. pref("spellchecker.dictionary_path", "/usr/share/hunspell");
  214. // Disable default mailer checking.
  215. pref("mail.shell.checkDefaultMail", false);
  216. // Don't disable our bundled extensions in the application directory
  217. pref("extensions.autoDisableScopes", 11);
  218. pref("extensions.shownSelectionUI", true);
  219. // Disable Social API for content
  220. pref("social.remote-install.enabled", false);
  221. pref("social.toast-notifications.enabled", false);
  222. // Make sure that whitelisted and directory installs are empty
  223. pref("social.whitelist", "");
  224. pref("social.directories", "");
  225. // Disable the GeoLocation API for content
  226. pref("geo.enabled", false);
  227. // TODO: this "whats new" page should be in the branding package or abslibre
  228. // Pointing the "Help -> What's new" menu entry to mozilla.debian.net
  229. //pref("mailnews.start_page.override_url", "http://wiki.debian.org/Icedove/WhatsNew45");
  230. END
  231. _distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  232. install -Dm644 /dev/stdin "$_distini" <<END
  233. [Global]
  234. id=parabola
  235. version=1.0
  236. about=Icedove for Parabola GNU/Linux-libre
  237. [Preferences]
  238. app.distributor=parabola
  239. app.distributor.channel=$pkgname
  240. app.partner.parabola=parabola
  241. END
  242. for i in 16 22 24 32 48 64 128 256; do
  243. install -Dm644 comm/mail/branding/$pkgname/default${i}.png \
  244. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  245. done
  246. install -Dm644 comm/mail/branding/$pkgname/${pkgname}_icon.svg \
  247. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg"
  248. install -Dm644 ../$pkgname.desktop \
  249. "$pkgdir/usr/share/applications/$pkgname.desktop"
  250. # Use system-provided dictionaries
  251. ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
  252. ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
  253. # Install a wrapper to avoid confusion about binary path
  254. install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
  255. #!/bin/sh
  256. exec /usr/lib/$pkgname/$pkgname "\$@"
  257. END
  258. # Replace duplicate binary with wrapper
  259. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  260. ln -srf "$pkgdir/usr/bin/$pkgname" \
  261. "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
  262. }