PKGBUILD 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. # Maintainer (arch): Levente Polyak <anthraxx[at]archlinux[dot]org>
  2. # Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  3. # Contributor: Ionut Biru <ibiru@archlinux.org>
  4. # Contributor: Alexander Baldeck <alexander@archlinux.org>
  5. # Contributor: Dale Blount <dale@archlinux.org>
  6. # Contributor: 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 for branding: quilt mozilla-searchplugins imagemagick
  16. # - disabled tests, they break in an environment without network access.
  17. # - disabled geo-location
  18. # - removed nonfree search engines
  19. # - removed support for insecure chat protocols
  20. _pkgname=thunderbird
  21. pkgname=icedove
  22. epoch=1
  23. pkgver=78.9.1
  24. pkgrel=1
  25. pkgrel+=.parabola1.nonprism1
  26. _brandingver=78.9
  27. _brandingrel=1
  28. pkgdesc='Standalone mail and news reader based on Mozilla Thunderbird'
  29. pkgdesc+=', without support for unsafe and dangerous for privacy protocols'
  30. url=https://wiki.parabola.nu/${pkgname}
  31. arch=(x86_64)
  32. arch+=(i686 armv7h)
  33. license=(MPL GPL LGPL)
  34. depends=(
  35. glibc gtk3 libgdk-3.so mime-types dbus libdbus-1.so dbus-glib alsa-lib nss
  36. hunspell sqlite ttf-font libvpx libvpx.so zlib bzip2 botan libwebp libevent
  37. libjpeg-turbo libffi nspr gcc-libs libx11 libxrender libxfixes libxext
  38. libxcomposite libxdamage pango libpango-1.0.so cairo gdk-pixbuf2 icu
  39. libicui18n.so libicuuc.so freetype2 libfreetype.so fontconfig
  40. libfontconfig.so glib2 libglib-2.0.so pixman libpixman-1.so gnupg
  41. )
  42. optdepends=(
  43. 'libotr: OTR support for active one-to-one chats'
  44. )
  45. makedepends=(
  46. unzip zip diffutils python python-setuptools yasm nasm mesa imake libpulse
  47. inetutils xorg-server-xvfb autoconf2.13 rust clang llvm gtk2 cbindgen nodejs
  48. gawk perl findutils libotr
  49. )
  50. #makedepends[15]='llvm10' # FIXME: DEBUG: | rustup: error while loading shared libraries: libLLVM-10.so: cannot open shared object file: No such file or directory
  51. # # ERROR: Command `rustup which rustc` failed with exit status 127.
  52. makedepends+=(quilt imagemagick)
  53. replaces=(${_pkgname})
  54. options=(!emptydirs !makeflags)
  55. source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
  56. $pkgname.desktop
  57. vendor-prefs.js
  58. distribution.ini
  59. mozconfig.cfg
  60. configure-fix-passing-system-bzip2-ldflags.patch
  61. thunderbird-78.5-rust-1.48.patch)
  62. source+=(https://repo.parabola.nu/other/icedove/${pkgname}_$_brandingver-$_brandingrel.branding.tar.xz{,.sig})
  63. source_armv7h=(arm-wasm-vfp.patch)
  64. sha512sums=('fa27a327ce10a0c16877ac02338aace257f60f69af40d12ae5bb2055f6536db9ba45995765ac0eaa1aea2fa2b353ac9dc6eb06fcdf6cb4ae6fafcd65fe5970c6'
  65. 'SKIP'
  66. 'a3c9815491d9bed0440c60f35867a5b8a2a1343521f288035fcc46e651a11b926c75a9eca2d262b43d510a7a7119709b53637f1b00ddbbee8e5b0a4b33d7b8fd'
  67. 'e21d30a8b79724eda3488ac2bf9dfeb0c7f6bf39e59c37f17574b529d33043765eb54408a55fcbf6f3afa7a58ca99124992d443cdff23ac5c9bdbff33c75f60f'
  68. '31d46f91d9612d30d8553a19d0d309d743467e58b568a4aeea3caf6bd805ba00656561c84a1511c59bce1cf24ba323bfad2cd26a19985f1bf7dfb6d282642972'
  69. '1eba1593ff0a9642d89e6d3e03388b1aef00437b2f6c1f0d81d250d9845b80e057c246eaeb31d8d22001abd65556a9603d1db597baf864481a5bfb7000886b29'
  70. 'e3ed2708b8354015cb3d2c81048d1ce4932d1effbe2b40efa7cf9b45c1b923b9fd708645e2f8aa0136a485a3f7ce6b396b85721aaf535a4a764fd5005fb7e222'
  71. 'bbb8b0e7b9c67372eb22e1d6b6b5758fe504ded84c40a076d4a064374a1bf34ac12d5b514b328ac9ca984d976b9e0fbde81e68a66bec915c997d6be0c0917584')
  72. sha512sums_armv7h=('c25883c4860e511a99d9fbfba5b824145c0862729101721605725f609ca2a41848b741dd100eff390f57031dc5f14af3ea30133de30f75cb20197c420ae20972')
  73. sha512sums+=('78fee952c9bc826a0a7ec262d442150177bf887349641279dafae803b9832a0dd9b8d0722cc084459077a5310eb4f6de6a8d7ffaff6741afe1359f292a373f34'
  74. 'SKIP')
  75. validpgpkeys=(14F26682D0916CDD81E37B6D61B7B526D98F0353) # Mozilla Software Releases <release@mozilla.com>
  76. validpgpkeys+=(BFA8008A8265677063B11BF47171986E4B745536 # Andreas Grapentin
  77. 3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40) # bill-auger
  78. prepare() {
  79. cd $_pkgname-$pkgver
  80. echo "${noextract[@]}"
  81. local src
  82. for src in "${source[@]}"; do
  83. src="${src%%::*}"
  84. src="${src##*/}"
  85. [[ $src = *.patch ]] || continue
  86. [[ $src = arm-wasm-vfp.patch ]] && continue # defer parabola patches
  87. echo "Applying patch $src..."
  88. patch -Np1 < "../$src"
  89. done
  90. cp ../mozconfig.cfg .mozconfig
  91. sed "s|@PWD@|${PWD@Q}|g" -i .mozconfig
  92. case "${CARCH}" in
  93. armv*)
  94. patch -Np1 -i "${srcdir}"/arm-wasm-vfp.patch
  95. sed -i '/--enable-linker=gold/d' .mozconfig
  96. sed -i '/--enable-hardening/d' .mozconfig
  97. sed -i '/--enable-optimize/d' .mozconfig
  98. export MOZ_DEBUG_FLAGS=" "
  99. export CFLAGS+=" -g0"
  100. export CXXFLAGS+=" -g0"
  101. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  102. export RUSTFLAGS="-Cdebuginfo=0"
  103. cat >> .mozconfig <<END
  104. ac_add_options --disable-webrtc
  105. ac_add_options --disable-elf-hack
  106. ac_add_options --enable-optimize="-g0 -O2"
  107. END
  108. ;;
  109. i686)
  110. sed -i 's/--enable-linker=gold/--enable-linker=bfd/' .mozconfig
  111. LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  112. export LDFLAGS
  113. ;;
  114. esac
  115. # perform re-branding
  116. local branding_indir="${srcdir}"/${pkgname}-${_brandingver}
  117. local branding_outdir=comm/mail/branding/${pkgname}
  118. rm -rf -- ${branding_outdir}
  119. cp -aT -- "${branding_indir}"/${pkgname}-branding ${branding_outdir}
  120. export QUILT_PATCHES="${branding_indir}"/patches
  121. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  122. export QUILT_DIFF_ARGS='--no-timestamps'
  123. quilt push -av
  124. # generate icons
  125. for i in 16 22 24 32; do
  126. rsvg-convert -w ${i} -h ${i} "${branding_indir}"/app-icons/${pkgname}_small.svg \
  127. -o "${branding_outdir}/default${i}.png"
  128. done
  129. for i in 48 64 128 256; do
  130. rsvg-convert -w ${i} -h ${i} "${branding_indir}"/app-icons/${pkgname}_big.svg \
  131. -o "${branding_outdir}/default${i}.png"
  132. done
  133. cp "${branding_indir}"/logo/icedove_icon.svg ${branding_outdir}/
  134. cp -av "${branding_indir}"/preview.png comm/mail/themes/linux/mail/preview.png
  135. # Patch search-engines config
  136. local search_engines_sed_cmd='s|https://duckduckgo.com/|https://html.duckduckgo.com/html/|'
  137. local engines_cfg_dir=comm/mail/components/search/extensions
  138. sed -i "${search_engines_sed_cmd}" ${engines_cfg_dir}/ddg/manifest.json
  139. # Delete unused search engine configs
  140. find ${engines_cfg_dir} -mindepth 1 -maxdepth 1 \
  141. -not -name ddg \
  142. -not -name wikipedia \
  143. -exec rm -rf {} \;
  144. # Patch and remove anything that's left
  145. sed -i '\|Phishing Protection|d
  146. \|UrlClassifier|d
  147. \|URLClassifier|d
  148. \|url-classifier|d
  149. ' comm/mail/installer/package-manifest.in
  150. # TODO: this could be moved into the branding package - it already processes all-thunderbird.js
  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. }
  178. build() {
  179. cd $_pkgname-$pkgver
  180. if [[ -n "${SOURCE_DATE_EPOCH}" ]]; then
  181. export MOZ_BUILD_DATE=$(date --date "@${SOURCE_DATE_EPOCH}" "+%Y%m%d%H%M%S")
  182. fi
  183. # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments'
  184. CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
  185. CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
  186. case "${CARCH}" in
  187. armv*)
  188. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  189. sed -i "s/\(cargo_rustc_flags += -C lto\)/#\1/" config/rules.mk
  190. sed -i "s/debug_info = '2'/debug_info = '1'/" build/moz.configure/toolchain.configure
  191. export MOZ_MAKE_FLAGS=-j1
  192. ;;
  193. i686)
  194. sed -i "s/\(cargo_rustc_flags += -C lto\)/#\1/" config/rules.mk
  195. sed -i "s/debug_info = '2'/debug_info = '1'/" build/moz.configure/toolchain.configure
  196. export MOZ_MAKE_FLAGS=-j1
  197. ;;
  198. esac
  199. ./mach configure
  200. ./mach build
  201. ./mach buildsymbols
  202. }
  203. package() {
  204. optdepends=('libcanberra: sound support')
  205. cd $_pkgname-$pkgver
  206. DESTDIR="$pkgdir" ./mach install
  207. install -Dm 644 ../vendor-prefs.js -t "$pkgdir/usr/lib/$pkgname/defaults/pref"
  208. install -Dm 644 ../distribution.ini -t "$pkgdir/usr/lib/$pkgname/distribution"
  209. install -Dm 644 ../$pkgname.desktop -t "$pkgdir/usr/share/applications"
  210. for i in 16 22 24 32 48 64 128 256; do
  211. install -Dm644 comm/mail/branding/$pkgname/default${i}.png \
  212. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  213. done
  214. install -Dm644 comm/mail/branding/$pkgname/${pkgname}_icon.svg \
  215. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg"
  216. # Use system-provided dictionaries
  217. ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
  218. ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
  219. # Install a wrapper to avoid confusion about binary path
  220. install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
  221. #!/bin/sh
  222. exec /usr/lib/$pkgname/$pkgname "\$@"
  223. END
  224. # Replace duplicate binary with wrapper
  225. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  226. ln -srf "$pkgdir/usr/bin/$pkgname" \
  227. "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
  228. }